5

I tested rococo parachains launched thanks polkadot-launch. However I don't see any blocks created from the parachain so I'm wondering if this is normal and if I need to do extra steps to see blocks creation on the parachain.

Version double checks :

  • I'm using parity polkadot node version : 0.9.17-de0ecd4760-x86_64-linux-gnu
  • I'm using cumulus polkadot-collator node version : 5.2.0-76479e7f-x86_64-linux-gnu (the 76479e7f is the commit id for cumulus tag polkadot-v0.9.17)

Polkadot-launch input configuration :

{
    "relaychain": {
        "bin": "./bin/polkadot",
        "chain": "rococo-local",
        "nodes": [
            {
                "name": "alice",
                "wsPort": 9944,
                "port": 30444
            },
            {
                "name": "bob",
                "wsPort": 9955,
                "port": 30555
            },
            {
                "name": "charlie",
                "wsPort": 9966,
                "port": 30666
            },
            {
                "name": "dave",
                "wsPort": 9977,
                "port": 30777
            }
        ],
        "genesis": {
            "runtime": {
                "runtime_genesis_config": {
                    "configuration": {
                        "config": {
                            "validation_upgrade_frequency": 10,
                            "validation_upgrade_delay": 10
                        }
                    }
                }
            }
        }
    },
    "parachains": [
        {
            "bin": "./bin/polkadot-collator",
            "id": "200",
            "balance": "1000000000000000000000",
            "nodes": [
                {
                    "wsPort": 9988,
                    "port": 31200,
                    "name": "alice",
                    "flags": ["--", "--execution=wasm"]
                }
            ]
        },
        {
            "bin": "./bin/polkadot-collator",
            "id": "300",
            "balance": "1000000000000000000000",
            "nodes": [
                {
                    "wsPort": 9999,
                    "port": 31300,
                    "name": "alice",
                    "flags": ["--", "--execution=wasm"]
                }
            ]
        }
    ],
    "hrmpChannels": [
        {
            "sender": 200,
            "recipient": 300,
            "maxCapacity": 8,
            "maxMessageSize": 512
        }
    ],
    "types": {},
    "finalization": false
}

First log analyses :

The first collator node connect to the parachain and synchronize its first relay chain with blocks 31 on epoch 3 :

2022-03-14 00:13:05 [Relaychain] 👴 Applying authority set change scheduled at block #31
2022-03-14 00:13:05 [Relaychain] 👴 Applying GRANDPA set change to new set [(Public(88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee (5FA9nQDV...)), 1), (Public(d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69 (5GoNkf6W...)), 1), (P
ublic(439660b36c6c03afafca027b910b4fecf99801834c62a5e6006f27d978de234f (5DbKjhNL...)), 1), (Public(5e639b43e0052c47447dac87d6fd2b6ec50bdd4d0f614e4299c665249bbd09d9 (5ECTwv6c...)), 1)]
...
2022-03-14 00:13:48 [Relaychain] 👶 New epoch 4 launching at block 0x1f0c…efdd (block slot 274536138 >= start slot 274536138).

However I never see [Parachain] Starting collation. in my logs. I waited till block 152 and epoch 15 with no success...

2022-03-14 00:24:48 [Relaychain] 👶 New epoch 15 launching at block 0x0898…5404 (block slot 274536248 >= start slot 274536248).
2022-03-14 00:24:48 [Relaychain] 👶 Next epoch starts at slot 274536258
2022-03-14 00:24:48 [Relaychain] ✨ Imported #151 (0x0898…5404)
2022-03-14 00:24:48 [Relaychain] Advanced session window for approvals update=Advanced { prev_window_start: 9, prev_window_end: 14, new_window_start: 10, new_window_end: 15 }
2022-03-14 00:24:51 [Relaychain] 💤 Idle (5 peers), best: #151 (0x0898…5404), finalized #148 (0x8570…2a6e), ⬇ 4.2kiB/s ⬆ 2.9kiB/s
2022-03-14 00:24:51 [Parachain] 💤 Idle (1 peers), best: #0 (0x0a8a…28c5), finalized #0 (0x0a8a…28c5), ⬇ 49 B/s ⬆ 49 B/s
2022-03-14 00:24:54 [Relaychain] ✨ Imported #152 (0xce66…efb4)

The block count on the parachain remains to 0 :(. Is there something I missed ?

Thank you for your coming help :)

2 Answers 2

2

Obtain the "raw" chain definition that you originally used to launch polkadot-launch after copying the latest binary of your parachain to the polkadot-launch bin/ directory. Ensure you are using substrate-parachain-template branch 'polkadot-v0.9.17'.

In substrate-parachain-template chain_spec.rs, change the parachain id values from 1000 to 2000 (i.e. find/replace "1000.into()," with "2000.into(),", find/replace "para_id: 1000," with "para_id: 2000,"). Also change "" | "local" to "" | "local" | "rococo-local"

./polkadot-launch/bin/parachain-collator build-spec --chain "rococo-local" --disable-default-bootnode > rococo-local-parachain-2000-plain.json
./polkadot-launch/bin/parachain-collator build-spec --chain rococo-local-parachain-2000-plain.json --raw --disable-default-bootnode > rococo-local-parachain-2000-raw.json
cp rococo-local-parachain-2000-raw.json ../

Obtain Alice's secret seed 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a by running the following

subkey inspect //Alice

Add the KeySubcommand to the CLI of your substrate-parachain-template so you can run parachain-collator key insert in the next step, as shown in this example.

Insert Alice's session key

./polkadot-launch/bin/parachain-collator key insert \
--base-path /tmp/parachain/alice \
--chain ./polkadot-launch/rococo-local-parachain-2000-raw.json \
--scheme Sr25519 \
--suri 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a \
--key-type aura

Restart polkadot-launch.

Add another collator node manually. Use an existing bootnode below that you obtain from the logs when you run polkadot-launch. Use the correct Rococo relay chain "raw" chain definition for rococo-local-raw.json below for Polkadot branch 'v0.9.17' and the correct ports.

./polkadot-launch/bin/parachain-collator \
    --collator \
    --alice \
    --chain ./polkadot-launch/rococo-local-parachain-2000-raw.json \
    --base-path /tmp/parachain/alice \
    --bootnodes /ip4/127.0.0.1/tcp/30336/p2p/<INSERT_BOOTNODE_ID> \
    --name "DataHighway-Collator-Alice" \
    --force-authoring \
    --port 31400 \
    --rpc-port 9933 \
    --ws-port 9977 \
    --unsafe-ws-external \
    --unsafe-rpc-external \
    --rpc-cors=all \
    --rpc-methods=Unsafe \
    -- \
    --execution wasm \
    --chain ./polkadot-launch/rococo-local-raw.json \
    --port 30444 \
    --rpc-port 9944 \
    --ws-port 9955

Check that the parachain generates and finalizes blocks.

5
  • Hello Luke, the polkadot-launch README tells to use polkadot and cumulus project and compile polkadot and parachain-collator from there. Currently I have : cumulus$ git branch * (HEAD detached at polkadot-v0.9.17) polkadot$ git branch * (HEAD detached at v0.9.17) Should replace cumulus with substrate-parachain-template ? Mar 14, 2022 at 15:42
  • Hello Luke, ./bin/parachain-collator build-spec --chain "rococo-local" --disable-default-bootnode > rococo-local-parachain-2000-plain.json raise following error Error: Input("Error opening spec file rococo-local: No such file or directory (os error 2)") we need to run ./bin/parachain-collator build-spec --disable-default-bootnode > rococo-local-parachain-2000-plain.json Also, you currently named the parachain output file rococo-local-parachain-2000-plain.json. Should we not change paraID inside it from 1000 to 2000 ? Mar 15, 2022 at 15:06
  • @MathildeFfrench yes that's correct, that's what i do in this tutorial github.com/DataHighway-DHX/documentation/blob/master/docs/…. the default paraID in the substrate-parachain-template is 1000, but i changed it to 2000. i've updated the answer to mention this. Mar 16, 2022 at 6:48
  • Hello @Luke, I did test on your solution but now I'm lock on issue discribed here : github.com/paritytech/cumulus/issues/549 ... Currently testing 0.9.7.... I will wait a little to get env fully working and fix all potential issues till I see my parachain producing blocks to provide feedback on your first answer and then validate it... Mar 16, 2022 at 20:30
  • Using polkadot-launch, I usually only need to wait until the logs show i've synchronised about 15 blocks from the Rococo relay chain before my parachain starts generating and finalizing blocks Mar 17, 2022 at 6:35
1

Are you customizing your RunCommand struct in cli.rs? I've faced this issue where blocked are not being finalized while customizing the RunCommand struct. (In my case, I was not providing the correct path of sc_cli::RunCommand in my runner).

If yes, then you need to provide the correct path of the sc_cli::RunCommand where you are creating the runner in the command.rs.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.