forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
substrate-bridge-relay
into repository (#1)
* Initial commit. CLI which parses RPC urls. * Establish ws connections and make simple RPC requests. * Complete bridge setup. * Process subscription events. * Ctrl-C handler. * Write a bare-bones README and copy in design doc. * Modularize code a little bit. * Communicate with each chain in a separate task. * Parse headers from RPC subscription notifications. * Send (fake) extrinsics across bridge channels. And now it's deadlocked. * Fix deadlock. * Clarify in README that this is not-in-progress. * Move everything into a single folder * Move Substrate relay into appropriate folder * Get the Substrate Relay node compiling * Update Cargo.lock * Use new composite accounts from Substrate * Remove specification document It has been moved to the Wiki on the Github repo. * Update author + remove comments * Use latest master for jsonrpsee Required renaming some stuff (e.g Client -> RawClient) Co-authored-by: Jim Posen <[email protected]>
- Loading branch information
Showing
8 changed files
with
661 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "substrate-bridge" | ||
version = "0.1.0" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
async-std = "1.0.1" | ||
clap = "2.3.3" | ||
ctrlc = "3.1.3" | ||
derive_more = "0.99.1" | ||
env_logger = "0.7.1" | ||
futures = "0.3.1" | ||
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee", features = ["ws"] } | ||
log = "0.4.8" | ||
node-primitives = { version = "2.0.0", git = "https://github.com/paritytech/substrate" } | ||
serde_json = "1.0.41" | ||
sp-core = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git" } | ||
sp-rpc = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git" } | ||
url = "2.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Substrate-to-Substrate Bridge Relay | ||
|
||
The bridge relay is a process that connects to running Substrate nodes and sends data over the Substrate-to-Substrate bridge. The process communicates with the nodes over the JSON-RPC interface and reads data from the relays information required by the `bridge` pallet using runtime calls and writes data to the modules by constructing and submitting extrinsics. | ||
|
||
For more details, see the [design document](doc/design.md). | ||
|
||
## Status | ||
|
||
This is a not-in-progress prototype. | ||
|
||
## Running in development | ||
|
||
Run two development Substrate chains: | ||
|
||
```bash | ||
> TMPDIR=(mktemp -d) | ||
> cd $TMPDIR | ||
> substrate build-spec --dev > red-spec.json | ||
> cp red-spec.json blue-spec.json | ||
# Modify the chain spec in an editor so that the genesis hashes of the two chains differ. | ||
# For example, double one of the balances in '$.genesis.runtime.balances.balances'. | ||
> substrate --chain red-spec.json --alice --base-path ./red --port 30343 --ws-port 9954 | ||
> substrate --chain blue-spec.json --alice --base-path ./blue --port 30353 --ws-port 9964 | ||
``` | ||
|
||
Now run the bridge relay: | ||
|
||
``` | ||
> target/release/substrate-bridge --base-path ./relay \ | ||
--rpc-url ws://localhost:9954 \ | ||
--rpc-url ws://localhost:9964 | ||
``` |
Oops, something went wrong.