git.delta.rocks / unique-network / refs/commits / 9b6878d34b13

difftreelog

Add gateway node to testnet - Bohr

Greg Zaitsev2020-07-21parent: #e422021.patch.diff
in: master

3 files changed

modifiedDockerfile-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" 
 	# && \
modifieddocker-compose-testnet.ymldiffbeforeafterboth
4 node_einstein:4 node_einstein:
5 image: nft-parachain5 image: nft-parachain
6 ports:6 ports:
7 - 9944:9944
8 - 9935:99357 - 9935:9935
9 build:8 build:
10 context: ./9 context: ./
17 environment:16 environment:
18 - NODE=einstein17 - NODE=einstein
19 - P2PPORT=3033518 - P2PPORT=30335
20 - WSPORT=994419 - WSPORT=9945
21 - RPCPORT=993520 - RPCPORT=9935
22 - BOOTNODE=True21 - BOOTNODE=True
22 - VALIDATOR=True
2323
24 node_newton:24 node_newton:
25 image: nft-parachain25 image: nft-parachain
26 ports:26 ports:
27 - 9946:9946
28 - 9936:993627 - 9936:9936
29 build:28 build:
30 context: ./29 context: ./
42 - BOOTNODE=False41 - BOOTNODE=False
43 - BOOTPORT=3033542 - BOOTPORT=30335
44 - BOOTID=12D3KooWRYNrSRQvJ73esUhpyETQNJWGfC2LQ9dW3HJtzHJM28Hc43 - BOOTID=12D3KooWRYNrSRQvJ73esUhpyETQNJWGfC2LQ9dW3HJtzHJM28Hc
4544 - VALIDATOR=True
45
46 node_bohr:
47 image: nft-parachain
48 ports:
49 - 9944:9944
50 build:
51 context: ./
52 dockerfile: Dockerfile-testnet
53 volumes:
54 - ./chain-data-bohr:/chain-data
55 networks:
56 - substrate_network
57 restart: always
58 environment:
59 - NODE=bohr
60 - P2PPORT=30334
61 - WSPORT=9944
62 - RPCPORT=9934
63 - BOOTNODE=False
64 - BOOTPORT=30335
65 - BOOTID=12D3KooWRYNrSRQvJ73esUhpyETQNJWGfC2LQ9dW3HJtzHJM28Hc
66 - VALIDATOR=False
67
46networks: 68networks:
47 substrate_network:69 substrate_network:
modifiedrun-testnet.shdiffbeforeafterboth
--- a/run-testnet.sh
+++ b/run-testnet.sh
@@ -14,11 +14,29 @@
 echo This is a Bootnode;
 BOOTNODES="";
 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";
 fi
 
+if [ "VALIDATOR" = True ];
+then
+echo This is a Validator node;
+/usr/local/bin/nft \
+  --base-path /chain-data \
+  --chain ./nftTestnetSpecRaw.json \
+  --port $P2PPORT \
+  --ws-port $WSPORT \
+  --rpc-port $RPCPORT \
+  --validator \
+  --rpc-methods=Unsafe \
+  --name $NODE \
+  --ws-external \
+  --rpc-external \
+  -lruntime \
+  $BOOTNODES;
+else
+echo This is a Gateway node;
 /usr/local/bin/nft \
   --base-path /chain-data \
   --chain ./nftTestnetSpecRaw.json \
@@ -32,5 +50,5 @@
   --rpc-external \
   --rpc-cors all \
   -lruntime \
-  $BOOTNODES
-
+  $BOOTNODES;
+fi