Created
May 8, 2018 04:59
-
-
Save stnbu/26729d52d33f454ac110657b78bf7e9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://wiki.parity.io/Private-development-chain | |
# https://github.com/paritytech/parity/issues/7470 | |
# 0x00a329c0648769a73afac7f9381e08fb43dbea72 | |
BASE_PATH=~/meth/nodes | |
BIND_IP=10.45.92.1 | |
LOG_LEVEL=info | |
NAME=$(basename $0) | |
# how to pass remain-on-exit ? | |
# --nat "extip:$BIND_IP" \ | |
# Hint: | |
# Defaults: | |
# PORT=30303 | |
# WS_PORT=8546 | |
# JSONRPC_PORT=8545 | |
# UI_PORT=8180 | |
start_node() { | |
NAME="$1" | |
SUM="1"$(echo "$NAME" | sum | cut -d ' ' -f 1) # guaranteed > 100,000 | |
if [ -z "$PORT" ] ; then | |
PORT=$(expr $SUM / 100) | |
PORT=$(expr $PORT + 25) # in case we get a 1000. 1024 is the lowest | |
fi | |
WS_PORT="${WS_PORT:-$(expr $PORT + 1)}" | |
JSONRPC_PORT="${JSONRPC_PORT:-$(expr $PORT + 2)}" | |
UI_PORT="${UI_PORT:-$(expr $PORT + 3)}" | |
mkdir -p "$BASE_PATH/$NAME" && \ | |
\ | |
parity \ | |
--port=$PORT \ | |
--ws-port=$WS_PORT \ | |
--jsonrpc-port=$JSONRPC_PORT \ | |
--ui-port=$UI_PORT \ | |
--reserved-peers=$HOME/reserved-peers \ | |
--config dev \ | |
--fat-db=on \ | |
--base-path="$BASE_PATH/$NAME" \ | |
--no-download \ | |
--identity="$NAME" \ | |
--force-ui \ | |
--ui-hosts=all \ | |
--no-discovery \ | |
--ui-interface="$BIND_IP" \ | |
--jsonrpc-apis=safe \ | |
--jsonrpc-hosts=all \ | |
--ws-interface="$BIND_IP" \ | |
--jsonrpc-interface="$BIND_IP" \ | |
--ws-apis=safe \ | |
--ws-hosts=all \ | |
--ipc-apis=safe \ | |
--ipfs-api-interface="$BIND_IP" \ | |
--ipfs-api-hosts=all \ | |
--no-acl-check \ | |
--secretstore-interface="$BIND_IP" \ | |
--secretstore-http-interface="$BIND_IP" \ | |
--no-color \ | |
--logging="$LOG_LEVEL" \ | |
--log-file=$HOME/logs/"$NAME".out.log \ | |
--pruning=archive | |
} | |
for N in $@ ; do | |
start_node $N | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment