Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to polkadot-v1.1.0 #34

Merged
merged 7 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,438 changes: 2,129 additions & 1,309 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cargo build --release
```

### 🕸️ Run a local network
You will need a compatible release of [Polkadot](https://github.com/paritytech/polkadot) to run a local network. You may also want to use [Zombienet](https://github.com/paritytech/zombienet/releases) (available for Linux and MacOS), for spinning up a full fledged relay chain - parachain environment. You can find more information about running a local test network [HERE](./docs/zombienet.md)
You will need a compatible release of [Polkadot](https://github.com/paritytech/polkadot-sdk) to run a local network. You may also want to use [Zombienet](https://github.com/paritytech/zombienet/releases) (available for Linux and MacOS), for spinning up a full fledged relay chain - parachain environment. You can find more information about running a local test network [HERE](./docs/zombienet.md)



Expand Down
18 changes: 15 additions & 3 deletions docs/rust-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ brew update
brew install openssl cmake llvm
```

- ### Install the `wasm` target and the `nightly` toolchain for rust
You may also be required to install a `protobuf` compiler:

```sh
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
# Ubuntu
sudo apt install -y protobuf-compiler

# Arch
pacman -Syu --needed --noconfirm protobuf

# Mac Os
brew install protobuf
```

- ### Install the `wasm` target for your rust toolchain

```sh
rustup target add wasm32-unknown-unknown
```
18 changes: 10 additions & 8 deletions docs/zombienet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@
You can download executables of the Zombienet CLI from [paritytech/zombienet/releases](https://github.com/paritytech/zombienet/releases)


- Download the Zombienet CLI according to your operating system.
- Download the latest Zombienet CLI according to your operating system.

💡 Tip: If you want the executable to be available system-wide then make sure you place it in one of your `$PATH` directories.
```sh
wget https://github.com/paritytech/zombienet/releases/download/v1.3.30/zombienet-macos
wget https://github.com/paritytech/zombienet/releases/download/v1.3.71/zombienet-macos
chmod +x zombienet-macos
cp zombienet-macos /usr/local/bin
```
Then invoke it anywhere like :
```sh
# Mac Os
zombienet-macos --help
```
Otherwise you can just place it in your working directory.

```sh
./zombienet-macos --help
```sh
# Linux
zombienet-linux-x64 --help
```
You should see some similar output:

You should see some similar output to indicate it's installed and working properly:
```sh
Usage: zombienet [options] [command]

Expand All @@ -41,9 +43,9 @@ Commands:

## Setting up Zombienet config:

You may use a reference implementation from the folder `zombienet-config` or make your own. We provide a simple configuration for you called [zombienet-config.toml](../zombienet-config.toml) which spins up two validators for the relay chain, and one collator for your parachain to get you quickly upto speed.
You may use the provided reference implementation from the repository or make your own. We provide a simple configuration for you [zombienet-config.toml](../zombienet-config.toml) which spins up two validators for the relay chain, and one collator for your parachain to get you quickly upto speed.

⚠️ Take note: the path of the polkadot executable used there is `../bin/polkadot` which means you need to have a folder called `bin` outside the repository directory which contains your compiled polkadot binary which must be named as `polkadot`. Also please take care to compile the correct version of `polkadot` when testing out on your machine. You can do so by cloning `polkadot` and then checking out the appropriate branch that corresponds to the substrate/cumulus version used to build the template.
⚠️ Note: The path of the polkadot executable used there is `./bin/polkadot` which means you need to have a folder called `bin` inside the repository directory which contains your compiled polkadot binary named as `polkadot`. In addition to that since version 1.1.0, you will also need to place the `polkadot-execute-worker` and the `polkadot-prepare-worker` binaries to be inside `bin`. As a user you don't need to interact with these but these are required to start up the main relay chain `polkadot` software. You can find all three [here](https://github.com/paritytech/polkadot-sdk/releases)



Expand Down
121 changes: 63 additions & 58 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,72 +23,77 @@ serde = {version = "1.0.186", features = ["derive"]}
frontier-parachain-runtime = {path = "../runtime"}

# Substrate
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network-common = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network-sync = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", features = ["default"]}
sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
try-runtime-cli = {git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v1.0.0"}
frame-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-basic-authorship = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-chain-spec = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-client-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-consensus = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-executor = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network-common = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network-sync = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-offchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-rpc = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", features = ["default"]}
sc-sysinfo = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-telemetry = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-tracing = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-transaction-pool = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-block-builder = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-blockchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-io = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-inherents = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-keystore = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-offchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-session = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-timestamp = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-transaction-pool = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
try-runtime-cli = {git = "https://github.com/paritytech/polkadot-sdk", optional = true, branch = "release-polkadot-v1.1.0"}

# Polkadot
polkadot-cli = {git = "https://github.com/paritytech/polkadot", features = ["rococo-native"], branch = "release-v1.0.0"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0"}
xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v1.0.0"}
polkadot-cli = {git = "https://github.com/paritytech/polkadot-sdk", features = ["rococo-native"], branch = "release-polkadot-v1.1.0"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
polkadot-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0"}

# Cumulus
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-network = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-collator = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-proposer = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-network = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-primitives-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}

# Frontier
fc-cli = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-consensus = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-db = {git = "https://github.com/paritytech/frontier", features = ["default", "sql"], branch = "polkadot-v1.0.0"}
fc-mapping-sync = {git = "https://github.com/paritytech/frontier", features = ["sql"], branch = "polkadot-v1.0.0"}
fc-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0", features = ["rpc-binary-search-estimate", "txpool"]}
fc-rpc-core = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-storage = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-dynamic-fee = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-evm = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-api = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-cli = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-consensus = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-db = {git = "https://github.com/paritytech/frontier", features = ["default", "sql"], branch = "polkadot-v1.1.0"}
fc-mapping-sync = {git = "https://github.com/paritytech/frontier", features = ["sql"], branch = "polkadot-v1.1.0"}
fc-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0", features = ["rpc-binary-search-estimate", "txpool"]}
fc-rpc-core = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-storage = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-dynamic-fee = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-evm = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}

[build-dependencies]
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-build-script-utils = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}

[features]
default = []
Expand Down
17 changes: 8 additions & 9 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cumulus_primitives_core::ParaId;
use fc_db::kv::frontier_database_dir;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use frontier_parachain_runtime::Block;
use log::{info, warn};
use log::info;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
Expand Down Expand Up @@ -322,11 +322,12 @@ pub fn run() -> Result<()> {
let collator_options = cli.run.collator_options();

runner.run_node_until_exit(|config| async move {
let hwbench = (!cli.no_hardware_benchmarks).then_some(
config.database.path().map(|database_path| {
let hwbench = (!cli.no_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
})).flatten();
}))
.flatten();

let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
.map(|e| e.para_id)
Expand All @@ -340,7 +341,9 @@ pub fn run() -> Result<()> {
let id = ParaId::from(para_id);

let parachain_account =
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(&id);
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(
&id,
);

let block: frontier_parachain_runtime::opaque::Block =
generate_genesis_block(&*config.chain_spec, sp_runtime::StateVersion::V1)
Expand All @@ -357,10 +360,6 @@ pub fn run() -> Result<()> {
info!("Parachain genesis state: {}", genesis_state);
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });

if !collator_options.relay_chain_rpc_urls.is_empty() && !cli.relay_chain_args.is_empty() {
warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

crate::service::start_parachain_node(
config,
polkadot_config,
Expand Down
Loading
Loading