mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
# use-nodes
|
||||||
|
|
||||||
|
This action downloads the substrate and polkadot binaries produced from the `build-nodes` workflow and puts them into the `$PATH`.
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: Use substrate and polkadot binaries
|
||||||
|
description: Downloads and configures the substrate and polkadot binaries built with `build-nodes`
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Download substrate-node binary
|
||||||
|
id: download-substrate-binary
|
||||||
|
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
|
||||||
|
with:
|
||||||
|
workflow: build-nodes.yml
|
||||||
|
name: nightly-substrate-binary
|
||||||
|
|
||||||
|
- name: Download polkadot binary
|
||||||
|
id: download-polkadot-binary
|
||||||
|
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
|
||||||
|
with:
|
||||||
|
workflow: build-nodes.yml
|
||||||
|
name: nightly-polkadot-binary
|
||||||
|
|
||||||
|
- name: Prepare binaries
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
chmod u+x ./substrate-node
|
||||||
|
chmod u+x ./polkadot
|
||||||
|
chmod u+x ./polkadot-execute-worker
|
||||||
|
chmod u+x ./polkadot-prepare-worker
|
||||||
|
./substrate-node --version
|
||||||
|
./polkadot --version
|
||||||
|
mkdir -p ~/.local/bin
|
||||||
|
cp ./substrate-node ~/.local/bin
|
||||||
|
cp ./polkadot ~/.local/bin
|
||||||
|
cp ./polkadot-execute-worker ~/.local/bin
|
||||||
|
cp ./polkadot-prepare-worker ~/.local/bin
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# use-substrate
|
|
||||||
|
|
||||||
This action downloads the substrate binary produced from the `build-substrate` workflow and puts it into the `$PATH`.
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
name: Use substrate binary
|
|
||||||
description: Downloads and configures the substrate binary built with build-substrate
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Download substrate-node binary
|
|
||||||
id: download-artifact
|
|
||||||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
|
|
||||||
with:
|
|
||||||
workflow: build-substrate.yml
|
|
||||||
name: nightly-substrate-binary
|
|
||||||
|
|
||||||
- name: Prepare substrate-node binary
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
chmod u+x ./substrate-node
|
|
||||||
./substrate-node --version
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
cp ./substrate-node ~/.local/bin
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Build Substrate Binary
|
name: Build Substrate and Polkadot Binaries
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Allow it to be manually ran to rebuild binary when needed:
|
# Allow it to be manually ran to rebuild binary when needed:
|
||||||
@@ -9,7 +9,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
name: Build Substrate
|
name: Build Substrate and Polkadot Binaries
|
||||||
runs-on: ubuntu-latest-16-cores
|
runs-on: ubuntu-latest-16-cores
|
||||||
steps:
|
steps:
|
||||||
- name: checkout polkadot-sdk
|
- name: checkout polkadot-sdk
|
||||||
@@ -42,3 +42,20 @@ jobs:
|
|||||||
path: target/release/substrate-node
|
path: target/release/substrate-node
|
||||||
retention-days: 2
|
retention-days: 2
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: build polkadot binary
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release --manifest-path polkadot/Cargo.toml
|
||||||
|
|
||||||
|
- name: upload polkadot binary
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nightly-polkadot-binary
|
||||||
|
path: |
|
||||||
|
target/release/polkadot
|
||||||
|
target/release/polkadot-execute-worker
|
||||||
|
target/release/polkadot-prepare-worker
|
||||||
|
retention-days: 2
|
||||||
|
if-no-files-found: error
|
||||||
@@ -16,8 +16,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|||||||
+18
-18
@@ -56,8 +56,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -88,8 +88,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -120,8 +120,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -151,8 +151,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -240,8 +240,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -274,8 +274,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -308,8 +308,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -342,8 +342,8 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -388,8 +388,8 @@ jobs:
|
|||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
|
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
|
||||||
|
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Run subxt WASM tests
|
- name: Run subxt WASM tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# We run this (up-to-date) node locally to fetch metadata from it for the artifacts
|
# We run this (up-to-date) node locally to fetch metadata from it for the artifacts
|
||||||
- name: Use substrate-node binary
|
- name: Use substrate and polkadot node binaries
|
||||||
uses: ./.github/workflows/actions/use-substrate
|
uses: ./.github/workflows/actions/use-nodes
|
||||||
|
|
||||||
- name: Install Rust stable toolchain
|
- name: Install Rust stable toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@ use substrate_runner::SubstrateNode;
|
|||||||
/// Run with `cargo run --bin artifacts` from the root of the repository.
|
/// Run with `cargo run --bin artifacts` from the root of the repository.
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut node_builder = SubstrateNode::builder();
|
let mut node_builder = SubstrateNode::builder();
|
||||||
node_builder.binary_paths(["substrate-node", "substrate"]);
|
node_builder.polkadot();
|
||||||
|
|
||||||
// Spawn the node and retrieve a ws URL to it:
|
// Spawn the node and retrieve a ws URL to it:
|
||||||
let proc = node_builder
|
let proc = node_builder
|
||||||
@@ -37,13 +37,13 @@ fn main() {
|
|||||||
|
|
||||||
// Generate a metadata file that only contains a few pallets that we need for our examples.
|
// Generate a metadata file that only contains a few pallets that we need for our examples.
|
||||||
run_cmd(
|
run_cmd(
|
||||||
r#"cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets "Balances,Staking,System,Multisig,Timestamp,ParaInherent""#,
|
"cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets Balances,Staking,System,Multisig,Timestamp,ParaInherent",
|
||||||
Some("artifacts/polkadot_metadata_small.scale"),
|
Some("artifacts/polkadot_metadata_small.scale"),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Generate a metadata file that contains no pallets
|
// Generate a metadata file that contains no pallets
|
||||||
run_cmd(
|
run_cmd(
|
||||||
r#"cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets """#,
|
"cargo run --bin subxt metadata --file artifacts/polkadot_metadata_full.scale --pallets \"\"",
|
||||||
Some("artifacts/polkadot_metadata_tiny.scale"),
|
Some("artifacts/polkadot_metadata_tiny.scale"),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -21,7 +21,7 @@ pub struct SubstrateNodeBuilder {
|
|||||||
|
|
||||||
impl Default for SubstrateNodeBuilder {
|
impl Default for SubstrateNodeBuilder {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
SubstrateNodeBuilder::new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,11 +29,23 @@ impl SubstrateNodeBuilder {
|
|||||||
/// Configure a new Substrate node.
|
/// Configure a new Substrate node.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
SubstrateNodeBuilder {
|
SubstrateNodeBuilder {
|
||||||
binary_paths: vec!["substrate-node".into(), "substrate".into()],
|
binary_paths: vec![],
|
||||||
custom_flags: Default::default(),
|
custom_flags: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Provide "substrate-node" and "substrate" as binary paths
|
||||||
|
pub fn substrate(&mut self) -> &mut Self {
|
||||||
|
self.binary_paths = vec!["substrate-node".into(), "substrate".into()];
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Provide "polkadot" as binary path.
|
||||||
|
pub fn polkadot(&mut self) -> &mut Self {
|
||||||
|
self.binary_paths = vec!["polkadot".into()];
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Set the path to the `substrate` binary; defaults to "substrate-node"
|
/// Set the path to the `substrate` binary; defaults to "substrate-node"
|
||||||
/// or "substrate".
|
/// or "substrate".
|
||||||
pub fn binary_paths<Paths, S>(&mut self, paths: Paths) -> &mut Self
|
pub fn binary_paths<Paths, S>(&mut self, paths: Paths) -> &mut Self
|
||||||
|
|||||||
Reference in New Issue
Block a user