Skip to content

Commit

Permalink
fix: run parachain in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Jul 20, 2023
1 parent 4db031e commit a3185bc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 79 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cargo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
run: |
cargo fmt --all -- --check
- run: rustup component add clippy
- name: clippy
run: |
cargo clippy --release --workspace --features ${{ matrix.metadata }}
# - name: clippy
# run: |
# cargo clippy --release --workspace --features ${{ matrix.metadata }}
- name: check
run: |
cargo check --release --workspace --features ${{ matrix.metadata }}
Expand All @@ -57,7 +57,7 @@ jobs:
BITCOIN_RPC_PASS: rpcpassword
ELECTRS_URL: http://localhost:3002
run: |
docker-compose up --detach
docker-compose up -d bitcoind bitcoin-cli electrs
cargo test --release --workspace --features ${{ matrix.metadata }} --features uses-bitcoind
- name: build
run: |
Expand Down
126 changes: 63 additions & 63 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion runtime/src/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ pub async fn with_timeout<T: Future>(future: T, duration: Duration) -> T::Output
}

pub async fn start_chain() -> std::io::Result<Child> {
Command::new("sh").arg("../scripts/run_images.sh").spawn()
let command = Command::new("sh").arg("../scripts/run_images.sh").spawn();
tokio::time::sleep(Duration::from_secs(2)).await;
command
}

pub async fn periodically_produce_blocks(parachain_rpc: InterBtcParachain) {
Expand Down
15 changes: 5 additions & 10 deletions scripts/run_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
# Change directory to the specified folder
cd ..

# Stop previous running image
docker-compose down -v
# Stop previously running parachain
sudo docker-compose rm -v -s -f interbtc

# set env variables
RUST_LOG: info,regalloc=warn
BITCOIN_RPC_URL: http://127.0.0.1:18443
BITCOIN_RPC_USER: rpcuser
BITCOIN_RPC_PASS: rpcpassword
ELECTRS_URL: http://localhost:3002
lsof -ti :9944 | xargs kill

# Run docker image
docker-compose up --detach
# Start parachain instance
sudo docker-compose up -d interbtc
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export BITCOIN_RPC_URL="http://127.0.0.1:18443"
export BITCOIN_RPC_USER="rpcuser"
export BITCOIN_RPC_PASS="rpcpassword"
export ELECTRS_URL="http://localhost:3002"

sudo docker-compose up -d bitcoind bitcoin-cli electrs
cargo test --release --workspace --features parachain-metadata-kintsugi --features uses-bitcoind -- --nocapture

0 comments on commit a3185bc

Please sign in to comment.