Skip to content

Commit

Permalink
Docker set up (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege authored Sep 25, 2023
1 parent 8803007 commit 976b278
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 316 deletions.
478 changes: 209 additions & 269 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Hyperbridge
Hyperbridge is a scalable, multi-chain bridhge network. Powered by zkSNARKs, Secured by Polkadot.
Hyperbridge is a hyper-scalable, bridge 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`
1. Build the hyperbridge docker image by running `docker build -t hyperbridge -f ./scripts/docker/Dockerfile .`
2. Navigate to `scripts/parachain-launch`
3. Run `docker compose up`
3. Run `docker compose up`
41 changes: 20 additions & 21 deletions parachain/chainspec/gargantuan-raw.json

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions parachain/chainspec/gargantuan.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ismp-rpc = { git = "https://github.com/polytope-labs/substrate-ismp.git", branch
ismp-runtime-api = { git = "https://github.com/polytope-labs/substrate-ismp.git", branch = "main" }

# local
ismp-parachain-inherent = { path = "../modules/consensus/parachain/inherent" }
#ismp-parachain-inherent = { path = "../modules/consensus/parachain/inherent" }


[build-dependencies]
Expand Down
10 changes: 6 additions & 4 deletions parachain/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
let id = u32::from_str(id).expect("can't parse Id into u32");
Box::new(chain_spec::development_config(id))
},
"template-rococo" => Box::new(chain_spec::local_testnet_config()),
"gargantuan" => Box::new(chain_spec::ChainSpec::from_json_bytes(
include_bytes!("../../chainspec/gargantuan-raw.json").to_vec(),
)?),
"" | "local" => Box::new(chain_spec::local_testnet_config()),
path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
})
Expand All @@ -41,7 +43,7 @@ impl SubstrateCli for Cli {

fn description() -> String {
format!(
"Hyperbridge\n\nThe command-line arguments provided first will be \
"Hyperbridge by Polytope Labs\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Expand All @@ -58,7 +60,7 @@ impl SubstrateCli for Cli {
}

fn copyright_start_year() -> i32 {
2020
2023
}

fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Expand All @@ -77,7 +79,7 @@ impl SubstrateCli for RelayChainCli {

fn description() -> String {
format!(
"Hyperpridge\n\nThe command-line arguments provided first will be \
"Hyperbridge by Polytope Labs\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM paritytech/ci-linux:production

COPY ./ ./

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

ENTRYPOINT ["./target/release/hyperbridge"]
8 changes: 8 additions & 0 deletions scripts/docker/slim.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM docker.io/library/debian:bullseye-slim

WORKDIR /

COPY ./hyperbridge ./


ENTRYPOINT ["./hyperbridge"]
2 changes: 1 addition & 1 deletion scripts/zombienet/local-testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ args = [
name = "charlie"
validator = true
rpc_port = 9957
ws_port = 9988
ws_port = 9889
command = "../../target/release/hyperbridge"
args = [
"-lparachain=debug", "--enable-offchain-indexing=true", "--pruning=archive"
Expand Down

0 comments on commit 976b278

Please sign in to comment.