@parity/ppn 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/ports.env +7 -11
- package/dist/commands/bite.js +1 -1
- package/dist/commands/bite.js.map +1 -1
- package/dist/commands/fork.js +1 -1
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/service.d.ts +13 -0
- package/dist/commands/service.js +76 -54
- package/dist/commands/service.js.map +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/fork/overrides.js +5 -7
- package/dist/fork/overrides.js.map +1 -1
- package/dist/fork/shared-relay.d.ts +9 -8
- package/dist/fork/shared-relay.js +12 -10
- package/dist/fork/shared-relay.js.map +1 -1
- package/dist/fork/topology.d.ts +11 -6
- package/dist/fork/topology.js +20 -15
- package/dist/fork/topology.js.map +1 -1
- package/dist/fork/validators.d.ts +0 -2
- package/dist/fork/validators.js +4 -6
- package/dist/fork/validators.js.map +1 -1
- package/dist/lib/spawn-env.js +0 -1
- package/dist/lib/spawn-env.js.map +1 -1
- package/networks/README.md +4 -2
- package/networks/devnet.json +2 -0
- package/networks/kusama.json +1 -0
- package/networks/paseo-next-v2.json +2 -0
- package/networks/polkadot.json +2 -0
- package/networks/previewnet.json +3 -1
- package/networks/westend.json +2 -0
- package/package.json +2 -2
- package/scripts/lib/safe-rpc.sh +27 -0
- package/scripts/lib/workspace.sh +4 -0
- package/scripts/omni-node.sh +5 -6
- package/scripts/polkadot.sh +10 -0
- package/zombienet-configs/local-dev.toml +19 -5
package/networks/README.md
CHANGED
|
@@ -39,7 +39,8 @@ or `PPN_NETWORK=<name>` in the environment of the scripts.
|
|
|
39
39
|
| *(para ids)* | `parachains[].paraId` is the single source: the genesis TOML, the fork TOML, `ppn generate` and `assign-cores.sh` all read it from here. `config/ports.env` deliberately holds no para ids — those belong to the network, not the machine. |
|
|
40
40
|
| `relay.extraArgs`, `parachains[].extraArgs` | Extra node flags for that chain. A flag the shared per-key table also sets takes this value (`--rpc-max-connections=5000` replaces the table's 500), and a `-l` arg replaces the default log targets whole; the rest are appended. |
|
|
41
41
|
| `parachains[].rpcNodes`, `parachains[].rpcNodeArgs` | Non-authoring full nodes (0..9) that serve the chain's public path instead of the collator, on the chain's port + 1, + 2, …, with nginx balancing across them. They run the collator's flags without the authoring ones, with `rpcNodeArgs` over them. |
|
|
42
|
-
| *(network overlay)* | `PPN_NETWORK_OVERLAY=<file>` changes `extraArgs`, `rpcNodes`, `rpcNodeArgs` and `
|
|
42
|
+
| *(network overlay)* | `PPN_NETWORK_OVERLAY=<file>` changes `extraArgs`, `rpcNodes`, `rpcNodeArgs`, `turnProofProducts` and `safeRpc` for one deployment without a release: `{ "previewnet": { "safeRpc": true, "relay": { "extraArgs": [...] }, "parachains": { "people": { "rpcNodes": 2, "rpcNodeArgs": [...] } } } }`. Every command applies it, so the zombienet config, nginx routes and dashboard agree. An unknown network, chain or field is an error. |
|
|
43
|
+
| `safeRpc` *(overlay only)* | `true` makes every node listen for RPC and Prometheus on localhost only and serve only safe RPC methods, for a host whose nginx publishes the chains. The relay then starts through `scripts/polkadot.sh` and the collators through `scripts/omni-node.sh`, which rewrite the arguments zombienet and the engine pass every node (`scripts/lib/safe-rpc.sh`). Off by default, for local development. |
|
|
43
44
|
| `services` | Per-service switches and binaries: `false` disables a service; `{ "binary": { … } }` says what it runs. `eth-rpc` must match the revive pallet in the network's Asset Hub runtime, which is exactly why it is pinned per network rather than shared. |
|
|
44
45
|
| `turnProofProducts` | The dotNS products, under the network's TLD, whose personhood proofs buy TURN credentials at DUB's `/api/v1/turn/issue-with-proof`, such as `["dim2.testnet"]`. Absent leaves the route off. A deployment replaces it in `PPN_NETWORK_OVERLAY` (see `docs/TURN.md`). |
|
|
45
46
|
| `tools` | Local tools this network needs that are neither a chain nor a service — previewnet's `chain-spec-builder`, for instance, which only a genesis network uses. |
|
|
@@ -50,9 +51,10 @@ or `PPN_NETWORK=<name>` in the environment of the scripts.
|
|
|
50
51
|
| `relay.rpc`, `parachains[].rpc` | RPC endpoint: an absolute `ws(s)://`/`http(s)://` URL, or a path resolved against `bite.source`. |
|
|
51
52
|
| `rpcAlternates` | Informational: other public providers for the same chain, for when the primary is re-homed. Not consumed by tooling (yet). |
|
|
52
53
|
| `relay.specSource`, `parachains[].specSource` | Explicit location of the chain spec the bite warp-syncs from (it must carry the live network's bootnodes): an absolute URL, a path resolved against `bite.source` (previewnet uses `chainspecs/<spec>-local.json`, so biting a different instance follows the base-URL override), or `"builtin"` (generated with `build-spec --chain <relay.chain> --raw`, relay only). |
|
|
53
|
-
| `relay.validators` | Number of dev-key validators the fork runs with (max 6: alice…ferdie). |
|
|
54
|
+
| `relay.validators` | Number of dev-key validators the fork runs with (max 6: alice…ferdie). A bite that lays the cores out (a shared relay, or `--cores`) and a genesis spawn run one per core where that is more: the keyring's `one` and `two`, then `Validator-9`…, with keys derived from those names. The parachains' total `cores` can be at most 10. |
|
|
54
55
|
| `parachains[].key` | One of `asset-hub`, `people`, `bulletin`, `web3-storage` — the keys PPN's port table and per-chain flags are defined for. |
|
|
55
56
|
| `parachains[].paraId` | The network's real para id. Previewnet/paseo-next-v2 use the 1500 band; devnet and real networks the 1000 band. |
|
|
57
|
+
| `parachains[].cores` | Relay cores the chain runs on, 1 when absent. More than one is elastic scaling, and shortens block time only when the runtime is built for that many blocks per relay block (Asset Hub and People: 3, so 2-second blocks). Genesis adds the extra cores and `assign-cores` hands them out. A fork of a shared relay lays its parachains out with these counts and `--cores` overrides them; a previewnet fork keeps the layout it bit. |
|
|
56
58
|
| `parachains[].spec` | Basename of the parachain spec inside the bundle. |
|
|
57
59
|
| `services` | Optional `{ "<process>": false }` map to disable custom processes that would otherwise run for the present parachains (e.g. eth-rpc for asset-hub, ipfs for bulletin). |
|
|
58
60
|
| `dotns.resolver` | DotnsContentResolver address for `pin-bulletin-products` — per network, since every DotNS deployment has its own. Omitted → read from `bin/dotns-addresses.json` (previewnet's release artifact); still absent → the import is skipped. |
|
package/networks/devnet.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
{
|
|
41
41
|
"key": "asset-hub",
|
|
42
42
|
"paraId": 1000,
|
|
43
|
+
"cores": 3,
|
|
43
44
|
"spec": "asset-hub",
|
|
44
45
|
"rpc": "wss://asset-hub-paseo-rpc.n.dwellir.com",
|
|
45
46
|
"rpcAlternates": [
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
{
|
|
56
57
|
"key": "people",
|
|
57
58
|
"paraId": 1004,
|
|
59
|
+
"cores": 3,
|
|
58
60
|
"spec": "people",
|
|
59
61
|
"rpc": "wss://people-paseo.rotko.net",
|
|
60
62
|
"rpcAlternates": [
|
package/networks/kusama.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
{
|
|
40
40
|
"key": "asset-hub",
|
|
41
41
|
"paraId": 1500,
|
|
42
|
+
"cores": 3,
|
|
42
43
|
"spec": "asset-hub",
|
|
43
44
|
"rpc": "wss://paseo-asset-hub-next-rpc.polkadot.io",
|
|
44
45
|
"specSource": "https://raw.githubusercontent.com/paritytech/chainspecs/main/paseo/parachain/asset-hub-next/raw.json",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
{
|
|
51
52
|
"key": "people",
|
|
52
53
|
"paraId": 1502,
|
|
54
|
+
"cores": 3,
|
|
53
55
|
"spec": "people",
|
|
54
56
|
"rpc": "wss://paseo-people-next-system-rpc.polkadot.io",
|
|
55
57
|
"specSource": "https://raw.githubusercontent.com/paritytech/chainspecs/main/paseo/parachain/people-next-system/raw.json",
|
package/networks/polkadot.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
{
|
|
36
36
|
"key": "asset-hub",
|
|
37
37
|
"paraId": 1000,
|
|
38
|
+
"cores": 3,
|
|
38
39
|
"spec": "asset-hub",
|
|
39
40
|
"rpc": "wss://polkadot-asset-hub-rpc.polkadot.io",
|
|
40
41
|
"specSource": "builtin:asset-hub-polkadot",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
{
|
|
49
50
|
"key": "people",
|
|
50
51
|
"paraId": 1004,
|
|
52
|
+
"cores": 3,
|
|
51
53
|
"spec": "people",
|
|
52
54
|
"rpc": "wss://polkadot-people-rpc.polkadot.io",
|
|
53
55
|
"specSource": "builtin:people-polkadot",
|
package/networks/previewnet.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"web3-storage": {
|
|
35
35
|
"repo": "paritytech/web3-storage",
|
|
36
|
-
"tag": "
|
|
36
|
+
"tag": "v0.5.1-paseo"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"genesisConfig": {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
{
|
|
76
76
|
"key": "asset-hub",
|
|
77
77
|
"paraId": 1500,
|
|
78
|
+
"cores": 3,
|
|
78
79
|
"spec": "asset-hub",
|
|
79
80
|
"rpc": "asset-hub",
|
|
80
81
|
"specSource": "chainspecs/asset-hub-local.json",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
{
|
|
98
99
|
"key": "people",
|
|
99
100
|
"paraId": 1502,
|
|
101
|
+
"cores": 3,
|
|
100
102
|
"spec": "individuality",
|
|
101
103
|
"rpc": "people",
|
|
102
104
|
"specSource": "chainspecs/individuality-local.json",
|
package/networks/westend.json
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
{
|
|
35
35
|
"key": "asset-hub",
|
|
36
36
|
"paraId": 1000,
|
|
37
|
+
"cores": 3,
|
|
37
38
|
"spec": "asset-hub",
|
|
38
39
|
"rpc": "wss://westend-asset-hub-rpc.polkadot.io",
|
|
39
40
|
"specSource": "builtin:asset-hub-westend",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
{
|
|
46
47
|
"key": "people",
|
|
47
48
|
"paraId": 1004,
|
|
49
|
+
"cores": 3,
|
|
48
50
|
"spec": "people",
|
|
49
51
|
"rpc": "wss://westend-people-rpc.polkadot.io",
|
|
50
52
|
"specSource": "builtin:people-westend",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parity/ppn",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Spin up a local Polkadot ecosystem: fetch, generate, fork and run a network",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"commander": "^15.0.0",
|
|
23
23
|
"polkadot-api": "^1.23.3",
|
|
24
24
|
"toml": "^5.0.1",
|
|
25
|
-
"@parity/ppn-network-config": "0.
|
|
25
|
+
"@parity/ppn-network-config": "0.19.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^24.0.0",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Node arguments under the network overlay's safeRpc (PPN_SAFE_RPC=1 on every node): RPC and
|
|
3
|
+
# Prometheus on localhost only, and only safe RPC methods. zombienet passes every node
|
|
4
|
+
# `--rpc-methods unsafe` and `--prometheus-external` and drops `--rpc-methods` from the node's own
|
|
5
|
+
# args, and the engine passes `--unsafe-rpc-external`, so the launcher rewrites the arguments
|
|
6
|
+
# itself: each side of a collator's `--` (the collator, then its relay-chain node) ends with
|
|
7
|
+
# `--rpc-methods safe`.
|
|
8
|
+
#
|
|
9
|
+
# Usage: source "$(dirname "${BASH_SOURCE[0]}")/lib/safe-rpc.sh"
|
|
10
|
+
# rewrite_node_args "$@"; exec <node> "${NODE_ARGS[@]}"
|
|
11
|
+
# Sets: NODE_ARGS the arguments to run the node with; unchanged without PPN_SAFE_RPC=1
|
|
12
|
+
|
|
13
|
+
rewrite_node_args() {
|
|
14
|
+
if [[ "${PPN_SAFE_RPC:-}" != 1 ]]; then NODE_ARGS=("$@"); return; fi
|
|
15
|
+
NODE_ARGS=()
|
|
16
|
+
local arg skip_value=false
|
|
17
|
+
for arg in "$@"; do
|
|
18
|
+
if [[ "$skip_value" == true ]]; then skip_value=false; continue; fi
|
|
19
|
+
case "$arg" in
|
|
20
|
+
--rpc-methods) skip_value=true ;;
|
|
21
|
+
--rpc-methods=* | --unsafe-rpc-external | --rpc-external | --prometheus-external) ;;
|
|
22
|
+
--) NODE_ARGS+=(--rpc-methods safe --) ;;
|
|
23
|
+
*) NODE_ARGS+=("$arg") ;;
|
|
24
|
+
esac
|
|
25
|
+
done
|
|
26
|
+
NODE_ARGS+=(--rpc-methods safe)
|
|
27
|
+
}
|
package/scripts/lib/workspace.sh
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
# Usage: source "$(dirname "${BASH_SOURCE[0]}")/lib/workspace.sh" (adjust depth)
|
|
13
13
|
# Sets: PPN_WS the workspace root
|
|
14
14
|
# PPN_WS_BIN its bin/ (callers append /<network> for non-previewnet binaries)
|
|
15
|
+
# PPN_NODE_BIN_DIR where a node launcher finds its binary: a node's PPN_BIN_DIR, else
|
|
16
|
+
# the BIN `ppn start` exports (which zombienet's argument probe inherits
|
|
17
|
+
# without the node-level env), else PPN_WS_BIN
|
|
15
18
|
|
|
16
19
|
ppn_workspace_root() {
|
|
17
20
|
if [[ -n "${PPN_HOME:-}" ]]; then
|
|
@@ -45,3 +48,4 @@ ppn_workspace_root() {
|
|
|
45
48
|
|
|
46
49
|
PPN_WS="$(ppn_workspace_root)"
|
|
47
50
|
PPN_WS_BIN="$PPN_WS/bin"
|
|
51
|
+
PPN_NODE_BIN_DIR="${PPN_BIN_DIR:-${BIN:-$PPN_WS_BIN}}"
|
package/scripts/omni-node.sh
CHANGED
|
@@ -36,11 +36,9 @@ set -euo pipefail
|
|
|
36
36
|
# So: the explicit env first, then the workspace, and only then this script's own tree, which is
|
|
37
37
|
# the right answer in a checkout and a harmless miss anywhere else.
|
|
38
38
|
source "$(dirname "${BASH_SOURCE[0]}")/lib/workspace.sh"
|
|
39
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/safe-rpc.sh"
|
|
39
40
|
REPO_BIN="$PPN_WS_BIN"
|
|
40
|
-
|
|
41
|
-
# bin/<network> for everything else — and the probe below inherits it even though it gets
|
|
42
|
-
# none of the node-level env.
|
|
43
|
-
BIN_DIR="${PPN_BIN_DIR:-${BIN:-$REPO_BIN}}"
|
|
41
|
+
BIN_DIR="$PPN_NODE_BIN_DIR"
|
|
44
42
|
BINARY="${PPN_COLLATOR_BINARY:-polkadot-omni-node}"
|
|
45
43
|
BIN="$BIN_DIR/$BINARY"
|
|
46
44
|
|
|
@@ -103,10 +101,11 @@ if [[ "${PPN_COLLATOR_AURA:-}" == "ed25519" ]]; then
|
|
|
103
101
|
fi
|
|
104
102
|
fi
|
|
105
103
|
|
|
104
|
+
rewrite_node_args "$@"
|
|
106
105
|
for arg in "$@"; do
|
|
107
106
|
if [[ "$arg" == "--" ]]; then
|
|
108
|
-
exec "$BIN" "
|
|
107
|
+
exec "$BIN" "${NODE_ARGS[@]}" --network-backend=libp2p --discover-local --allow-private-ip
|
|
109
108
|
fi
|
|
110
109
|
done
|
|
111
110
|
|
|
112
|
-
exec "$BIN" "
|
|
111
|
+
exec "$BIN" "${NODE_ARGS[@]}"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The relay's node command when the network overlay sets safeRpc: polkadot, with its arguments
|
|
3
|
+
# rewritten by lib/safe-rpc.sh. Without safeRpc the TOML runs the binary directly.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/workspace.sh"
|
|
7
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/safe-rpc.sh"
|
|
8
|
+
|
|
9
|
+
rewrite_node_args "$@"
|
|
10
|
+
exec "$PPN_NODE_BIN_DIR/polkadot" "${NODE_ARGS[@]}"
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
timeout = 600
|
|
6
6
|
node_spawn_timeout = 240
|
|
7
7
|
|
|
8
|
-
# Elastic scaling:
|
|
8
|
+
# Elastic scaling: the cores beyond each parachain's first, which assign-cores hands out
|
|
9
9
|
[relaychain.genesis.configuration.config.scheduler_params]
|
|
10
|
-
num_cores =
|
|
10
|
+
num_cores = 4
|
|
11
11
|
max_validators_per_core = 1
|
|
12
12
|
|
|
13
13
|
[relaychain]
|
|
@@ -59,7 +59,21 @@ rpc_port = 10005
|
|
|
59
59
|
prometheus_port = 20005
|
|
60
60
|
balance = 1000000000000000
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
[[relaychain.nodes]]
|
|
63
|
+
name = "one-paseo-validator"
|
|
64
|
+
validator = true
|
|
65
|
+
rpc_port = 10006
|
|
66
|
+
prometheus_port = 20006
|
|
67
|
+
balance = 1000000000000000
|
|
68
|
+
|
|
69
|
+
[[relaychain.nodes]]
|
|
70
|
+
name = "two-paseo-validator"
|
|
71
|
+
validator = true
|
|
72
|
+
rpc_port = 10007
|
|
73
|
+
prometheus_port = 20007
|
|
74
|
+
balance = 1000000000000000
|
|
75
|
+
|
|
76
|
+
## Asset Hub Paseo Next (Parachain 1500) - Elastic Scaling on 3 cores
|
|
63
77
|
[[parachains]]
|
|
64
78
|
id = 1500
|
|
65
79
|
cumulus_based = true
|
|
@@ -74,7 +88,7 @@ prometheus_port = 20020
|
|
|
74
88
|
command = "{{SCRIPTS}}/omni-node.sh"
|
|
75
89
|
args = ["-lxcm=trace", "--rpc-max-connections=500", "--force-authoring", "--authoring=slot-based", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30335/webrtc-direct"]
|
|
76
90
|
|
|
77
|
-
## People Chain (Parachain 1502)
|
|
91
|
+
## People Chain (Parachain 1502) - Elastic Scaling on 3 cores
|
|
78
92
|
[[parachains]]
|
|
79
93
|
id = 1502
|
|
80
94
|
cumulus_based = true
|
|
@@ -117,7 +131,7 @@ rpc_port = 10040
|
|
|
117
131
|
p2p_port = 30337
|
|
118
132
|
prometheus_port = 20040
|
|
119
133
|
command = "{{SCRIPTS}}/omni-node.sh"
|
|
120
|
-
args = ["-lruntime=info", "--collator", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"]
|
|
134
|
+
args = ["-lruntime=info", "--collator", "--authoring=slot-based", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"]
|
|
121
135
|
|
|
122
136
|
[[hrmp_channels]]
|
|
123
137
|
sender = 1502
|