Odak modu
Build the relay chain node
git clone --branch release-v0.9.37 https://github.com/paritytech/polkadot.git
cd polkadot cargo build --release ./target/release/polkadot --help
Relay chain specs
Every Substrate-based chain requires a chain specification. The chain specification for the relay chain network provides the same types of configuration settings that the chain specification does for other networks. Many of the settings in the chain specification file are critical for network operations. For example, the chain specification identifies peers that participate in the network, keys for validators, boot node addresses, and other information.
For this tutorial, the local relay chain uses a sample chain specification file with two validator relay chain nodes—Alice and Bob—as authorities. Because a relay chain must have at least one more validator node running than the total number of connected parachain collators, you can only use the chain specification from this tutorial for a local relay chain network with a single parachain.
If you wanted to connect two parachains with a single collator each, you would need to run three or more relay chain validator nodes. In general, you would need to modify the chain specification and hard-code additional validators to set up a local test network for two or more parachains.
You can read and edit the plain text version of chain specification file. However, the chain specification file must be converted to the SCALE-encoded raw format before you can use it to start a node. For information about converting a chain specification to use the raw format, see Customize a chain specification.
The sample chain specification is only valid for a single parachain with two validator nodes. If you add other validators, add additional parachains to your relay chain, or want to use custom account keys instead of the predefined account, you'll need to create a custom chain specification file.
If you are completing this tutorial at the same time as anyone on the same local network, then you must download and modify the Plain sample relay chain spec to prevent accidentally peering with their node
Start the relay chain node
Before you can start block production for a parachains, you need to start a relay chain for them to connect to.
For example, save the file as raw-local-chainspec.json in the /tmp directory. You'll need to specify the path to the file in the commands to start the nodes.
./target/release/polkadot \n--alice \n--validator \n--base-path /tmp/relay/alice \n--chain /tmp/raw-local-chainspec.json \n--port 30333 \n--ws-port 9944
🏷 Local node identity is: 12D3KooWGjsmVmZCM1jPtVNp6hRbbkGBK3LADYNniJAKJ19NUYiq
./target/release/polkadot \n--bob \n--validator \n--base-path /tmp/relay-bob \n--chain /tmp/raw-local-chainspec.json \n--port 30334 \n--ws-port 9945
Yazılım Kariyerinde İlerlemeni Hızlandıracak Programlar
Patika+ programlarımız ile 4-8 aylık yoğun yazılım kamplarına katıl, temel bilgilerden başlayarak kapsamlı bilgiler edin, yazılım kariyerine başla!
Yorum yapabilmek için derse kayıt olmalısın!