Skip to content
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ EXPOSE 30333 9933 9944

RUN ls -la .

CMD ["cargo", "run", "--", "dev"]
# boot node for Alice:
# ./target/debug/node --chain local --key Alice --name "ALICE" --node-key 0000000000000000000000000000000000000000000000000000000000000001 --validator --telemetry-url ws://telemetry-backend.kilt-prototype.tk:1024
# Alice's address: /ip4/0.0.0.0/tcp/30333/p2p/QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN

# boot node for Bob:
# ./target/debug/node --chain local --key Bob --name "BOB" --node-key 0000000000000000000000000000000000000000000000000000000000000002 --validator --telemetry-url ws://telemetry-backend.kilt-prototype.tk:1024
# Bobs address: /ip4/0.0.0.0/tcp/30333/p2p/QmXiB3jqqn2rpiKU7k1h7NJYeBg8WNSx9DiTRKz9ti2KSK

CMD ["./target/debug/node", "--chain", "local", "--key", "Alice", "--name", "\"ALICE\"", "--node-key", "0000000000000000000000000000000000000000000000000000000000000001", "--validator"]
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# substrate-poc
A new SRML-based Substrate node, ready for hacking
# prototype-chain

## Run inside docker container
Substrate node implementation for the KILT prototype

## Running a local node that connects to the KILT prototype test environment in AWS

There are 2 boot nodes running in the KILT test net:

* bootnode-alice
* bootnode-bob

To connect to the Alice node you can use the shell script `connect.sh`:

```
docker build -t substrate-poc .
docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 --publish-all=true -it substrate-poc
```
connect.sh --key Charly --name "CHARLY"
```

You can use any of the accounts declared in the chain spec to connect (Alice, Bob, Charly, Dave, Eve, Ferdie).
5 changes: 1 addition & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ PROJECT_ROOT=`pwd`

export CARGO_INCREMENTAL=0

bold=$(tput bold)
normal=$(tput sgr0)

# Save current directory.
pushd . >/dev/null

for SRC in runtime/wasm
do
echo "$PROJECT_ROOT/$SRC"
echo "${bold}Building webassembly binary in $SRC...${normal}"
echo "Building webassembly binary in $SRC..."
cd "$PROJECT_ROOT/$SRC"

chmod a+x build.sh
Expand Down
4 changes: 2 additions & 2 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ phases:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region eu-central-1 --no-include-email)
- REPOSITORY_URI=348099934012.dkr.ecr.eu-central-1.amazonaws.com/kilt/substrate-poc
- REPOSITORY_URI=348099934012.dkr.ecr.eu-central-1.amazonaws.com/kilt/prototype-chain
- 'IMAGE_TAG=$(sed -n ''s/version = "\(.*\)"$/\1/p'' Cargo.toml)'
- docker pull $REPOSITORY_URI:latest || true
build:
Expand All @@ -22,6 +22,6 @@ phases:
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"substrate-poc","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
- printf '[{"name":"prototype-bootnode","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
artifacts:
files: imagedefinitions.json
25 changes: 25 additions & 0 deletions connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

ALICE_BOOT_NODE_DOMAIN=bootnode-alice.kilt-prototype.tk
ALICE_BOOT_NODE_IP=`dig $ALICE_BOOT_NODE_DOMAIN A +short`
ALICE_BOOT_NODE_KEY=QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN
ALICE_BOOT_NODE_IPFS=/ip4/$ALICE_BOOT_NODE_IP/tcp/30333/p2p/$ALICE_BOOT_NODE_KEY

BOB_BOOT_NODE_DOMAIN=bootnode-bob.kilt-prototype.tk
BOB_BOOT_NODE_IP=`dig $BOB_BOOT_NODE_DOMAIN A +short`
BOB_BOOT_NODE_KEY=QmXiB3jqqn2rpiKU7k1h7NJYeBg8WNSx9DiTRKz9ti2KSK
BOB_BOOT_NODE_IPFS=/ip4/$BOB_BOOT_NODE_IP/tcp/30333/p2p/$BOB_BOOT_NODE_KEY

echo "ALICE_BOOT_NODE_DOMAIN: $ALICE_BOOT_NODE_DOMAIN"
echo "ALICE_BOOT_NODE_IP: $ALICE_BOOT_NODE_IP"
echo "BOB_BOOT_NODE_DOMAIN: $BOB_BOOT_NODE_DOMAIN"
echo "BOB_BOOT_NODE_IP: $BOB_BOOT_NODE_IP"

# Connect to Alice
echo "Connecting to $ALICE_BOOT_NODE_IPFS..."
./target/debug/node --chain local --bootnodes $ALICE_BOOT_NODE_IPFS --port 30334 --validator "$@"

# Connect to Bob
# echo "Connecting to $BOB_BOOT_NODE_IPFS..."
# ./target/debug/node --chain local --bootnodes $BOB_BOOT_NODE_IPFS --port 30334 --validator "$@"