forked from moonbeam-foundation/moonbeam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-parachain-specs.sh
executable file
·41 lines (35 loc) · 1.43 KB
/
generate-parachain-specs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
source scripts/_init_var.sh
echo "=================== Alphanet ==================="
$MOONBEAM_BINARY build-spec \
--disable-default-bootnode \
--chain 'moonbase-local' \
| grep '\"code\"' \
| head -n1 > $ALPHANET_PARACHAIN_SPEC_TMP
echo $ALPHANET_PARACHAIN_SPEC_TMP generated
echo "Using $ALPHANET_PARACHAIN_SPEC_TEMPLATE..."
sed -e "/\"<runtime_code>\"/{r $ALPHANET_PARACHAIN_SPEC_TMP" -e 'd;}' $ALPHANET_PARACHAIN_SPEC_TEMPLATE \
> $ALPHANET_PARACHAIN_SPEC_PLAIN
echo $ALPHANET_PARACHAIN_SPEC_PLAIN generated
$MOONBEAM_BINARY build-spec \
--disable-default-bootnode \
--raw \
--chain $ALPHANET_PARACHAIN_SPEC_PLAIN \
> $ALPHANET_PARACHAIN_SPEC_RAW
echo $ALPHANET_PARACHAIN_SPEC_RAW generated
$MOONBEAM_BINARY export-genesis-wasm \
--chain $ALPHANET_PARACHAIN_SPEC_RAW \
> $ALPHANET_WASM;
echo $ALPHANET_WASM generated
$MOONBEAM_BINARY export-genesis-state \
--parachain-id $ALPHANET_PARACHAIN_ID \
--chain $ALPHANET_PARACHAIN_SPEC_RAW \
> $ALPHANET_GENESIS;
echo $ALPHANET_GENESIS generated
cp $ALPHANET_PARACHAIN_EMBEDDED_SPEC $ALPHANET_BUILD_FOLDER/parachain-embedded-specs.json
cp $ALPHANET_ROCOCO_EMBEDDED_SPEC $ALPHANET_BUILD_FOLDER/rococo-embedded-specs.json
grep -v '/p2p/' $ALPHANET_PARACHAIN_EMBEDDED_SPEC > \
$ALPHANET_BUILD_FOLDER/parachain-embedded-no-bootnodes-specs.json
grep -v '/p2p/' $ALPHANET_ROCOCO_EMBEDDED_SPEC > \
$ALPHANET_BUILD_FOLDER/rococo-embedded-no-bootnodes-specs.json