Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c0c35ba
add polkadot build script
coriolinus Feb 6, 2020
32d9303
Add scripting to bring up a simple alice-bob example net
coriolinus Feb 6, 2020
35cd700
enable external rpc access to the nodes
coriolinus Feb 7, 2020
cd19677
Ensure external RPC access works
coriolinus Feb 12, 2020
1ff63a5
Add multi-stage dockerfile for building the cumulus-test-parachain-co…
coriolinus Feb 12, 2020
55d5e8d
Add services which generate genesis state, run the collator
coriolinus Feb 12, 2020
78a4e60
Merge remote-tracking branch 'origin/master' into prgn-collator-script
coriolinus Feb 13, 2020
e2ce4c8
Launch the collator node
coriolinus Feb 13, 2020
d244115
enable external websocket access to indexer nodes
coriolinus Feb 13, 2020
4a32d81
Reorganize for improved caching, again
coriolinus Feb 14, 2020
e698987
Get the collator talking to the indexer nodes
coriolinus Feb 14, 2020
8968c5a
Add runtime stage to collect runtime wasm blob into volume
coriolinus Feb 17, 2020
30bf185
WIP: add registrar service and partial work to actually register the …
coriolinus Feb 17, 2020
1c5ba4a
Add a parachain registrar which should properly register the parachain
coriolinus Feb 18, 2020
c683f80
BROKEN attempt to demo registrar communication with the blockchain
coriolinus Feb 20, 2020
54e98d4
Fix broken parachain registrar
coriolinus Feb 20, 2020
d2b0905
Merge remote-tracking branch 'origin/master' into prgn-collator-script
coriolinus Feb 21, 2020
ba59157
fixes which cause the collator to correctly produce new parachain blocks
coriolinus Feb 21, 2020
d53f004
add documentation for running the parachain automatically
coriolinus Feb 21, 2020
f260c00
Add health check to collator
coriolinus Feb 21, 2020
0ff7fb5
minor scripting improvements
coriolinus Feb 21, 2020
55d9701
Apply suggestions from code review
coriolinus Feb 21, 2020
e202ffc
Docker: copy the whole workspace in one go
coriolinus Feb 21, 2020
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
Prev Previous commit
Next Next commit
Launch the collator node
The biggest change here is adding the testing_net network to the
collator node's networks list. This lets it successfully connect
to the alice and bob nodes, which in turn lets it get their node IDs,
which was the blocker for a long time.

Remove httpie in favor of curl: makes for a smaller docker image,
and has fewer weird failure modes within docker.

Unfortunately this doesn't yet actually connect to the relay chain
nodes; that's the next area to figure out.
  • Loading branch information
coriolinus committed Feb 13, 2020
commit e2ce4c8ad912d6bdc875940bb0f7964398652315
9 changes: 6 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ services:
networks:
testing_net:
ipv4_address: 172.28.1.1
aliases:
- alice

node_bob:
image: "polkadot:${BRANCH:-bkchr-cumulus-branch}"
Expand All @@ -38,8 +40,6 @@ services:
source: ./test/parachain/res/polkadot_chainspec.json
target: /chainspec.json
read_only: true
links:
- "node_alice:alice"
command: >
polkadot
--chain=/chainspec.json
Expand All @@ -53,6 +53,8 @@ services:
networks:
testing_net:
ipv4_address: 172.28.1.2
aliases:
- bob

genesis_state:
build:
Expand All @@ -77,7 +79,8 @@ services:
command: >
inject_bootnodes.sh
--base-path=/data

networks:
testing_net:


volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker/test-parachain-collator.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN time cargo build --release -p cumulus-test-parachain-collator
#
# with the appropriate ID for both Alice and Bob
FROM debian:buster-slim as collator
RUN apt-get update && apt-get install httpie jq curl bash -y && \
RUN apt-get update && apt-get install jq curl bash -y && \
curl -sSo /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
chmod +x /wait-for-it.sh
COPY --from=builder \
Expand Down
18 changes: 12 additions & 6 deletions inject_bootnodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@

set -e -o pipefail

if [ ! -x cumulus-test-parachain-collator ]; then
echo "FATAL: cumulus-test-parachain collator not in PATH"
ctpc="/usr/bin/cumulus-test-parachain-collator"

if [ ! -x "$ctpc" ]; then
echo "FATAL: $ctpc does not exist or is not executable"
exit 1
fi

# name the variable with the incoming args so it isn't overwritten later by function calls
args=( "${@[@]}" )
args=( "$@" )

alice="172.28.1.1:9933"
bob="172.28.1.2:9935"

get_id () {
node="$1"
/wait-for-it.sh "$node" -t 10 -s -- \
http http://"$node" id:=1 jsonrpc="2.0" method=system_networkState |\
jq -r '.result.peerId'
curl -sS \
-H 'Content-Type: application/json' \
--data '{"id":1,"jsonrpc":"2.0","method":"system_networkState"}' \
"$node" |\
jq -r '.result.peerId'
}

bootnode () {
Expand All @@ -36,4 +41,5 @@ bootnode () {

args+=( "--bootnodes" "$(bootnode "$alice")" "--bootnodes" "$(bootnode "$bob")" )

cumulus-test-parachain-collator "${args[@]}"
set -x
"$ctpc" "${args[@]}"