Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes spec/wasm engine for run scripts #178

Merged
merged 9 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/moonbase-alphanet.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CMD ["/moonbase-alphanet/moonbase-alphanet", \
"--rpc-port","9933", \
"--ws-port","9944", \
"--validator", \
"--chain", "/moonbase-alphanet/moonbase-alphanet-specs-plain.json", \
"--chain", "/moonbase-alphanet/moonbase-alphanet-specs-raw.json", \
"--", \
"--chain", "/moonbase-alphanet/rococo-alphanet-specs-raw.json" \
]
20 changes: 9 additions & 11 deletions scripts/_init_var.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ if [ -z "$PARACHAIN_IP" ]; then
PARACHAIN_IP="127.0.0.1"
fi

# Alice private key
if [ -z "$SUDO_SEED" ]; then
SUDO_SEED="0x078782a1f82fd4f9ab59131646f92caa3104dfb6b6975d025647760f693991b3"
SUDO_SEED="0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a"
fi

NODE_KEYS=(
Expand All @@ -92,16 +93,13 @@ RELAY_SEEDS=(
"six stumble adjust guide delay rail waste ivory hood peasant seminar fluid"
)

RELAY_SR25519_PUB=(
"0xb23ebd9c1c2c0b65eebbc6d3db6bbbd287219bfb5468931a1c129119a3369d07"
"0x8802ba4e93c98107e70884ca3b1510824351100dace655e0dc3bbe304b1c5205"
"0xb2caf068a6e89d13a1ae47884fcedb35a4481339d168f5aba5fa77f0a6d0755d"
)

RELAY_ED25519_PUB=(
"0xa1c35491bd3487995756678c3bc5e5491897d8bdfa9b512e2e1b1bf7e11664c2"
"0xcd2424a7c0f1ec30aeb0124e732d13406f63abaee72b2b4e6d0817935bb02099"
"0x4c559e6b50b27ad7a54af29fe99c4c5b7d064eb3bd9c4d2141daf426719a75b9"
WELL_KNOWN_USERS=(
"alice"
"bob"
"charlie"
"dave"
"eve"
"ferdie"
)

RELAY_LOCAL_IDS=(
Expand Down
5 changes: 0 additions & 5 deletions scripts/generate-relay-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ if [ -z "$POLKADOT_VERSION" ]; then
head -1 | sed 's/.*#//' | cut -c1-8`"
fi


echo "Using Polkadot revision #${POLKADOT_VERSION}"

# "Chain does not have enough staking candidates to operate" is displayed when no
# staker is given at genesis

docker run -it -v $(pwd)/build:/build purestake/moonbase-relay-testnet:$POLKADOT_VERSION \
/usr/local/bin/polkadot \
build-spec \
--chain rococo-local \
-lerror \
--disable-default-bootnode \
--raw \
| grep -v 'Chain does not have enough staking candidates to operate' \
> $POLKADOT_SPEC_RAW
echo $POLKADOT_SPEC_RAW generated
36 changes: 36 additions & 0 deletions scripts/register-alphanet-parachain-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

source scripts/_init_var.sh

RELAY_PORT=$((USER_PORT + 42))
RELAY_INDEX=0
BOOTNODES_ARGS=""


if [ -z "$SUDO_SEED" ]; then
echo "Missing \$SUDO_SEED"
exit 1
fi

if [ ! -f "$PARACHAIN_WASM" ]; then
echo "Missing $PARACHAIN_WASM. Please run scripts/generate-parachain-specs.sh"
exit 1
fi

if [ ! -f "$PARACHAIN_GENESIS" ]; then
echo "Missing $PARACHAIN_GENESIS. Please run scripts/generate-parachain-specs.sh"
exit 1
fi

PARACHAIN_CONFIG="$PARACHAIN_BUILD_FOLDER/moonbase-alphanet-runtime.config.json";
echo -n "1000 {\"genesis_head\":\"$(cat $PARACHAIN_GENESIS)\",\"validation_code\":\"" \
> $PARACHAIN_CONFIG;
cat $PARACHAIN_WASM >> $PARACHAIN_CONFIG;
echo -n "\",\"parachain\":true}" >> $PARACHAIN_CONFIG;

tools/node_modules/.bin/polkadot-js-api \
--ws "ws://localhost:$((RELAY_PORT + 2))" \
--sudo \
--seed "$SUDO_SEED" \
--params $(pwd)/$PARACHAIN_CONFIG \
tx.parasSudoWrapper.sudoScheduleParaInitialize
9 changes: 6 additions & 3 deletions scripts/run-alphanet-parachain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ $PARACHAIN_BINARY \
--rpc-port $((PARACHAIN_PORT + 10 + 1)) \
--ws-port $((PARACHAIN_PORT + 10 + 2)) \
--validator \
--rpc-cors all \
--rpc-methods=unsafe \
--execution wasm \
--wasm-execution compiled \
--name parachain_$PARACHAIN_INDEX \
$PARACHAIN_BASE_PATH \
'-linfo,evm=trace,ethereum=trace,rpc=trace' \
--chain $PARACHAIN_SPEC_PLAIN \
'-linfo,evm=debug,ethereum=trace,rpc=trace,cumulus_collator=debug,txpool=debug' \
--account-id 6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b \
JoshOrndorff marked this conversation as resolved.
Show resolved Hide resolved
$PARACHAIN_BOOTNODES_ARGS \
-- \
--node-key ${PARACHAIN_KEYS[$PARACHAIN_INDEX]} \
$PARACHAIN_BASE_PATH \
--port $((PARACHAIN_PORT)) \
--rpc-port $((PARACHAIN_PORT + 1)) \
--ws-port $((PARACHAIN_PORT + 2)) \
$RELAY_BOOTNODES_ARGS \
--chain $POLKADOT_SPEC_RAW;
66 changes: 17 additions & 49 deletions scripts/run-alphanet-relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,20 @@ docker run \
-p $((RELAY_PORT + 1)):$((RELAY_PORT + 1)) \
-p $((RELAY_PORT + 2)):$((RELAY_PORT + 2)) \
-it purestake/moonbase-relay-testnet:$POLKADOT_VERSION \
bash -c "
echo 'Inserting keys...';
/usr/local/bin/polkadot \
key insert \
--keystore-path /tmp/chains/rococo_moonbase_relay_testnet/keystore \
--base-path /tmp \
--suri '${RELAY_SEEDS[$RELAY_INDEX]}' \
--key-type gran \
--scheme ed25519;
/usr/local/bin/polkadot \
key insert \
--keystore-path /tmp/chains/rococo_moonbase_relay_testnet/keystore \
--base-path /tmp \
--suri '${RELAY_SEEDS[$RELAY_INDEX]}' \
--key-type babe;
/usr/local/bin/polkadot \
key insert \
--keystore-path /tmp/chains/rococo_moonbase_relay_testnet/keystore \
--base-path /tmp \
--suri '${RELAY_SEEDS[$RELAY_INDEX]}' \
--key-type imon;
/usr/local/bin/polkadot \
key insert \
--keystore-path /tmp/chains/rococo_moonbase_relay_testnet/keystore \
--base-path /tmp \
--suri '${RELAY_SEEDS[$RELAY_INDEX]}' \
--key-type para;
/usr/local/bin/polkadot \
key insert \
--keystore-path /tmp/chains/rococo_moonbase_relay_testnet/keystore \
--base-path /tmp \
--suri '${RELAY_SEEDS[$RELAY_INDEX]}' \
--key-type audi;
echo 'Starting node...';
/usr/local/bin/polkadot \
--chain /$POLKADOT_SPEC_RAW \
--node-key ${NODE_KEYS[$RELAY_INDEX]} \
--base-path /tmp \
--validator \
--force-authoring \
--name relay_$RELAY_INDEX \
--rpc-methods=Unsafe \
--unsafe-rpc-external \
--unsafe-ws-external \
--port $((RELAY_PORT)) \
--rpc-port $((RELAY_PORT + 1)) \
--ws-port $((RELAY_PORT + 2)) \
$BOOTNODES_ARGS \
'-linfo,evm=trace,ethereum=trace,rpc=trace'"
/usr/local/bin/polkadot \
--chain rococo-local \
--${WELL_KNOWN_USERS[$RELAY_INDEX]} \
--node-key ${NODE_KEYS[$RELAY_INDEX]} \
--base-path /tmp \
--validator \
--force-authoring \
--name relay_$RELAY_INDEX \
--rpc-methods=Unsafe \
--unsafe-rpc-external \
--unsafe-ws-external \
--rpc-cors all \
--port $((RELAY_PORT)) \
--rpc-port $((RELAY_PORT + 1)) \
--ws-port $((RELAY_PORT + 2)) \
$BOOTNODES_ARGS \
'-linfo,evm=debug,ethereum=trace,rpc=trace,txpool=debug,polkadot_parachain=debug'
7 changes: 6 additions & 1 deletion scripts/run-moonbase-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ $EXECUTABLE \
--rpc-port $((STANDALONE_PORT + 1)) \
--ws-port $((STANDALONE_PORT + 2)) \
--validator \
--account-id 6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b \
--rpc-cors all \
--rpc-methods=unsafe \
--execution wasm \
--wasm-execution compiled \
--name STANDALONE_$STANDALONE_INDEX \
$STANDALONE_BASE_PATH \
'-linfo,evm=trace,ethereum=trace,rpc=trace' \
'-linfo,evm=debug,ethereum=trace,rpc=trace,cumulus_collator=debug,txpool=debug' \
$STANDALONE_BOOTNODES_ARGS