-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
160 additions
and
45 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/bash | ||
|
||
DATA_PATH="$HOME/data" | ||
|
||
NODE_NAME="${NODE_NAME:-"khala-node"}" | ||
NODE_ROLE="${NODE_ROLE:-""}" | ||
|
||
PARACHAIN_PORT="${PARACHAIN_PORT:-"30333"}" | ||
RELAYCHAIN_PORT="${RELAYCHAIN_PORT:-"30334"}" | ||
|
||
PARACHAIN_DB="${PARACHAIN_DB:-"paritydb"}" | ||
RELAYCHAIN_DB="${RELAYCHAIN_DB:-"paritydb"}" | ||
|
||
PARACHAIN="${PARACHAIN:-"phala"}" | ||
RELAYCHAIN="${RELAYCHAIN:-"polkadot"}" | ||
|
||
case ${NODE_ROLE} in | ||
"") | ||
echo "You must set NODE_ROLE env" | ||
echo "accept values (case sensitive): <Empty> | 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" | ||
RELAYCHAIN_ROLE_ARGS="" | ||
;; | ||
"COLLATOR") | ||
PARACHAIN_ROLE_ARGS="--collator --rpc-external --rpc-methods unsafe" | ||
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" | ||
;; | ||
*) | ||
echo "Unknown NODE_ROLE ${NODE_ROLE}" | ||
echo "accept values (case sensitive): <Empty> | FULL | ARCHIVE | COLLATOR | MINER" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Starting Khala node as role '${NODE_ROLE}' with extra parachain args '${PARACHAIN_EXTRA_ARGS}' extra relaychain args '${RELAYCHAIN_EXTRA_ARGS}'" | ||
|
||
/usr/local/bin/khala-node \ | ||
--chain $PARACHAIN \ | ||
--base-path $DATA_PATH \ | ||
--database $PARACHAIN_DB \ | ||
--name $NODE_NAME \ | ||
--port $PARACHAIN_PORT \ | ||
--prometheus-port 9615 \ | ||
--rpc-port 9933 \ | ||
--ws-port 9944 \ | ||
--prometheus-external \ | ||
--ws-external \ | ||
--rpc-cors all \ | ||
--no-hardware-benchmarks \ | ||
$PARACHAIN_ROLE_ARGS \ | ||
$PARACHAIN_EXTRA_ARGS \ | ||
-- \ | ||
--chain $RELAYCHAIN \ | ||
--database $RELAYCHAIN_DB \ | ||
--port $RELAYCHAIN_PORT \ | ||
--prometheus-port 9616 \ | ||
--rpc-port 9934 \ | ||
--ws-port 9945 \ | ||
--prometheus-external \ | ||
--ws-external \ | ||
--rpc-cors all \ | ||
--no-hardware-benchmarks \ | ||
$RELAYCHAIN_ROLE_ARGS \ | ||
$RELAYCHAIN_EXTRA_ARGS |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ARG NODE_BIN_IMAGE="" | ||
FROM $NODE_BIN_IMAGE | ||
|
||
WORKDIR /root | ||
|
||
ADD dockerfile.d/start_node.sh ./start_node.sh | ||
|
||
ENV RUST_LOG="info" | ||
ENV NODE_NAME="khala-node" | ||
ENV NODE_ROLE="" | ||
|
||
ENV PARACHAIN="khala" | ||
ENV RELAYCHAIN="kusama" | ||
|
||
ENV PARACHAIN_DB="rocksdb" | ||
ENV RELAYCHAIN_DB="rocksdb" | ||
|
||
ENV PARACHAIN_EXTRA_ARGS="" | ||
ENV RELAYCHAIN_EXTRA_ARGS="" | ||
|
||
EXPOSE 9615 | ||
EXPOSE 9616 | ||
EXPOSE 9933 | ||
EXPOSE 9934 | ||
EXPOSE 9944 | ||
EXPOSE 9945 | ||
EXPOSE 30333 | ||
EXPOSE 30334 | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
|
||
CMD ["/bin/bash", "./start_node.sh"] |
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
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
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