difftreelog
Merge branch 'master' of https://github.com/usetech-llc/nft_parachain
in: master
5 files changed
Dockerfile-testnetdiffbeforeafterboth--- a/Dockerfile-testnet
+++ b/Dockerfile-testnet
@@ -15,7 +15,6 @@
#RUN git clone https://github.com/usetech-llc/nft_parachain /nft_parachain
RUN mkdir nft_parachain
WORKDIR /nft_parachain
-COPY . .
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$PATH:$HOME/.cargo/bin" && \
@@ -26,6 +25,8 @@
rustup target list --installed && \
rustup show
+COPY . .
+
RUN export PATH="$PATH:$HOME/.cargo/bin" && \
cargo build "--$PROFILE"
# && \
deploy-testnet.shdiffbeforeafterboth--- a/deploy-testnet.sh
+++ b/deploy-testnet.sh
@@ -13,6 +13,8 @@
### Build and run Einstein node (bootnode) and Newton node
docker-compose -f docker-compose-testnet.yml up -d --build
+sleep 30
+
### Deploy aura store keys
# Einstein
curl http://localhost:9935 -H "Content-Type:application/json;charset=utf-8" -d "@./einstein_store_key.json"
@@ -27,9 +29,15 @@
# Newton
curl http://localhost:9936 -H "Content-Type:application/json;charset=utf-8" -d "@./newton_store_key_grandpa.json"
+sleep 30
+
### Stop and restart nodes so that they start finalizing
-docker-compose -f docker-compose-testnet.yml down
-docker-compose -f docker-compose-testnet.yml up -d
+docker stop nft_parachain_node_einstein_1
+docker stop nft_parachain_node_newton_1
+docker stop nft_parachain_node_bohr_1
+docker start nft_parachain_node_einstein_1
+docker start nft_parachain_node_newton_1
+docker start nft_parachain_node_bohr_1
### Cleanup
@@ -39,3 +47,5 @@
# Delete store key files
rm ./einstein_store_key.json
rm ./newton_store_key.json
+rm ./einstein_store_key_grandpa.json
+rm ./newton_store_key_grandpa.json
docker-compose-testnet.ymldiffbeforeafterboth1version: "3.5"23services:4 node_einstein:5 image: nft-parachain6 ports:7 - 9944:99448 - 9935:99359 build:10 context: ./11 dockerfile: Dockerfile-testnet12 volumes:13 - ./chain-data-einstein:/chain-data14 networks: 15 - substrate_network16 restart: always17 environment:18 - NODE=einstein19 - P2PPORT=3033520 - WSPORT=994421 - RPCPORT=993522 - BOOTNODE=True2324 node_newton:25 image: nft-parachain26 ports:27 - 9946:994628 - 9936:993629 build:30 context: ./31 dockerfile: Dockerfile-testnet32 volumes:33 - ./chain-data-newton:/chain-data34 networks: 35 - substrate_network36 restart: always37 environment:38 - NODE=newton39 - P2PPORT=3033640 - WSPORT=994641 - RPCPORT=993642 - BOOTNODE=False43 - BOOTPORT=3033544 - BOOTID=12D3KooWRYNrSRQvJ73esUhpyETQNJWGfC2LQ9dW3HJtzHJM28Hc4546networks: 47 substrate_network:48 driver: bridge49 name: substrate_network1version: "3.5"23services:4 node_einstein:5 image: nft-parachain6 ports:7 - 9935:99358 build:9 context: ./10 dockerfile: Dockerfile-testnet11 volumes:12 - ./chain-data-einstein:/chain-data13 networks: 14 - substrate_network15 restart: always16 environment:17 - NODE=einstein18 - P2PPORT=3033519 - WSPORT=994520 - RPCPORT=993521 - BOOTNODE=True22 - VALIDATOR=True2324 node_newton:25 image: nft-parachain26 ports:27 - 9936:993628 build:29 context: ./30 dockerfile: Dockerfile-testnet31 volumes:32 - ./chain-data-newton:/chain-data33 networks: 34 - substrate_network35 restart: always36 environment:37 - NODE=newton38 - P2PPORT=3033639 - WSPORT=994640 - RPCPORT=993641 - BOOTNODE=False42 - BOOTPORT=3033543 - BOOTID=12D3KooWRLrjXxByPkSCzcsRyf6652brnJT9s4AQHR3uujJ35mxz44 - VALIDATOR=True4546 node_bohr:47 image: nft-parachain48 ports:49 - 9944:994450 build:51 context: ./52 dockerfile: Dockerfile-testnet53 volumes:54 - ./chain-data-bohr:/chain-data55 networks: 56 - substrate_network57 restart: always58 environment:59 - NODE=bohr60 - P2PPORT=3033461 - WSPORT=994462 - RPCPORT=993463 - BOOTNODE=False64 - BOOTPORT=3033565 - BOOTID=12D3KooWRLrjXxByPkSCzcsRyf6652brnJT9s4AQHR3uujJ35mxz66 - VALIDATOR=False67 68networks: 69 substrate_network:70 driver: bridge71 name: substrate_networkrun-testnet.shdiffbeforeafterboth--- a/run-testnet.sh
+++ b/run-testnet.sh
@@ -8,17 +8,23 @@
echo RPC Port : $RPCPORT
echo Boot = $BOOTNODE
+echo Validator = $VALIDATOR
if [ "$BOOTNODE" = True ];
then
echo This is a Bootnode;
BOOTNODES="";
+NODEKEY="--node-key-file einstein_key_file";
else
-echo Bootnode Port : $BOOTPORT
-echo Bootnode PeerID : $BOOTID
+echo Bootnode Port : $BOOTPORT;
+echo Bootnode PeerID : $BOOTID;
BOOTNODES="--bootnodes /dns4/node_einstein/tcp/$BOOTPORT/p2p/$BOOTID";
+NODEKEY="";
fi
+if [ "$VALIDATOR" = True ];
+then
+echo This is a Validator node;
/usr/local/bin/nft \
--base-path /chain-data \
--chain ./nftTestnetSpecRaw.json \
@@ -31,5 +37,19 @@
--ws-external \
--rpc-external \
-lruntime \
- $BOOTNODES
-
+ $BOOTNODES \
+ $NODEKEY;
+else
+echo This is a Gateway node;
+/usr/local/bin/nft \
+ --base-path /chain-data \
+ --chain ./nftTestnetSpecRaw.json \
+ --port $P2PPORT \
+ --ws-port $WSPORT \
+ --rpc-port $RPCPORT \
+ --name $NODE \
+ --ws-external \
+ --rpc-cors all \
+ -lruntime \
+ $BOOTNODES;
+fi
upload_secrets.shdiffbeforeafterboth--- /dev/null
+++ b/upload_secrets.sh
@@ -0,0 +1,7 @@
+scp -P 8022 ./einstein_key_file developer@212.248.19.53:~/nft_parachain/einstein_key_file
+
+scp -P 8022 ./einstein_store_key.json developer@212.248.19.53:~/nft_parachain/einstein_store_key.json
+scp -P 8022 ./newton_store_key.json developer@212.248.19.53:~/nft_parachain/newton_store_key.json
+
+scp -P 8022 ./einstein_store_key_grandpa.json developer@212.248.19.53:~/nft_parachain/einstein_store_key_grandpa.json
+scp -P 8022 ./newton_store_key_grandpa.json developer@212.248.19.53:~/nft_parachain/newton_store_key_grandpa.json