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 and serban300 committed Apr 10, 2024
1 parent c8a6cd4 commit f507972
Show file tree
Hide file tree
Showing 31 changed files with 938 additions and 95 deletions.
20 changes: 10 additions & 10 deletions bridges/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 bridges/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 bridges/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()
}
254 changes: 254 additions & 0 deletions bridges/bin/millau-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
[package]
name = "millau-runtime"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/parity-bridges-common/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
hex-literal = "0.3"

[dependencies.codec]
package = "parity-scale-codec"
version = "1.3.1"
default-features = false
features = ["derive"]

[dependencies.serde]
version = "1.0.115"
optional = true
features = ["derive"]

# Substrate Dependencies
[dependencies.pallet-aura]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-balances]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-bridge-call-dispatch]
version = "0.1.0"
default-features = false
path = "../../modules/call-dispatch"

[dependencies.pallet-message-lane]
version = "0.1.0"
default-features = false
path = "../../modules/message-lane"

[dependencies.frame-support]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-grandpa]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-randomness-collective-flip]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-sudo]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-shift-session-manager]
version = "0.1.0"
default-features = false
path = "../../modules/shift-session-manager"

[dependencies.pallet-session]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.frame-system]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.frame-system-rpc-runtime-api]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-timestamp]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.pallet-transaction-payment]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.frame-executive]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

# Substrate Primitives
[dependencies.sp-api]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-block-builder]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-consensus-aura]
version = "0.8.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-core]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-inherents]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-io]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-offchain]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-runtime]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-session]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-staking]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-std]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-transaction-pool]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.sp-version]
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.frame-benchmarking]
optional = true
version = "2.0.0-rc6"
tag = 'v2.0.0-rc6'
default-features = false
git = "https://github.com/paritytech/substrate/"

[dependencies.bp-header-chain]
version = "0.1.0"
default-features = false
path = "../../primitives/header-chain"

[dependencies.bp-message-lane]
version = "0.1.0"
default-features = false
path = "../../primitives/message-lane"

# Dev Dependencies

[build-dependencies.wasm-builder-runner]
version = "1.0.5"
tag = 'v2.0.0-rc6'
package = "substrate-wasm-builder-runner"
git = "https://github.com/paritytech/substrate/"

[features]
default = ["std"]
std = [
"bp-message-lane/std",
"codec/std",
"frame-benchmarking/std",
"frame-executive/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"pallet-aura/std",
"pallet-balances/std",
"pallet-bridge-call-dispatch/std",
"pallet-grandpa/std",
"pallet-randomness-collective-flip/std",
"pallet-shift-session-manager/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment/std",
"serde",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
File renamed without changes.
Loading

0 comments on commit f507972

Please sign in to comment.