pop-chains
A crate for generating, building and running chains and pallets. Used by
pop-cli.
Usage
Generate a new chain:
use ;
use Path;
let destination_path = new;
let tag_version = None; // Latest
let config = Config ;
let tag = instantiate_template_dir;
Build a chain:
use Profile;
use ChainSpecBuilder;
use Path;
let path = new;
let builder = Node ;
let binary_path = builder.build.unwrap;
Build a chain with runtime-benchmarks feature:
let binary_path = builder.build.unwrap;
Generate a plain chain specification file and customize it with your specific chain values:
use Profile;
use ;
use Path;
let path = new; // Location of the parachain project.
let builder = Node ;
let spec_name = "MySpec";
let spec_id = "my_spec";
// Build the node binary first
builder.build.unwrap;
// Generate a plain chain specification file of a parachain
let plain_chain_spec_path = path.join;
builder.generate_plain_chain_spec.unwrap;
// Customize your chain specification
let mut chain_spec = from.unwrap;
chain_spec.replace_para_id;
chain_spec.replace_relay_chain;
chain_spec.replace_chain_type;
chain_spec.replace_protocol_id;
// Writes the chain specification to a file
chain_spec.to_file.unwrap;
Generate a raw chain specification file and export the WASM and genesis state files:
use Profile;
use ;
use Path;
let path = new; // Location of the parachain project.
let builder = Node ;
let spec_name = "MySpec";
let spec_id = "my_spec";
// Build the node binary first
let binary_path = builder.build.unwrap;
// Generate a plain chain specification file of a parachain
let plain_chain_spec_path = path.join;
builder.generate_plain_chain_spec.unwrap;
// Generate a raw chain specification file of a parachain
let chain_spec = builder.generate_raw_chain_spec.unwrap;
// Export the WebAssembly runtime for the parachain.
let wasm_file = builder.export_wasm_file.unwrap;
// Generate the parachain genesis state.
let genesis_state_file = generate_genesis_state_file_with_node.unwrap;
Run a chain:
use Zombienet;
use Path;
use tokio_test;
block_on
Generate a new Pallet:
use ;
use PathBuf;
let path = "./";
let pallet_config = TemplatePalletConfig ;
create_pallet_template;
Acknowledgements
pop-chains would not be possible without the awesome
crate: zombienet-sdk.