mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 14:25:41 +00:00
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:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PAT_GPL="^// Copyright.*If not, see <http://www.gnu.org/licenses/>\.$"
|
||||
PAT_OTHER="^// Copyright"
|
||||
|
||||
SCRIPTS_DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
|
||||
for f in $(find . -type f | egrep '\.(c|cpp|rs)$'); do
|
||||
HEADER=$(head -16 $f)
|
||||
if [[ $HEADER =~ $PAT_GPL ]]; then
|
||||
BODY=$(tail -n +17 $f)
|
||||
cat $SCRIPTS_DIR/license_header > temp
|
||||
echo "$BODY" >> temp
|
||||
mv temp $f
|
||||
elif [[ $HEADER =~ $PAT_OTHER ]]; then
|
||||
echo "Other license was found do nothing"
|
||||
else
|
||||
echo "$f was missing header"
|
||||
cat $SCRIPTS_DIR/license_header $f > temp
|
||||
mv temp $f
|
||||
fi
|
||||
done
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xeu
|
||||
|
||||
echo $CARGO_TARGET_DIR;
|
||||
mkdir -p $CARGO_TARGET_DIR;
|
||||
echo "Current Rust nightly version:";
|
||||
rustc +nightly --version;
|
||||
echo "Cached Rust nightly version:";
|
||||
if [ ! -f $CARGO_TARGET_DIR/check_nightly_rust ]; then
|
||||
echo "" > $CARGO_TARGET_DIR/check_nightly_rust;
|
||||
fi
|
||||
cat $CARGO_TARGET_DIR/check_nightly_rust;
|
||||
if [[ $(cat $CARGO_TARGET_DIR/check_nightly_rust) == $(rustc +nightly --version) ]]; then
|
||||
echo "The Rust nightly version has not changed";
|
||||
else
|
||||
echo "The Rust nightly version has changed. Clearing the cache";
|
||||
rm -rf $CARGO_TARGET_DIR/*;
|
||||
fi
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A script to dump logs from selected important docker containers
|
||||
# to make it easier to analyze locally.
|
||||
|
||||
set -xeu
|
||||
|
||||
DATE=$(date +"%Y-%m-%d-%T")
|
||||
LOGS_DIR="${DATE//:/-}-logs"
|
||||
mkdir $LOGS_DIR
|
||||
cd $LOGS_DIR
|
||||
|
||||
# From $ docker ps --format '{{.Names}}'
|
||||
|
||||
SERVICES=(\
|
||||
deployments_relay-messages-millau-to-rialto-generator_1 \
|
||||
deployments_relay-messages-rialto-to-millau-generator_1 \
|
||||
deployments_relay-messages-millau-to-rialto_1 \
|
||||
deployments_relay-messages-rialto-to-millau_1 \
|
||||
deployments_relay-headers-millau-to-rialto_1 \
|
||||
deployments_relay-headers-rialto-to-millau_1 \
|
||||
deployments_rialto-node-alice_1 \
|
||||
deployments_rialto-node-bob_1 \
|
||||
deployments_millau-node-alice_1 \
|
||||
deployments_millau-node-bob_1 \
|
||||
)
|
||||
|
||||
for SVC in ${SERVICES[*]}
|
||||
do
|
||||
SHORT_NAME="${SVC//deployments_/}"
|
||||
docker logs $SVC &> $SHORT_NAME.log
|
||||
done
|
||||
|
||||
cd -
|
||||
tar cvjf $LOGS_DIR.tar.bz2 $LOGS_DIR
|
||||
@@ -0,0 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run a development instance of the Ethereum to Substrate relay. Needs running
|
||||
# Substrate and Ethereum nodes in order to work.
|
||||
|
||||
RUST_LOG=rpc=trace,bridge=trace ./target/debug/ethereum-poa-relay eth-to-sub
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script assumes that an OpenEthereum build is available. The repo
|
||||
# should be at the same level as the `parity-bridges-common` repo.
|
||||
|
||||
RUST_LOG=rpc=trace,txqueue=trace,bridge-builtin=trace \
|
||||
../openethereum/target/debug/openethereum \
|
||||
--config="$(pwd)"/deployments/dev/poa-config/poa-node-config \
|
||||
--node-key=arthur \
|
||||
--engine-signer=0x005e714f896a8b7cede9d38688c1a81de72a58e4 \
|
||||
--base-path=/tmp/oe-dev-node \
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Used for manually sending a message to a running network.
|
||||
#
|
||||
# You could for example spin up a full network using the Docker Compose files
|
||||
# we have (to make sure the message relays are running), but remove the message
|
||||
# generator service. From there you may submit messages manually using this script.
|
||||
|
||||
case "$1" in
|
||||
remark)
|
||||
RUST_LOG=runtime=trace,substrate-relay=trace,bridge=trace \
|
||||
./target/debug/substrate-relay send-message millau-to-rialto \
|
||||
--millau-host localhost \
|
||||
--millau-port 20044 \
|
||||
--millau-signer //Dave \
|
||||
--rialto-signer //Dave \
|
||||
--lane 00000000 \
|
||||
--origin Target \
|
||||
remark \
|
||||
;;
|
||||
transfer)
|
||||
RUST_LOG=runtime=trace,substrate-relay=trace,bridge=trace \
|
||||
./target/debug/substrate-relay send-message millau-to-rialto \
|
||||
--millau-host localhost \
|
||||
--millau-port 20044 \
|
||||
--millau-signer //Dave \
|
||||
--rialto-signer //Dave \
|
||||
--lane 00000000 \
|
||||
--origin Target \
|
||||
transfer \
|
||||
--amount 100000000000000 \
|
||||
--recipient 5DZvVvd1udr61vL7Xks17TFQ4fi9NiagYLaBobnbPCP14ewA \
|
||||
;;
|
||||
*) echo "A message type is require. Supported messages: remark, transfer."; exit 1;;
|
||||
esac
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Run this script from root of the repo
|
||||
|
||||
cargo run --manifest-path=bin/rialto/node/Cargo.toml --release --features=runtime-benchmarks -- benchmark \
|
||||
--chain=local \
|
||||
--steps=50 \
|
||||
--repeat=20 \
|
||||
--pallet=pallet_message_lane \
|
||||
--extrinsic=* \
|
||||
--execution=wasm \
|
||||
--wasm-execution=Compiled \
|
||||
--heap-pages=4096 \
|
||||
--output=./modules/message-lane/src/weights.rs \
|
||||
--template=./.maintain/rialto-weight-template.hbs
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# One-liner to update between Substrate releases
|
||||
# Usage: ./update_substrate.sh 2.0.0-rc6 2.0.0
|
||||
set -xeu
|
||||
|
||||
OLD_VERSION=$1
|
||||
NEW_VERSION=$2
|
||||
|
||||
find . -type f -name 'Cargo.toml' -exec sed -i '' -e "s/$OLD_VERSION/$NEW_VERSION/g" {} \;
|
||||
Reference in New Issue
Block a user