首页 > 解决方案 > 带有 polkadot-launch 的本地 [Polkadot + Statemine] 测试网

问题描述

我想通过polkadot-launch部署本地 Polkadot 测试网。

我从以下位置构建可执行文件:

这是config.json

{
    "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": 1,
                            "validation_upgrade_delay": 1
                        }
                    }
                }
            }
        }
    },
    "parachains": [
        {
            "bin": "./bin/polkadot-collator",
            "id": "200",
            "balance": "1000000000000000000000",
            "nodes": [
                {
                    "wsPort": 9988,
                    "port": 31200,
                    "name": "alice",
                    "flags": ["--force-authoring", "--", "--execution=wasm"]
                }
            ]
        },
        {
            "bin": "./bin/polkadot-collator",
            "id": "300",
            "balance": "1000000000000000000000",
            "nodes": [
                {
                    "wsPort": 9999,
                    "port": 31300,
                    "name": "alice",
                    "flags": ["--force-authoring", "--", "--execution=wasm"]
                }
            ]
        }
    ],
    "simpleParachains": [
        {
            "bin": "./bin/adder-collator",
            "id": "400",
            "port": "31400",
            "name": "alice",
            "balance": "1000000000000000000000"
        }
    ],
    "hrmpChannels": [
        {
            "sender": 200,
            "recipient": 300,
            "maxCapacity": 8,
            "maxMessageSize": 512
        }
    ],
    "types": {},
    "finalization": false
}

当我打电话时polkadot-launch,所有alicebob, charlie anddave 都有正常的日志:

$ tail -f alice.log 
2021-09-25 19:34:30  Starting consensus session on top of parent 0x7df9c10b7ff6ded2b2712273633582c445345541a3a5d20fab85e67c041bab5c    
2021-09-25 19:34:30  Prepared block for proposing at 8 [hash: 0x9b44a965ee76e35f4721888c53f31ebe8920224bcea359e82ff8dedb1734502b; parent_hash: 0x7df9…ab5c; extrinsics (2): [0xc67d…93c7, 0xecd4…0d35]]    
2021-09-25 19:34:30  Pre-sealed block for proposal at 8. Hash now 0xd167ba86acc9f96c1282793387bc37f09b9cd4132113e8c59027958673bd22ae, previously 0x9b44a965ee76e35f4721888c53f31ebe8920224bcea359e82ff8dedb1734502b.    
2021-09-25 19:34:30 ✨ Imported #8 (0xd167…22ae)    
2021-09-25 19:34:32  Idle (3 peers), best: #8 (0xd167…22ae), finalized #5 (0x4ab2…f178), ⬇ 1.4kiB/s ⬆ 2.2kiB/s    
2021-09-25 19:34:36  Starting consensus session on top of parent 0xd167ba86acc9f96c1282793387bc37f09b9cd4132113e8c59027958673bd22ae    
2021-09-25 19:34:36  Prepared block for proposing at 9 [hash: 0x5978b3aded771de9bdbcbe1cbb8d65f36dd0f85db791cf4faa7a43c2ad9a720e; parent_hash: 0xd167…22ae; extrinsics (2): [0xf381…4795, 0xfe0b…8a55]]    
2021-09-25 19:34:36  Pre-sealed block for proposal at 9. Hash now 0x0f3261953f7ee2bf7973d5b3b988eceaf001ab8f8c0ee770d2c47e360e597caa, previously 0x5978b3aded771de9bdbcbe1cbb8d65f36dd0f85db791cf4faa7a43c2ad9a720e.    
2021-09-25 19:34:36 ✨ Imported #9 (0x0f32…7caa)    
2021-09-25 19:34:37  Idle (3 peers), best: #9 (0x0f32…7caa), finalized #6 (0x6046…7629), ⬇ 1.5kiB/s ⬆ 2.7kiB/s    
2021-09-25 19:34:42 ✨ Imported #10 (0x7a55…a45a)    
2021-09-25 19:34:42  Idle (3 peers), best: #10 (0x7a55…a45a), finalized #7 (0x7df9…ab5c), ⬇ 1.6kiB/s ⬆ 1.6kiB/s    
2021-09-25 19:34:47  Idle (3 peers), best: #10 (0x7a55…a45a), finalized #8 (0xd167…22ae), ⬇ 3.0kiB/s ⬆ 3.4kiB/s    
2021-09-25 19:34:48  New epoch 1 launching at block 0x7602…ec7f (block slot 272101548 >= start slot 272101548).    
2021-09-25 19:34:48  Next epoch starts at slot 272101558    
2021-09-25 19:34:48 ✨ Imported #11 (0x7602…ec7f)    
2021-09-25 19:34:50  Round #9 concluded, committed: SignedCommitment { commitment: Commitment { payload: 0xf0a3fb9ad9246d2071beed4daebaf1145e4ccc2939d2a739a832cbbf51fc28ed, block_number: 9, validator_set_id: 0 }, signatures: [Some(Signature(d586df10c3502ca9f0babf7b032e409a79c2506f384ea48216a6d802435d7cd45caf1eca39d7972d01e0a019de10061c40b8f13d5e07f4c7a1865e36d0a72c3100)), None, Some(Signature(ac6edcd9d5df9ed08ddb3870ab058b2709c2e2c31aef9e758a76cc0032971f8d6063048a5fa051f5b6d0be98ef12e9d964b9c9ab371aa1a422eaef4da394773200)), Some(Signature(32635d143cb5f1f4ab1475a0cbc3565f96ae68bf55f7090c53180075fc6f11a86e547e45d6c98b1b8af70cb07e14d3f188c1186320ea9b862fcc83553d059f2101))] }.   

9988.log似乎很奇怪:

$ tail -f 9988.log 
error: The argument '--force-authoring' was provided more than once, but cannot be used multiple times

USAGE:
    polkadot-collator --alice --collator --offchain-worker <ENABLED> --force-authoring --in-peers <COUNT> --max-parallel-downloads <COUNT> --node-key-type <TYPE> --out-peers <COUNT> --parachain-id <parachain-id> --pool-kbytes <COUNT> --pool-limit <COUNT> --port <PORT> --rpc-methods <METHOD SET> --state-cache-size <Bytes> --sync <SYNC_MODE> --tmp --tracing-receiver <RECEIVER> --wasm-execution <METHOD> --ws-port <PORT>

For more information try --help

所以我想我只是在运行一个中继链?Cumulus/Statemine 链的200整理300者已经死了?

我的设置有什么问题?

标签: substratepolkadot

解决方案


Polkadot 启动现在默认移交该参数(因为几乎总是需要它)。所以只需删除"--force-authoring",它就可以了。


推荐阅读