Skip to content

Commit

Permalink
Prepare separate runtime for testing sub2sub bridge (paritytech#341)
Browse files Browse the repository at this point in the history
* renamed bin/node/runtime to bin/node/rialto-runtime

* replaced bridge-node-runtime references with rialto-runtime references

* separate folders for millau/rialto nodes+runtimes

* extracted pallet-shift-session-manager

* bridge-node -> bridge-node-runtime

* uninstall previous rust (temp solution???)

* fix dockerfile

* cargo fmt

* fix benchmarks check

* fix benchmarks again

* update LAST_RUST_UPDATE to clear the cache

* changed runtime comments

* move bin/node/* to bin/

* REVERT ME

* Revert "REVERT ME"

This reverts commit 7c335f946308ed11d9ed6ffec7c1c13dbe2743ed.

* specify container name

* REVERT ME

* container_name -> hostname

* fix typo

* aliases

* Revert "REVERT ME"

This reverts commit 0e74af5f8430f1975a3fc924d8b52079f266bda1.

* removed prefixes
  • Loading branch information
svyatonik authored Sep 14, 2020
1 parent 2617549 commit e31eada
Show file tree
Hide file tree
Showing 49 changed files with 1,131 additions and 205 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
strategy:
matrix:
project:
- bridge-node
- rialto-bridge-node
- ethereum-poa-relay
include:
- project: bridge-node
- project: rialto-bridge-node
healthcheck: http://localhost:9933/health
- project: ethereum-poa-relay
healthcheck: http://localhost:9616/metrics
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ jobs:
command: clippy
toolchain: ${{ matrix.toolchain }}
args: --all-targets -- -D warnings
- name: Check benchmarks runtime ${{ matrix.platform }} rust-${{ matrix.toolchain }}
- name: Check Rialto benchmarks runtime ${{ matrix.platform }} rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: --manifest-path ./bin/node/node/Cargo.toml --no-default-features --features runtime-benchmarks --verbose
args: --manifest-path ./bin/rialto-node/Cargo.toml --no-default-features --features runtime-benchmarks --verbose

## Build stage
- name: Building rust-${{ matrix.toolchain }}
Expand All @@ -100,7 +100,7 @@ jobs:
if: github.ref == 'refs/heads/master'
run: |
mkdir -p ./artifacts;
mv -v $CARGO_TARGET_DIR/release/bridge-node ./artifacts/;
mv -v $CARGO_TARGET_DIR/release/rialto-bridge-node ./artifacts/;
mv -v $CARGO_TARGET_DIR/release/ethereum-poa-relay ./artifacts/;
shell: bash
- name: Upload artifacts
Expand Down
155 changes: 105 additions & 50 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[workspace]

members = [
"bin/node/node",
"bin/node/runtime",
"bin/millau-node",
"bin/rialto-node",
"bin/millau-runtime",
"bin/rialto-runtime",
"modules/call-dispatch",
"modules/substrate",
"modules/ethereum",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN update-ca-certificates && \
curl https://sh.rustup.rs -sSf | sh -s -- -y

ENV PATH="/root/.cargo/bin:${PATH}"
ENV LAST_RUST_UPDATE 2020-06-22
ENV LAST_RUST_UPDATE 2020-09-09

RUN rustup update stable && \
rustup install nightly && \
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PoA chains to Substrate. We're working on expanding this functionality in the fu
## Contents
- [Installation](#installation)
- [Project Layout](#project-layout)
- [Bridge Node Runtime](#bridge-node-runtime)
- [Rialto Runtime](#rialto-runtime)
- [Ethereum Node](#ethereum-node)
- [Bridge Relay](#bridge-relay)
- [Running the Bridge](#running-the-bridge)
Expand Down Expand Up @@ -60,7 +60,7 @@ the `relays` which are used to pass messages between chains.
│ └── substrate // 🚧 WIP 🚧
```

## Bridge Node Runtime
## Rialto Runtime
The node runtime consists of several runtime modules, however not all of them are used at the same
time. When running an Ethereum PoA to Substrate bridge the modules required are the Ethereum module
and the currency exchange module. When running a Substrate to Substrate bridge the Substrate and
Expand Down Expand Up @@ -170,7 +170,7 @@ First you'll need to build the bridge node and relay. This can be done as follow

```bash
# In `parity-bridges-common` folder
cargo build -p bridge-node
cargo build -p rialto-bridge-node
cargo build -p ethereum-poa-relay
```

Expand Down Expand Up @@ -204,7 +204,7 @@ chains it must be run last.
```bash
# In `parity-bridges-common` folder
./scripts/run-openethereum-node.sh
./scripts/run-bridge-node.sh
./scripts/run-rialto-bridge-node.sh
./scripts/run-eth2sub-relay.sh
```
At this point you should see the relayer submitting blocks from the Ethereum chain
Expand All @@ -221,7 +221,7 @@ docker build . -t bridge-relay-dev
You can also build and run the Substrate based node as follows:

```bash
docker build . -t bridge-node-dev --build-arg PROJECT=bridge-node
docker build . -t bridge-node-dev --build-arg PROJECT=rialto-bridge-node
```

To run the Substrate node you can do the following:
Expand All @@ -248,15 +248,15 @@ docker run -it poa-relay
```

By default the relayer is configured to connect to OpenEthereum `--dev` chain node and Substrate
`bridge-node` running in `--dev` mode.
`rialto-bridge-node` running in `--dev` mode.

To build the `bridge-node`:
To build the `rialto-bridge-node`:
```bash
docker build \
https://raw.githubusercontent.com/paritytech/parity-bridges-common/master/deployments/rialto/Bridge.Dockerfile \
-t bridge-node \
--build-arg PROJECT=bridge-node
docker run -it bridge-node --dev
-t rialto-bridge-node \
--build-arg PROJECT=rialto-bridge-node
docker run -it rialto-bridge-node --dev
```

And to build `OpenEthereum` with bridge support:
Expand Down
10 changes: 10 additions & 0 deletions bin/millau-node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "millau-bridge-node"
description = "Substrate node compatible with Millau runtime"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
bridge-node = { path = "../node", default-features = false, features = ["millau"] }
24 changes: 24 additions & 0 deletions bin/millau-node/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.

// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity Bridges Common is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

//! Millau bridge node.

#![warn(missing_docs)]

/// Run node.
fn main() -> bridge_node::Result {
bridge_node::run()
}
Loading

0 comments on commit e31eada

Please sign in to comment.