Skip to content

Commit 1edc9ec

Browse files
Updated dev and test chain specs to set a proper balance for the endowed accounts. Developed Dockerfile to build an image able to run a full network. Developed script to facilitate the building of a docker container image for a md5 or hashed collator node. Developed script to facilitate the building of a docker image to run a full network. Developed zombienet config file to start a full network within the full network docker container
1 parent b343687 commit 1edc9ec

File tree

5 files changed

+95
-1
lines changed

5 files changed

+95
-1
lines changed

Dockerfile.fullnetwork

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM paritytech/ci-linux:1.71.0-bullseye
2+
3+
WORKDIR /var/hashed-parachain
4+
RUN apt-get update
5+
RUN apt-get -y install curl
6+
RUN curl -L -o /usr/local/bin/polkadot https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot
7+
RUN curl -L -o /usr/local/bin/polkadot-prepare-worker https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot-prepare-worker
8+
RUN curl -L -o /usr/local/bin/polkadot-execute-worker https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot-execute-worker
9+
RUN chmod u+x /usr/local/bin/polkadot
10+
RUN chmod u+x /usr/local/bin/polkadot-prepare-worker
11+
RUN chmod u+x /usr/local/bin/polkadot-execute-worker
12+
RUN curl -L -o /usr/local/bin/zombienet-linux-x64 https://github.com/paritytech/zombienet/releases/download/v1.3.93/zombienet-linux-x64
13+
RUN chmod u+x /usr/local/bin/zombienet-linux-x64
14+
15+
# COPY ./target/release/ ./release
16+
# COPY ./zombienet/small_network_current_dev_for_docker_image.toml .
17+
COPY . .
18+
RUN ./build_md5.sh --release
19+
20+
CMD [ "zombienet-linux-x64", "spawn", "--provider", "native", "/var/hashed-parachain/zombienet/small_network_current_dev_for_docker_image.toml" ]

build_full_network_image.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
# Builds docker image for full running network, relaychain plus hashed dev collator
4+
5+
usage="./build-full-network-image <tag>"
6+
if [ $# -ne 1 ]; then
7+
echo $usage
8+
exit 1
9+
fi
10+
11+
docker build --no-cache -f Dockerfile.fullnetwork -t sebastianmontero/hashed-full-network:$1 .

build_node_image.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
4+
# Builds docker image for a hashed or md5 collator node.
5+
6+
usage="./build_node_image <hashed|md5> <tag>"
7+
if [ $# -ne 2 ]; then
8+
echo $usage
9+
exit 1
10+
fi
11+
12+
if [[ $1 != 'hashed' && $1 != 'md5' ]]; then
13+
echo $usage
14+
exit 1
15+
fi
16+
17+
docker build -f Dockerfile.$1 -t sebastianmontero/hashed-substrate-collator-$1:$2 .

node/src/chain_spec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn testnet_genesis(
214214
..Default::default()
215215
},
216216
balances: hashed_parachain_runtime::BalancesConfig {
217-
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
217+
balances: endowed_accounts.iter().cloned().map(|k| (k, 1000000000000000000000000000)).collect(),
218218
},
219219
transaction_payment: Default::default(),
220220
sudo: SudoConfig { key: Some(root_key) },
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# HOW TO RUN: zombienet-linux-x64 spawn --provider native small_network.toml
2+
[relaychain]
3+
# default_image = "parity/polkadot:latest"
4+
# default_command = "polkadot"
5+
chain = "rococo-local"
6+
7+
# [relaychain.genesis.runtime.configuration.config]
8+
# scheduling_lookahead = 2
9+
10+
# [relaychain.genesis.runtime.configuration.config.async_backing_params]
11+
# max_candidate_depth = 3
12+
# allowed_ancestry_len = 2
13+
14+
[relaychain.genesis.runtimeGenesis.patch.configuration.config]
15+
scheduling_lookahead = 2
16+
17+
[relaychain.genesis.runtimeGenesis.patch.configuration.config.async_backing_params]
18+
max_candidate_depth = 3
19+
allowed_ancestry_len = 2
20+
21+
[[relaychain.nodes]]
22+
name = "alice"
23+
validator = true
24+
25+
[[relaychain.nodes]]
26+
name = "bob"
27+
validator = true
28+
29+
[[parachains]]
30+
id = 2000
31+
cumulus_based = true
32+
chain = "dev"
33+
# genesis_wasm_path = "/home/sebastian/vsc-workspace/hashed-substrate/resources/md5-wasm"
34+
# chain_spec_path = "/home/sebastian/vsc-workspace/hashed-substrate-parachain/resources/md5-collator-raw-spec.json"
35+
36+
# run charlie as parachain collator
37+
[[parachains.collators]]
38+
name = "charlie"
39+
validator = true
40+
# image = "sebastianmontero/hashed-substrate-collator:latest"
41+
command = "./target/release/hashed-parachain"
42+
args = ["-lparachain=debug"]
43+
ws_port = "{{COLLATOR_WS_PORT}}"
44+
# args = ["--force-authoring"]
45+
# args = ["--chain", "/var/www/hashed-substrate/md5-collator-raw-spec.json", "--force-authoring"]
46+
# args = ["--chain", "/var/www/hashed-substrate/md5-collator-raw-spec.json"]

0 commit comments

Comments
 (0)