Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add assethub to localnet #5443

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion bouncer/tests/swap_after_temp_disconnecting_chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const testSwapAfterDisconnection = new ExecutableTest(
// Testing a swap after temporarily disconnecting external nodes
async function main() {
const networkName = 'chainflip-localnet_default';
const allExternalNodes = ['bitcoin', 'geth', 'polkadot'];
const allExternalNodes = ['bitcoin', 'geth', 'polkadot1'];

await Promise.all(
allExternalNodes.map((container) => disconnectContainerFromNetwork(container, networkName)),
Expand Down
101 changes: 101 additions & 0 deletions ci/docker/development/polkadot/assethub.raw.json

Large diffs are not rendered by default.

216 changes: 216 additions & 0 deletions ci/docker/development/polkadot/polkadot.raw.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions localnet/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export WORKFLOW=build-localnet
export GENESIS_NODES=("bashful" "doc" "dopey")
export REQUIRED_BINARIES="engine-runner chainflip-node chainflip-broker-api chainflip-lp-api"
export INIT_CONTAINERS="eth-init solana-init"
export CORE_CONTAINERS="bitcoin geth polkadot redis"
export CORE_CONTAINERS="bitcoin geth polkadot1 polkadot2 assethub redis"
export DEPOSIT_MONITOR_CONTAINER="deposit-monitor"
export ARB_CONTAINERS="sequencer staker-unsafe poster"
export SOLANA_BASE_PATH="/tmp/solana"
Expand Down Expand Up @@ -98,7 +98,7 @@ build-localnet() {
check_endpoint_health -s -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}' http://localhost:8545 >>$DEBUG_OUTPUT_DESTINATION
wscat -c ws://127.0.0.1:8546 -x '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}' >>$DEBUG_OUTPUT_DESTINATION

echo "🚦 Waiting for polkadot node to start"
echo "🚦 Waiting for polkadot nodes to start"
REPLY=$(check_endpoint_health -H "Content-Type: application/json" -s -d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlockHash", "params":[0]}' 'http://localhost:9947') || [ -z $(echo $REPLY | grep -o '\"result\":\"0x[^"]*' | grep -o '0x.*') ]
DOT_GENESIS_HASH=$(echo $REPLY | grep -o '\"result\":\"0x[^"]*' | grep -o '0x.*')

Expand Down Expand Up @@ -251,8 +251,14 @@ logs() {
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow
tail -f $CHAINFLIP_BASE_PATH/*/chainflip-*.log
fi
if [[ $SERVICE == "polkadot" ]]; then
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow polkadot
if [[ $SERVICE == "polkadot1" ]]; then
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow polkadot1
fi
if [[ $SERVICE == "polkadot2" ]]; then
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow polkadot2
fi
if [[ $SERVICE == "assethub" ]]; then
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow assethub
fi
if [[ $SERVICE == "geth" ]]; then
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" logs --follow geth
Expand Down
91 changes: 86 additions & 5 deletions localnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ services:
- geth
- redis

polkadot:
container_name: polkadot
polkadot1:
container_name: polkadot1
platform: linux/amd64
image: docker.io/parity/polkadot:v1.10.0
image: docker.io/parity/polkadot:v1.16.2
pull_policy: if_not_present
stop_grace_period: 5s
stop_signal: SIGINT
Expand All @@ -109,17 +109,98 @@ services:
command:
- --alice
- --blocks-pruning=archive
- --chain=/chainspecs/polkadot-dev.chainspec.v1.3.4.json
- --chain=/chainspecs/polkadot.raw.json
- --force-authoring
- --name=PolkaDocker
- --name=PolkaDocker1
- --rpc-cors=all
- --rpc-external
- --rpc-methods=unsafe
- --state-pruning=archive
- --rpc-max-connections=100000
- --wasmtime-instantiation-strategy=recreate-instance-copy-on-write
- --unsafe-force-node-key-generation
ports:
- 9947:9944
- 30333:30333
healthcheck:
test:
[
"CMD-SHELL",
"curl",
"-H 'Content-Type: application/json;'",
"-d '{\"id\":1, \"jsonrpc\":\"2.0\", \"method\": \"chain_getBlockHash\", \"params\" : [0]}'",
"http://localhost:9947"
]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s

polkadot2:
container_name: polkadot2
platform: linux/amd64
image: docker.io/parity/polkadot:v1.16.2
pull_policy: if_not_present
stop_grace_period: 5s
stop_signal: SIGINT
volumes:
- "../ci/docker/development/polkadot:/chainspecs:ro"
environment:
- RUST_BACKTRACE=full
command:
- --bob
- --chain=/chainspecs/polkadot.raw.json
- --force-authoring
- --name=PolkaDocker2
- --wasmtime-instantiation-strategy=recreate-instance-copy-on-write
- --unsafe-force-node-key-generation
ports:
- 9948:9944
- 30335:30333
healthcheck:
test:
[
"CMD-SHELL",
"curl",
"-H 'Content-Type: application/json;'",
"-d '{\"id\":1, \"jsonrpc\":\"2.0\", \"method\": \"chain_getBlockHash\", \"params\" : [0]}'",
"http://localhost:9947"
]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s


assethub:
container_name: assethub
platform: linux/amd64
image: docker.io/parity/polkadot-parachain:1.16.2
pull_policy: if_not_present
stop_grace_period: 5s
stop_signal: SIGINT
volumes:
- "../ci/docker/development/polkadot:/chainspecs:ro"
environment:
- RUST_BACKTRACE=full
command:
- --alice
- --collator
- --blocks-pruning=archive
- --chain=/chainspecs/assethub.raw.json
- --force-authoring
- --name=AssetHubDocker
- --rpc-cors=all
- --rpc-external
- --rpc-methods=unsafe
- --state-pruning=archive
- --rpc-max-connections=100000
- --unsafe-force-node-key-generation
- --
ahasna marked this conversation as resolved.
Show resolved Hide resolved
- --chain=/chainspecs/polkadot.raw.json
dandanlen marked this conversation as resolved.
Show resolved Hide resolved
ports:
- 9955:9944
- 40333:30333
healthcheck:
test:
[
Expand Down
1 change: 1 addition & 0 deletions localnet/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function print_success() {
👆 Then select logs (4)
💚 Head to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer to access PolkadotJS of Chainflip Network
🧡 Head to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9947#/explorer to access PolkadotJS of the Private Polkadot Network
💛 Head to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9955#/explorer to access PolkadotJS of the Private AssetHub Parachain
💜 Head to http://localhost:3002 to access the local Bitcoin explorer (credentials: flip / flip)
💙 Head to https://explorer.solana.com/?cluster=custom&customUrl=http%3A%2F%2Flocalhost%3A8899 to access SolExplorer for the Solana local Network
👮‍ To run the bouncer: ./localnet/manage.sh -> (6)
Expand Down
Loading