Magnet
  • Welcome to Magnet
  • Overview
    • Magnet Network Features
      • Magnet Coretime
      • Coretime Order Control and Assurance
      • Workflows of Magnet Network
      • Profit Calcuation and Distribution
    • Magnet Stack Features
      • Magnet Stack Coretime Modules
  • Product Guides
    • Setup a Local Node
      • Installing Substrate Dependencies
      • Launching the Local Relay Chain
      • Build the Magnet Node
      • Prepare the parachain Collator
      • Register on the Local Relay Chain
    • Deploy Contracts on Magnet Network
      • EVM Contract Deployment
      • WASM Contract Deployment
      • MoveVM Contract Deployment
    • Bridge Asset
      • Bridging Asset between EVM and Substrate
      • Bridging Asset with XCM
    • Develop Coretime-Ready chain with Magnet Stack
      • Preparation: Reserve a ParaID
      • Preparation: Generate the Collator's Address
      • Preparation: Purchase Bulk Core
      • Using Magnet Stack : Coretime Configuration
      • Using Magnet Stack : Virtual Machine Configuration
      • Using Magnet Stack : Functional Models
      • Using Magnet Stack : Summary
      • Deployment & Connection to Rocococ
        • Define the collator's address
Powered by GitBook
On this page
  1. Product Guides
  2. Setup a Local Node

Prepare the parachain Collator

Prepare the parachain collator

With the local relay chain running and the raw chain specification for the parachain template updated, you are ready to start the parachain collator node and export information about its runtime and genesis state.

  1. Export the WebAssembly runtime for the parachain. (We continue to use Magnet as an example for this session.)

The relay chain needs the parachain-specific runtime validation logic to validate parachain blocks. You can export the WebAssembly runtime for a parachain collator node by running the following command:

./target/release/parachain-magnet-node export-genesis-wasm --chain raw-magnet-2000.json magnet-2000-wasm
  1. Generate a parachain genesis state.

To register a parachain, the relay chain needs to know the genesis state of the parachain. You can export the entire genesis state—hex-encoded—to a file by running the following command:

./target/release/parachain-magnet-node export-genesis-state --chain raw-magnet-2000.json magnet-2000-state

You should note that the runtime and state you export must be for the genesis block. You can't connect a parachain with any previous state to a relay chain. All parachains must start from block 0 on the relay chain.

  1. Start the collator node:

nohup ./target/release/parachain-magnet-node --alice --collator --force-authoring --chain raw-magnet-2000.json --base-path ./alice --p
PreviousBuild the Magnet NodeNextRegister on the Local Relay Chain

Last updated 8 months ago