Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Apr 11, 2023
1 parent 537483a commit 00f7b79
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions dockerfile.d/start_node_new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ RELAYCHAIN="${RELAYCHAIN:-"polkadot"}"
PARACHAIN_DB="${PARACHAIN_DB:-"paritydb"}"
RELAYCHAIN_DB="${RELAYCHAIN_DB:-"paritydb"}"

PARACHAIN_LIBP2P_PORT="${PARACHAIN_PORT:-"30333"}"
RELAYCHAIN_LIBP2P_PORT="${RELAYCHAIN_PORT:-"30334"}"
PARACHAIN_LIBP2P_PORT="${PARACHAIN_LIBP2P_PORT:-"30333"}"
RELAYCHAIN_LIBP2P_PORT="${RELAYCHAIN_LIBP2P_PORT:-"30334"}"

PARACHAIN_PROMETHEUS_PORT="${PARACHAIN_PROMETHEUS_PORT:-"9615"}"
RELAYCHAIN_PROMETHEUS_PORT="${RELAYCHAIN_PROMETHEUS_PORT:-"9616"}"
Expand All @@ -23,31 +23,37 @@ RELAYCHAIN_HTTP_RPC_PORT="${RELAYCHAIN_HTTP_RPC_PORT:-"9934"}"
PARACHAIN_WS_RPC_PORT="${PARACHAIN_WS_RPC_PORT:-"9944"}"
RELAYCHAIN_WS_RPC_PORT="${RELAYCHAIN_WS_RPC_PORT:-"9945"}"

PARACHAIN_UNSAFE_RPC="--rpc-methods unsafe"
RELAYCHAIN_UNSAFE_RPC="--rpc-methods unsafe"

PARACHAIN_EXPOSE_ENDPOINTS="--rpc-external --ws-external --prometheus-external --rpc-cors all"
RELAYCHAIN_EXPOSE_ENDPOINTS="--rpc-external --ws-external --prometheus-external --rpc-cors all"

case ${NODE_ROLE} in
"")
echo "You must set NODE_ROLE env"
echo "accept values (case sensitive): <Empty> | FULL | ARCHIVE | COLLATOR | MINER"
echo "accept values (case sensitive): FULL | ARCHIVE | COLLATOR | MINER"
exit 1
;;
"FULL")
PARACHAIN_ROLE_ARGS=""
RELAYCHAIN_ROLE_ARGS=""
;;
"ARCHIVE")
PARACHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical --rpc-external"
PARACHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical"
RELAYCHAIN_ROLE_ARGS=""
;;
"COLLATOR")
PARACHAIN_ROLE_ARGS="--collator --rpc-external --rpc-methods unsafe"
PARACHAIN_ROLE_ARGS="--collator"
RELAYCHAIN_ROLE_ARGS=""
;;
"MINER")
PARACHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical --rpc-external --rpc-methods unsafe"
RELAYCHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical --rpc-external --rpc-methods unsafe"
PARACHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical"
RELAYCHAIN_ROLE_ARGS="--blocks-pruning archive-canonical --state-pruning archive-canonical"
;;
*)
echo "Unknown NODE_ROLE ${NODE_ROLE}"
echo "accept values (case sensitive): <Empty> | FULL | ARCHIVE | COLLATOR | MINER"
echo "accept values (case sensitive): FULL | ARCHIVE | COLLATOR | MINER"
exit 1
;;
esac
Expand All @@ -63,10 +69,9 @@ echo "Starting Khala node as role '${NODE_ROLE}' with extra parachain args '${PA
--prometheus-port $PARACHAIN_PROMETHEUS_PORT \
--rpc-port $PARACHAIN_HTTP_RPC_PORT \
--ws-port $PARACHAIN_WS_RPC_PORT \
--prometheus-external \
--ws-external \
--rpc-cors all \
--no-hardware-benchmarks \
$PARACHAIN_EXPOSE_ENDPOINTS \
$PARACHAIN_UNSAFE_RPC \
$PARACHAIN_ROLE_ARGS \
$PARACHAIN_EXTRA_ARGS \
-- \
Expand All @@ -76,9 +81,8 @@ echo "Starting Khala node as role '${NODE_ROLE}' with extra parachain args '${PA
--prometheus-port $RELAYCHAIN_PROMETHEUS_PORT \
--rpc-port $RELAYCHAIN_HTTP_RPC_PORT \
--ws-port $RELAYCHAIN_WS_RPC_PORT \
--prometheus-external \
--ws-external \
--rpc-cors all \
--no-hardware-benchmarks \
$RELAYCHAIN_EXPOSE_ENDPOINTS \
$RELAYCHAIN_UNSAFE_RPC \
$RELAYCHAIN_ROLE_ARGS \
$RELAYCHAIN_EXTRA_ARGS

0 comments on commit 00f7b79

Please sign in to comment.