Adding Bridges code as git subtree. (#2515)

* Add instructions.

* Squashed 'bridges/' content from commit 345e84a21

git-subtree-dir: bridges
git-subtree-split: 345e84a2146b56628e9888c9f5e129cb40e868a9

* Remove bridges workspace file to avoid confusing Cargo.

* Add some bridges primitives to Polkadot workspace.

* Improve docs.
This commit is contained in:
Tomasz Drwięga
2021-03-01 22:33:16 +01:00
committed by GitHub
parent 7a2c7aa3fe
commit 5169155f94
291 changed files with 64249 additions and 0 deletions
@@ -0,0 +1,91 @@
FROM ubuntu:xenial AS builder
# show backtraces
ENV RUST_BACKTRACE 1
ENV LAST_DEPS_UPDATE 2020-06-19
# install tools and dependencies
RUN set -eux; \
apt-get update && \
apt-get install -y file curl jq ca-certificates && \
apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev
ENV LAST_CERTS_UPDATE 2020-06-19
RUN update-ca-certificates && \
curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV LAST_RUST_UPDATE="2020-09-09"
RUN rustup update stable && \
rustup install nightly && \
rustup target add wasm32-unknown-unknown --toolchain nightly
RUN rustc -vV && \
cargo -V && \
gcc -v && \
g++ -v && \
cmake --version
WORKDIR /openethereum
### Build from the repo
ARG ETHEREUM_REPO=https://github.com/paritytech/openethereum.git
ARG ETHEREUM_HASH=344991dbba2bc8657b00916f0e4b029c66f159e8
RUN git clone $ETHEREUM_REPO /openethereum && git checkout $ETHEREUM_HASH
### Build locally. Make sure to set the CONTEXT to main directory of the repo.
# ADD openethereum /openethereum
WORKDIR /parity-bridges-common
### Build from the repo
# Build using `master` initially.
ARG BRIDGE_REPO=https://github.com/paritytech/parity-bridges-common
RUN git clone $BRIDGE_REPO /parity-bridges-common && git checkout master
WORKDIR /openethereum
RUN cargo build --release --verbose || true
# Then rebuild by switching to a different branch to only incrementally
# build the changes.
WORKDIR /parity-bridges-common
ARG BRIDGE_HASH=master
RUN git checkout . && git fetch && git checkout $BRIDGE_HASH
### Build locally. Make sure to set the CONTEXT to main directory of the repo.
# ADD . /parity-bridges-common
WORKDIR /openethereum
RUN cargo build --release --verbose
RUN strip ./target/release/openethereum
FROM ubuntu:xenial
# show backtraces
ENV RUST_BACKTRACE 1
RUN set -eux; \
apt-get update && \
apt-get install -y curl
RUN groupadd -g 1000 openethereum \
&& useradd -u 1000 -g openethereum -s /bin/sh -m openethereum
# switch to user openethereum here
USER openethereum
WORKDIR /home/openethereum
COPY --chown=openethereum:openethereum --from=builder /openethereum/target/release/openethereum ./
# Solve issues with custom --keys-path
RUN mkdir -p ~/.local/share/io.parity.ethereum/keys/
# check if executable works in this container
RUN ./openethereum --version
EXPOSE 8545 8546 30303/tcp 30303/udp
HEALTHCHECK --interval=2m --timeout=5s \
CMD curl -f http://localhost:8545/api/health || exit 1
ENTRYPOINT ["/home/openethereum/openethereum"]
@@ -0,0 +1,46 @@
# Compose file for quickly spinning up a local instance of an Ethereum PoA network.
#
# Note that this PoA network is only used for testing, so the configuration settings you see here
# are *not* recommended for a production environment.
#
# For example, do *not* keep your account key in version control, and unless you're _really_ sure
# you want to provide public access to your nodes do *not* publicly expose RPC methods.
version: '3.5'
services:
poa-node-arthur: &poa-node
image: hcastano/openethereum-bridge-builtins
entrypoint:
- /home/openethereum/openethereum
- --config=/config/poa-node-config
- --node-key=arthur
- --engine-signer=0x005e714f896a8b7cede9d38688c1a81de72a58e4
environment:
RUST_LOG: rpc=trace,txqueue=trace,bridge-builtin=trace
ports:
- "8545:8545"
- "8546:8546"
- "30303:30303"
poa-node-bertha:
<<: *poa-node
entrypoint:
- /home/openethereum/openethereum
- --config=/config/poa-node-config
- --node-key=bertha
- --engine-signer=0x007594304039c2937a12220338aab821d819f5a4
ports:
- "8645:8545"
- "8646:8546"
- "31303:30303"
poa-node-carlos:
<<: *poa-node
entrypoint:
- /home/openethereum/openethereum
- --config=/config/poa-node-config
- --node-key=carlos
- --engine-signer=0x004e7a39907f090e19b0b80a277e77b72b22e269
ports:
- "8745:8545"
- "8746:8546"
- "32303:30303"
@@ -0,0 +1,89 @@
# Compose file for quickly spinning up a local instance of the Millau Substrate network.
#
# Note that the Millau network is only used for testing, so the configuration settings you see here
# are *not* recommended for a production environment.
#
# For example, do *not* keep your `node-key` in version control, and unless you're _really_ sure you
# want to provide public access to your nodes do *not* publicly expose RPC methods.
version: '3.5'
services:
millau-node-alice: &millau-bridge-node
image: paritytech/millau-bridge-node
entrypoint:
- /home/user/millau-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/millau-node-bob/tcp/30333/p2p/12D3KooWM5LFR5ne4yTQ4sBSXJ75M4bDo2MAhAW2GhL3i8fe5aRb
- --alice
- --node-key=0f900c89f4e626f4a217302ab8c7d213737d00627115f318ad6fb169717ac8e0
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
environment:
RUST_LOG: runtime=trace,rpc=debug,txpool=trace,pallet_substrate_bridge=trace,pallet_bridge_call_dispatch=trace,pallet_message_lane=trace
ports:
- "19933:9933"
- "19944:9944"
millau-node-bob:
<<: *millau-bridge-node
entrypoint:
- /home/user/millau-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/millau-node-alice/tcp/30333/p2p/12D3KooWFqiV73ipQ1jpfVmCfLqBCp8G9PLH3zPkY9EhmdrSGA4H
- --bob
- --node-key=db383639ff2905d79f8e936fd5dc4416ef46b514b2f83823ec3c42753d7557bb
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
environment:
RUST_LOG: runtime=trace,rpc=debug,txpool=trace,pallet_substrate_bridge=trace,pallet_bridge_call_dispatch=trace,pallet_message_lane=trace,jsonrpc_ws_server=trace,parity_ws=trace
ports:
- "20033:9933"
- "20044:9944"
millau-node-charlie:
<<: *millau-bridge-node
entrypoint:
- /home/user/millau-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/millau-node-alice/tcp/30333/p2p/12D3KooWFqiV73ipQ1jpfVmCfLqBCp8G9PLH3zPkY9EhmdrSGA4H
- --charlie
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "20133:9933"
- "20144:9944"
millau-node-dave:
<<: *millau-bridge-node
entrypoint:
- /home/user/millau-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/millau-node-alice/tcp/30333/p2p/12D3KooWFqiV73ipQ1jpfVmCfLqBCp8G9PLH3zPkY9EhmdrSGA4H
- --dave
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "20233:9933"
- "20244:9944"
millau-node-eve:
<<: *millau-bridge-node
entrypoint:
- /home/user/millau-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/millau-node-alice/tcp/30333/p2p/12D3KooWFqiV73ipQ1jpfVmCfLqBCp8G9PLH3zPkY9EhmdrSGA4H
- --eve
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "20333:9933"
- "20344:9944"
@@ -0,0 +1,89 @@
# Compose file for quickly spinning up a local instance of the Rialto Substrate network.
#
# Note that the Rialto network is only used for testing, so the configuration settings you see here
# are *not* recommended for a production environment.
#
# For example, do *not* keep your `node-key` in version control, and unless you're _really_ sure you
# want to provide public access to your nodes do *not* publicly expose RPC methods.
version: '3.5'
services:
rialto-node-alice: &rialto-bridge-node
image: paritytech/rialto-bridge-node
entrypoint:
- /home/user/rialto-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/rialto-node-bob/tcp/30333/p2p/12D3KooWSEpHJj29HEzgPFcRYVc5X3sEuP3KgiUoqJNCet51NiMX
- --alice
- --node-key=79cf382988364291a7968ae7825c01f68c50d679796a8983237d07fe0ccf363b
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
environment:
RUST_LOG: runtime=trace,rpc=debug,txpool=trace,pallet_substrate_bridge=trace,pallet_bridge_call_dispatch=trace,pallet_message_lane=trace
ports:
- "9933:9933"
- "9944:9944"
rialto-node-bob:
<<: *rialto-bridge-node
entrypoint:
- /home/user/rialto-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/rialto-node-alice/tcp/30333/p2p/12D3KooWMF6JvV319a7kJn5pqkKbhR3fcM2cvK5vCbYZHeQhYzFE
- --bob
- --node-key=4f9d0146dd9b7b3bf5a8089e3880023d1df92057f89e96e07bb4d8c2ead75bbd
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
environment:
RUST_LOG: runtime=trace,rpc=debug,txpool=trace,pallet_substrate_bridge=trace,pallet_bridge_call_dispatch=trace,pallet_message_lane=trace,jsonrpc_ws_server=trace,parity_ws=trace
ports:
- "10033:9933"
- "10044:9944"
rialto-node-charlie:
<<: *rialto-bridge-node
entrypoint:
- /home/user/rialto-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/rialto-node-alice/tcp/30333/p2p/12D3KooWMF6JvV319a7kJn5pqkKbhR3fcM2cvK5vCbYZHeQhYzFE
- --charlie
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "10133:9933"
- "10144:9944"
rialto-node-dave:
<<: *rialto-bridge-node
entrypoint:
- /home/user/rialto-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/rialto-node-alice/tcp/30333/p2p/12D3KooWMF6JvV319a7kJn5pqkKbhR3fcM2cvK5vCbYZHeQhYzFE
- --dave
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "10233:9933"
- "10244:9944"
rialto-node-eve:
<<: *rialto-bridge-node
entrypoint:
- /home/user/rialto-bridge-node
- --execution=Native
- --chain=local
- --bootnodes=/dns4/rialto-node-alice/tcp/30333/p2p/12D3KooWMF6JvV319a7kJn5pqkKbhR3fcM2cvK5vCbYZHeQhYzFE
- --eve
- --rpc-cors=all
- --unsafe-rpc-external
- --unsafe-ws-external
ports:
- "10333:9933"
- "10344:9944"