Skip to content

Commit

Permalink
polkadot-v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wizdave97 committed Sep 22, 2023
1 parent 2dc4f3a commit 14755a5
Show file tree
Hide file tree
Showing 16 changed files with 1,532 additions and 4,793 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
.github
.cargo
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

*.log
**/node_modules/*
rococo*.json
**/polkadot-launch/rococo*.json
.cargo/
.DS_Store
.DS_Store
**/zombienet/zombienet
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM paritytech/ci-linux:production

COPY ./ ./

RUN RUSTFLAGS="-C link-args=-Wl,--allow-multiple-definition" cargo build --release

ENTRYPOINT ["./target/release/hyperbridge"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# Hyperbridge
Hyperbridge is a scalable, multi-chain bridhge network. Powered by zkSNARKs, Secured by Polkadot.

## Running a local tesnet with zombienet
1. Download the zombienet binary for your os from https://github.com/paritytech/zombienet
2. Run `./zombienet spawn --provider native ./scripts/zombienet/local-testnet.toml`

## Running a local testnet with docker
1. Build the hyperbridge docker image by running `docker build . -t polytopelabs/hyperbridge`
2. Navigate to `scripts/parachain-launch`
3. Run `docker compose up`
119 changes: 119 additions & 0 deletions scripts/parachain-launch/dev-2000-2000.json

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions scripts/parachain-launch/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
version: "3.7"
services:
relaychain-alice:
ports:
- 9944:9944
- 9933:9933
- 30333:30333
volumes:
- relaychain-alice:/data
build:
context: .
dockerfile: relaychain.Dockerfile
command:
- --base-path=/data
- --chain=/app/rococo-local.json
- --validator

- --rpc-external
- --rpc-cors=all
- --name=alice
- --alice
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
- --force-authoring
environment:
RUST_LOG: babe=debug
ulimits: &a1
nofile:
soft: 65536
hard: 65536
relaychain-bob:
ports:
- 9945:9945
- 9935:9935
- 30334:30334
volumes:
- relaychain-bob:/data
build:
context: .
dockerfile: relaychain.Dockerfile
command:
- --base-path=/data
- --chain=/app/rococo-local.json
- --validator

- --rpc-external
- --rpc-cors=all
- --name=bob
- --bob
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
- --force-authoring
environment:
RUST_LOG: parachain::candidate-backing=trace
ulimits: *a1
relaychain-charlie:
ports:
- 9946:9946
- 9936:9936
- 30335:30335
volumes:
- relaychain-charlie:/data
build:
context: .
dockerfile: relaychain.Dockerfile
command:
- --base-path=/data
- --chain=/app/rococo-local.json
- --validator

- --rpc-external
- --rpc-cors=all
- --name=charlie
- --charlie
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
- --force-authoring
environment:
RUST_LOG: parachain::candidate-backing=trace
ulimits: *a1
relaychain-ferdie:
ports:
- 9948:9948
- 9937:9937
- 30336:30336
volumes:
- relaychain-ferdie:/data
build:
context: .
dockerfile: relaychain.Dockerfile
command:
- --base-path=/data
- --chain=/app/rococo-local.json
- --validator

- --rpc-external
- --rpc-cors=all
- --name=ferdie
- --ferdie
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
- --force-authoring
environment:
RUST_LOG: parachain::candidate-backing=trace
ulimits: *a1
relaychain-eve:
ports:
- 9949:9949
- 9938:9938
- 30337:30337
volumes:
- relaychain-eve:/data
build:
context: .
dockerfile: relaychain.Dockerfile
command:
- --base-path=/data
- --chain=/app/rococo-local.json
- --validator

- --rpc-external
- --rpc-cors=all
- --name=eve
- --eve
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
- --force-authoring
environment:
RUST_LOG: parachain::candidate-backing=trace
ulimits: *a1
parachain-2000-0:
ports:
- 9988:9988
- 9951:9951
- 31200:31200
volumes:
- parachain-2000-0:/hyperbridge/data
build:
context: .
dockerfile: parachain-2000.Dockerfile
command:
- --base-path=/hyperbridge/data
- --chain=/app/dev-2000-2000.json

- --rpc-external
- --rpc-cors=all
- --name=parachain-2000-0
- --collator
- --rpc-methods=unsafe
- --force-authoring
- --enable-offchain-indexing=true
- --pruning=archive
- --alice
- --node-key=34346b565d57aa11cf437e3a6498781c62c152a47b3b485d8cdeaa691c75b71c
- --listen-addr=/ip4/0.0.0.0/tcp/30333
- --
- --chain=/app/rococo-local.json
- --name=relaychain-alice
environment:
RUST_LOG: sc_basic_authorship=trace
ulimits: *a1
parachain-2000-1:
ports:
- 9989:9989
- 9952:9952
- 31201:31201
volumes:
- parachain-2000-1:/hyperbridge/data
build:
context: .
dockerfile: parachain-2000.Dockerfile
command:
- --base-path=/hyperbridge/data
- --chain=/app/dev-2000-2000.json

- --rpc-external
- --rpc-cors=all
- --name=parachain-2000-1
- --collator
- --rpc-methods=unsafe
- --force-authoring
- --enable-offchain-indexing=true
- --pruning=archive
- --bob
- --bootnodes=/dns/parachain-2000-0/tcp/30333/p2p/12D3KooWAUFa6koFfKLzCHS6gCjYmgkquYhPNxN9pw2sTzAJzn9z
- --listen-addr=/ip4/0.0.0.0/tcp/30333
- --
- --chain=/app/rococo-local.json
- --name=relaychain-bob
environment:
RUST_LOG: sc_basic_authorship=trace
ulimits: *a1
parachain-2000-2:
ports:
- 9990:9990
- 9953:9953
- 31202:31202
volumes:
- parachain-2000-2:/hyperbridge/data
build:
context: .
dockerfile: parachain-2000.Dockerfile
command:
- --base-path=/hyperbridge/data
- --chain=/app/dev-2000-2000.json

- --rpc-external
- --rpc-cors=all
- --name=parachain-2000-2
- --collator
- --rpc-methods=unsafe
- --force-authoring
- --enable-offchain-indexing=true
- --pruning=archive
- --charlie
- --bootnodes=/dns/parachain-2000-0/tcp/30333/p2p/12D3KooWAUFa6koFfKLzCHS6gCjYmgkquYhPNxN9pw2sTzAJzn9z
- --listen-addr=/ip4/0.0.0.0/tcp/30333
- --
- --chain=/app/rococo-local.json
- --name=relaychain-charlie
environment:
RUST_LOG: sc_basic_authorship=trace
ulimits: *a1
volumes:
relaychain-alice: null
relaychain-bob: null
relaychain-charlie: null
relaychain-ferdie: null
relaychain-eve: null
parachain-2000-0: null
parachain-2000-1: null
parachain-2000-2: null
96 changes: 96 additions & 0 deletions scripts/parachain-launch/local_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Relaychain Configuration
relaychain:
image: parity/polkadot:v1.1.0 # the docker image to use
chain: rococo-local # the chain to use
runtimeGenesisConfig: # additonal genesis override
configuration:
config:
validation_upgrade_cooldown: 10
validation_upgrade_delay: 10
env: # environment variables for all relaychain nodes
RUST_LOG: parachain::candidate-backing=trace
flags: # additional CLI flags for all relaychain nodes
- --rpc-methods=unsafe
- --enable-offchain-indexing=true
- --pruning=archive
nodes: # nodes config
- name: alice # the node name and session key, this imply `--alice`
wsPort: 9944 # default ws port number is `9944 + global_node_index`
rpcPort: 9933 # default rpc port number is `9933 + global_node_index`
port: 30333 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring
env:
RUST_LOG: babe=debug # environment varitables for this node
- name: bob
wsPort: 9945 # default ws port number is `9944 + global_node_index`
rpcPort: 9935 # default rpc port number is `9933 + global_node_index`
port: 30334 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring
- name: charlie
wsPort: 9946 # default ws port number is `9944 + global_node_index`
rpcPort: 9936 # default rpc port number is `9933 + global_node_index`
port: 30335 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring
- name: ferdie
wsPort: 9948 # default ws port number is `9944 + global_node_index`
rpcPort: 9937 # default rpc port number is `9933 + global_node_index`
port: 30336 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring
- name: eve
wsPort: 9949 # default ws port number is `9944 + global_node_index`
rpcPort: 9938 # default rpc port number is `9933 + global_node_index`
port: 30337 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring

# Parachain Configuration
parachains:
# Config for first parachain
- image: polytopelabs/hyperbridge
chain: # this could be a string like `dev` or a config object
base: dev-2000 # the chain to use
collators: # override collators
- alice # this imply //Alice
- bob
- charlie
sudo: alice # override sudo key to //Alice
runtimeGenesisConfig: # additonal genesis override
balances:
balances:
- [5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty, 10000000000000000]
id: 2000 # override parachain id
parachain: true # this is parachain, not parathread
flags: # CLI flags for this parachain nodes
- --rpc-methods=unsafe
- --force-authoring
- --enable-offchain-indexing=true
- --pruning=archive
env: # environment variables for this parachain nodes
RUST_LOG: sc_basic_authorship=trace
volumePath: /hyperbridge/data # The path to mount volume and base path, default to /data
nodes: # nodes config
- wsPort: 9988
rpcPort: 9951
port: 31200
flags: # additional CLI flags for this node
- --alice
relaychainFlags: # additional CLI flags for relaychain part
- --name=relaychain-alice
- wsPort: 9989
rpcPort: 9952
port: 31201
flags: # additional CLI flags for this node
- --bob
relaychainFlags: # additional CLI flags for relaychain part
- --name=relaychain-bob
- wsPort: 9990
rpcPort: 9953
port: 31202
flags: # additional CLI flags for this node
- --charlie
relaychainFlags: # additional CLI flags for relaychain part
- --name=relaychain-charlie
15 changes: 15 additions & 0 deletions scripts/parachain-launch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "parachain-launch",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parachain-launch generate --config=./local_config.yml --yes --output=./"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@open-web3/parachain-launch": "^1.4.2"
}
}
2 changes: 2 additions & 0 deletions scripts/parachain-launch/parachain-2000.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM polytopelabs/hyperbridge
COPY . /app
2 changes: 2 additions & 0 deletions scripts/parachain-launch/relaychain.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM parity/polkadot:v1.1.0
COPY . /app
Loading

0 comments on commit 14755a5

Please sign in to comment.