mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
fe08221479
* Introduce `wasm-builder` and `wasm-builder-runner` to retire `build.sh` Make use of `wasm-builder` in `test-runtime`. * Add build script and remove the wasm project * Port `node-runtime` to new wasm-builder * Make `substrate-executor` tests work with `wasm-builder` * Move `node-template` to `wasm-builder` * Remove `build.sh` :) * Remove the last include_bytes * Adds the missing build.rs files * Remove `build.sh` from CI * Debug CI * Make it work in CI * CI attempt 3 * Make `substrate-runtime-test` compile on stable * Ahhh, some missed `include_bytes!` * AHH * Add suggestions * Improve search for `Cargo.lock` and don't panic if it is not found * Searching from manifest path was no good idea * Make the `wasm-builder` source better configurable * Expose the bloaty wasm binary as well * Make sure to rerun WASM recompilation on changes in dependencies * Introduce new `WASM_BUILD_TYPE` env and make sure to call `build.rs` on changes to env variables * Remove `build.sh` from READMEs * Rename the projects * Fixes CI * Update lock file * Fixes merge-conflict * Apply suggestions from code review Co-Authored-By: TriplEight <denis.pisarev@parity.io> * Try to make windows happy * Replace all back slashes in paths with slashes * Apply suggestions from code review Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> * Use cargo from `CARGO` env variable * Fix compilation * Use `rustup` for running the nightly build * Make individual projects skipable * Fix compilation * Fixes compilation * Build all WASM projects in one workspace * Replace more back slashes! * Remove `inlcude_bytes!` * Adds some documentation * Apply suggestions from code review Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Apply suggestions from code review Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * More review comments * Update `Cargo.lock` * Set license * Apply suggestions from code review Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * More review comments + adds `TRIGGER_WASM_BUILD` env * Fix doc tests * Increase version + update README * Switch crates.io version of `wasm-builder` * Update README * Switch to released version of `wasm-builder-runner`
63 lines
2.0 KiB
Markdown
63 lines
2.0 KiB
Markdown
# Template Node
|
|
|
|
A new SRML-based Substrate node, ready for hacking.
|
|
|
|
# Building
|
|
|
|
Install Rust:
|
|
|
|
```bash
|
|
curl https://sh.rustup.rs -sSf | sh
|
|
```
|
|
|
|
Install required tools:
|
|
|
|
```bash
|
|
./scripts/init.sh
|
|
```
|
|
|
|
Build all native code:
|
|
|
|
```bash
|
|
cargo build
|
|
```
|
|
|
|
# Run
|
|
|
|
You can start a development chain with:
|
|
|
|
```bash
|
|
cargo run -- --dev
|
|
```
|
|
|
|
Detailed logs may be shown by running the node with the following environment variables set: `RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev`.
|
|
|
|
If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with testnet units. Give each node a name and expose them so they are listed on the Polkadot [telemetry site](https://telemetry.polkadot.io/#/Local%20Testnet). You'll need two terminal windows open.
|
|
|
|
We'll start Alice's substrate node first on default TCP port 30333 with her chain database stored locally at `/tmp/alice`. The bootnode ID of her node is `QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR`, which is generated from the `--node-key` value that we specify below:
|
|
|
|
```bash
|
|
cargo run -- \
|
|
--base-path /tmp/alice \
|
|
--chain=local \
|
|
--alice \
|
|
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
|
|
--telemetry-url ws://telemetry.polkadot.io:1024 \
|
|
--validator
|
|
```
|
|
|
|
In the second terminal, we'll start Bob's substrate node on a different TCP port of 30334, and with his chain database stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect his node to Alice's bootnode ID on TCP port 30333:
|
|
|
|
```bash
|
|
cargo run -- \
|
|
--base-path /tmp/bob \
|
|
--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR \
|
|
--chain=local \
|
|
--bob \
|
|
--port 30334 \
|
|
--telemetry-url ws://telemetry.polkadot.io:1024 \
|
|
--validator
|
|
```
|
|
|
|
Additional CLI usage options are available and may be shown by running `cargo run -- --help`.
|