Skip to content

Commit ad7ac4d

Browse files
committed
Update node configs: optimize pruning, disable external ports
- Remove 9944/9615 from external firewall ports (localhost only) - Add pruning flags for para and relay chains (--blocks-pruning=256, --state-pruning=256) - Use --database=paritydb and --sync=fast for collators - Disable relay chain RPC with --rpc-port=0 - Add --pool-limit=0 for relay chain on collators - Replace archive-canonical with pruned relay chain config - Add chown root:root for binary ownership
1 parent 1f55b3e commit ad7ac4d

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

node-infrastructure/run-a-collator/collator.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Block-producing collators require robust hardware for reliable operation includi
5050
- Open ports:
5151
- 30333 (parachain P2P)
5252
- 30334 (relay chain P2P)
53-
- 9944 (WebSocket RPC - for management)
5453

5554
Uptime is critical. Consider redundancy and monitoring to maintain block production reliability.
5655

@@ -105,6 +104,7 @@ This guide provides two deployment options. Select the option that best fits you
105104
# Make it executable and move to system path
106105
chmod +x polkadot-parachain
107106
sudo mv polkadot-parachain /usr/local/bin/
107+
sudo chown root:root /usr/local/bin/polkadot-parachain
108108

109109
# Verify installation
110110
polkadot-parachain --version
@@ -258,11 +258,18 @@ Follow these steps to build a chainspec from the runtime:
258258
--prometheus-port=9615 \
259259
--node-key-file=/var/lib/polkadot-collator/node.key \
260260
--name="YourCollatorName" \
261+
--blocks-pruning=256 \
262+
--state-pruning=256 \
263+
--database=paritydb \
261264
-- \
262-
--execution=wasm \
263265
--chain=polkadot \
264266
--port=30334 \
265-
--sync=warp
267+
--sync=fast \
268+
--blocks-pruning=256 \
269+
--state-pruning=256 \
270+
--database=paritydb \
271+
--pool-limit=0 \
272+
--rpc-port=0
266273

267274
Restart=always
268275
RestartSec=10
@@ -277,7 +284,11 @@ Follow these steps to build a chainspec from the runtime:
277284
- `--collator`: Enables block production mode
278285
- `--node-key-file`: Uses the generated node key for stable peer ID
279286
- `--name`: Your collator name (visible in telemetry)
280-
- Relay chain uses `--sync=warp` for faster initial sync
287+
- `--blocks-pruning=256` and `--state-pruning=256`: Keeps only recent blocks and state, reducing disk usage (collators don't need archive data)
288+
- `--database=paritydb`: Uses ParityDB for better performance
289+
- `--sync=fast`: Fast sync mode for the relay chain
290+
- `--pool-limit=0`: Disables transaction pool on relay chain (collators don't need it)
291+
- `--rpc-port=0` (relay chain): Disables RPC on the embedded relay chain node (not needed for collators)
281292

282293
## Run the Collator
283294

@@ -317,7 +328,7 @@ Sync time depends on:
317328
- Disk I/O speed
318329
- Current chain size
319330

320-
The relay chain uses warp sync for faster synchronization.
331+
The relay chain uses fast sync for faster synchronization.
321332

322333
!!! warning
323334

node-infrastructure/run-a-node/parachain-rpc.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ RPC nodes serving production traffic require robust hardware:
7272
- 30334 (relay chain P2P)
7373
- 9944 (Polkadot SDK WebSocket RPC)
7474
- 9933 (Polkadot SDK HTTP RPC)
75-
- 9615 (Prometheus metrics - optional)
7675
- Consider DDoS protection and rate limiting for production deployments
7776

7877
!!! note
@@ -235,7 +234,8 @@ Select the best option for your project, then use the steps in the following tab
235234
--base-path=/data \
236235
--chain=polkadot \
237236
--state-pruning=256 \
238-
--blocks-pruning=archive-canonical
237+
--blocks-pruning=256 \
238+
--rpc-port=0
239239
```
240240

241241
=== "Pruned Node"
@@ -268,7 +268,8 @@ Select the best option for your project, then use the steps in the following tab
268268
--base-path=/data \
269269
--chain=polkadot \
270270
--state-pruning=256 \
271-
--blocks-pruning=archive-canonical
271+
--blocks-pruning=256 \
272+
--rpc-port=0
272273
```
273274

274275
!!! note
@@ -440,7 +441,8 @@ Select the best option for your project, then use the steps in the following tab
440441
--base-path=/var/lib/people-chain-rpc \
441442
--port=30334 \
442443
--state-pruning=256 \
443-
--blocks-pruning=archive-canonical
444+
--blocks-pruning=256 \
445+
--rpc-port=0
444446

445447
Restart=always
446448
RestartSec=10
@@ -484,7 +486,8 @@ Select the best option for your project, then use the steps in the following tab
484486
--base-path=/var/lib/people-chain-rpc \
485487
--port=30334 \
486488
--state-pruning=256 \
487-
--blocks-pruning=archive-canonical
489+
--blocks-pruning=256 \
490+
--rpc-port=0
488491

489492
Restart=always
490493
RestartSec=10

node-infrastructure/run-a-node/polkadot-hub-rpc.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ RPC nodes serving production traffic require robust hardware. The following shou
4545
- 30334 (relay chain P2P)
4646
- 9944 (Polkadot SDK WebSocket RPC)
4747
- 9933 (Polkadot SDK HTTP RPC)
48-
- 9615 (Prometheus metrics - optional)
4948
- Consider DDoS protection and rate limiting for production deployments
5049

5150
**Note**: For development or low-traffic scenarios, you can reduce these requirements proportionally. Consider using a reverse proxy (nginx, Caddy) for production deployments.
@@ -207,7 +206,8 @@ Select the best option for your project, then use the steps in the following tab
207206
--base-path=/data \
208207
--chain=polkadot \
209208
--state-pruning=256 \
210-
--blocks-pruning=archive-canonical
209+
--blocks-pruning=256 \
210+
--rpc-port=0
211211
```
212212

213213
=== "Pruned Node"
@@ -240,7 +240,8 @@ Select the best option for your project, then use the steps in the following tab
240240
--base-path=/data \
241241
--chain=polkadot \
242242
--state-pruning=256 \
243-
--blocks-pruning=archive-canonical
243+
--blocks-pruning=256 \
244+
--rpc-port=0
244245
```
245246

246247
Critical configuration parameters include port mappings and node parameters:
@@ -398,7 +399,8 @@ Select the best option for your project, then use the steps in the following tab
398399
--base-path=/var/lib/polkadot-hub-rpc \
399400
--port=30334 \
400401
--state-pruning=256 \
401-
--blocks-pruning=archive-canonical
402+
--blocks-pruning=256 \
403+
--rpc-port=0
402404

403405
Restart=always
404406
RestartSec=10
@@ -442,7 +444,8 @@ Select the best option for your project, then use the steps in the following tab
442444
--base-path=/var/lib/polkadot-hub-rpc \
443445
--port=30334 \
444446
--state-pruning=256 \
445-
--blocks-pruning=archive-canonical
447+
--blocks-pruning=256 \
448+
--rpc-port=0
446449

447450
Restart=always
448451
RestartSec=10

0 commit comments

Comments
 (0)