From f22b6cbe7ffc70b6052e91f3ab9879dead86eeb5 Mon Sep 17 00:00:00 2001 From: jasl Date: Wed, 30 Aug 2023 02:10:27 +0800 Subject: [PATCH] Update --- build_and_push_pt3.rb | 4 +-- misc/start_node.sh | 66 ++++++++++++++++++++++++++++++++++++ prebuilt_pt3_node.Dockerfile | 2 -- 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100755 misc/start_node.sh diff --git a/build_and_push_pt3.rb b/build_and_push_pt3.rb index 040d228..9a93178 100755 --- a/build_and_push_pt3.rb +++ b/build_and_push_pt3.rb @@ -4,13 +4,13 @@ BUILD_ONLY = false COMMON_CHAIN_NAME = "khala-pt3" -COMMON_TAG = "22092001" +COMMON_TAG = "23073101" DEV_NODE_DOCKER_REPO = "#{COMMON_CHAIN_NAME}-node" DEV_NODE_DOCKER_TAG = COMMON_TAG REGISTRIES = [ - "jasl123", + # "jasl123", "phalanetwork", # "swr.cn-east-3.myhuaweicloud.com/phala", ] diff --git a/misc/start_node.sh b/misc/start_node.sh new file mode 100755 index 0000000..cca62f8 --- /dev/null +++ b/misc/start_node.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +WORK_PATH=$(dirname $(readlink -f "$0")) +DATA_PATH="$HOME/data" + +NODE_NAME="${NODE_NAME:-"khala-dev-node"}" +NODE_ROLE="${NODE_ROLE:-""}" + +PARACHAIN="$WORK_PATH/thala-local-2004-raw.chain_spec.json" +RELAYCHAIN="$WORK_PATH/rococo-local-raw.chain_spec.json" + +case ${NODE_ROLE} in + "") + echo "You must set NODE_ROLE env" + echo "accept values (case sensitive): | FULL | ARCHIVE | COLLATOR | MINER" + exit 1 + ;; + "FULL") + PARACHAIN_ROLE_ARGS="" + RELAYCHAIN_ROLE_ARGS="" + ;; + "ARCHIVE") + PARACHAIN_ROLE_ARGS="--pruning archive" + RELAYCHAIN_ROLE_ARGS="" + ;; + "COLLATOR") + PARACHAIN_ROLE_ARGS="--collator --rpc-external --rpc-methods Unsafe" + RELAYCHAIN_ROLE_ARGS="" + ;; + "MINER") + PARACHAIN_ROLE_ARGS="--pruning archive --rpc-external --rpc-methods Unsafe" + RELAYCHAIN_ROLE_ARGS="--pruning archive --rpc-external --rpc-methods Unsafe" + ;; + *) + echo "Unknown NODE_ROLE ${NODE_ROLE}" + echo "accept values (case sensitive): | 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}'" + +$WORK_PATH/khala-node \ + --chain $PARACHAIN \ + --base-path $DATA_PATH \ + --name $NODE_NAME \ + --port 30333 \ + --prometheus-port 9615 \ + --rpc-port 9933 \ + --ws-port 9944 \ + --prometheus-external \ + --ws-external \ + --rpc-cors all \ + $PARACHAIN_ROLE_ARGS \ + $PARACHAIN_EXTRA_ARGS \ + -- \ + --chain $RELAYCHAIN \ + --port 30334 \ + --prometheus-port 9616 \ + --rpc-port 9934 \ + --ws-port 9945 \ + --prometheus-external \ + --ws-external \ + --rpc-cors all \ + $RELAYCHAIN_ROLE_ARGS \ + $RELAYCHAIN_EXTRA_ARGS \ No newline at end of file diff --git a/prebuilt_pt3_node.Dockerfile b/prebuilt_pt3_node.Dockerfile index bbc1095..5898b26 100644 --- a/prebuilt_pt3_node.Dockerfile +++ b/prebuilt_pt3_node.Dockerfile @@ -20,11 +20,9 @@ ENV PARACHAIN_BOOTNODE='/dns4/pc-test-3.phala.network/tcp/30333/ws/p2p/12D3KooWN ENV RELAYCHAIN_BOOTNODE='/dns4/pc-test-3.phala.network/tcp/30334/ws/p2p/12D3KooWNcARLswVpKJsGK8v4krZNQQ3unbhxrZAk4YV5TX2rdos' EXPOSE 9615 -EXPOSE 9933 EXPOSE 9944 EXPOSE 30333 EXPOSE 9616 -EXPOSE 9934 EXPOSE 9945 EXPOSE 30334