# Polkadot Developer Documentation (LLMS Format) This file contains documentation for Polkadot (https://polkadot.network). Polkadot unites the world's innovators and changemakers, building and using the most transformative apps and blockchains. Access tools, guides, and resources to quickly start building custom chains, deploying smart contracts, and creating dApps. It is intended for use with large language models (LLMs) to support developers working with Polkadot. The content includes selected pages from the official docs, organized by section. This file includes documentation related to the product: Infrastructure ## AI Prompt Template You are an AI developer assistant for Polkadot (https://polkadot.network). Your task is to assist developers in understanding and using the product described in this file. - Provide accurate answers based on the included documentation. - Do not assume undocumented features, behaviors, or APIs. - If unsure, respond with “Not specified in the documentation. ## List of doc pages: Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-node/setup-bootnode.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-node/setup-full-node.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-node/setup-secure-wss.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/onboarding-and-offboarding/key-management.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/onboarding-and-offboarding/start-validating.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/onboarding-and-offboarding/stop-validating.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/operational-tasks/general-management.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/operational-tasks/pause-validating.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/operational-tasks/upgrade-your-node.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/running-a-validator/requirements.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/staking-mechanics/offenses-and-slashes.md [type: other] Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/main/infrastructure/staking-mechanics/rewards-payout.md [type: other] ## Full content for each doc page Doc-Content: https://docs.polkadot.com/infrastructure/running-a-node/setup-bootnode/ --- BEGIN CONTENT --- --- title: Set Up a Bootnode description: Learn how to configure and run a bootnode for Polkadot, including P2P, WS, and secure WSS connections with network key management and proxies. categories: Infrastructure --- # Set Up a Bootnode ## Introduction Bootnodes are essential for helping blockchain nodes discover peers and join the network. When a node starts, it needs to find other nodes, and bootnodes provide an initial point of contact. Once connected, a node can expand its peer connections and play its role in the network, like participating as a validator. This guide will walk you through setting up a Polkadot bootnode, configuring P2P, WebSocket (WS), secure WSS connections, and managing network keys. You'll also learn how to test your bootnode to ensure it is running correctly and accessible to other nodes. ## Prerequisites Before you start, you need to have the following prerequisites: - Verify a working Polkadot (`polkadot`) binary is available on your machine - Ensure you have nginx installed. Please refer to the [Installation Guide](https://nginx.org/en/docs/install.html){target=\_blank} for help with installation if needed - A VPS or other dedicated server setup ## Accessing the Bootnode Bootnodes must be accessible through three key channels to connect with other nodes in the network: - **P2P** - a direct peer-to-peer connection, set by: ```bash --listen-addr /ip4/0.0.0.0/tcp/INSERT_PORT ``` This is not enabled by default on non-validator nodes like archive RPC nodes. - **P2P/WS** - a WebSocket (WS) connection, also configured via `--listen-addr` - **P2P/WSS** - a secure WebSocket (WSS) connection using SSL, often required for light clients. An SSL proxy is needed, as the node itself cannot handle certificates ## Node Key A node key is the ED25519 key used by `libp2p` to assign your node an identity or peer ID. Generating a known node key for a bootnode is crucial, as it gives you a consistent key that can be placed in chain specifications as a known, reliable bootnode. Starting a node creates its node key in the `chains/INSERT_CHAIN/network/secret_ed25519` file. You can create a node key using: ``` bash polkadot key generate-node-key ``` This key can be used in the startup command line. It is imperative that you backup the node key. If it is included in the `polkadot` binary, it is hardcoded into the binary, which must be recompiled to change the key. ## Running the Bootnode A bootnode can be run as follows: ``` bash polkadot --chain polkadot \ --name dot-bootnode \ --listen-addr /ip4/0.0.0.0/tcp/30310 \ --listen-addr /ip4/0.0.0.0/tcp/30311/ws ``` This assigns the p2p to port 30310 and p2p/ws to port 30311. For the p2p/wss port, a proxy must be set up with a DNS name and a corresponding certificate. The following example is for the popular nginx server and enables p2p/wss on port 30312 by adding a proxy to the p2p/ws port 30311: ``` conf title="/etc/nginx/sites-enabled/dot-bootnode" server { listen 30312 ssl http2 default_server; server_name dot-bootnode.stakeworld.io; root /var/www/html; ssl_certificate "INSERT_YOUR_CERT"; ssl_certificate_key "INSERT_YOUR_KEY"; location / { proxy_buffers 16 4k; proxy_buffer_size 2k; proxy_pass http://localhost:30311; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } } ``` ## Testing Bootnode Connection If the preceding node is running with DNS name `dot-bootnode.stakeworld.io`, which contains a proxy with a valid certificate and node-id `12D3KooWAb5MyC1UJiEQJk4Hg4B2Vi3AJdqSUhTGYUqSnEqCFMFg` then the following commands should output `syncing 1 peers`. !!!tip You can add `-lsub-libp2p=trace` on the end to get libp2p trace logging for debugging purposes. ### P2P ```bash polkadot --chain polkadot \ --base-path /tmp/node \ --name "Bootnode testnode" \ --reserved-only \ --reserved-nodes "/dns/dot-bootnode.stakeworld.io/tcp/30310/p2p/12D3KooWAb5MyC1UJiEQJk4Hg4B2Vi3AJdqSUhTGYUqSnEqCFMFg" \ --no-hardware-benchmarks ``` ### P2P/WS ```bash polkadot --chain polkadot \ --base-path /tmp/node \ --name "Bootnode testnode" \ --reserved-only \ --reserved-nodes "/dns/dot-bootnode.stakeworld.io/tcp/30311/ws/p2p/12D3KooWAb5MyC1UJiEQJk4Hg4B2Vi3AJdqSUhTGYUqSnEqCFMFg" \ --no-hardware-benchmarks ``` ### P2P/WSS ```bash polkadot --chain polkadot \ --base-path /tmp/node \ --name "Bootnode testnode" \ --reserved-only \ --reserved-nodes "/dns/dot-bootnode.stakeworld.io/tcp/30312/wss/p2p/12D3KooWAb5MyC1UJiEQJk4Hg4B2Vi3AJdqSUhTGYUqSnEqCFMFg" \ --no-hardware-benchmarks ``` --- END CONTENT --- Doc-Content: https://docs.polkadot.com/infrastructure/running-a-node/setup-full-node/ --- BEGIN CONTENT --- --- title: Set Up a Node description: Learn how to install, configure, and run Polkadot nodes, including setting up different node types and connecting to the network. categories: Infrastructure --- # Set Up a Node ## Introduction Running a node on Polkadot provides direct interaction with the network, enhanced privacy, and full control over RPC requests, transactions, and data queries. As the backbone of the network, nodes ensure decentralized data propagation, transaction validation, and seamless communication across the ecosystem. Polkadot supports multiple node types, including pruned, archive, and light nodes, each suited to specific use cases. During setup, you can use configuration flags to choose the node type you wish to run. This guide walks you through configuring, securing, and maintaining a node on Polkadot or any Polkadot SDK-based chain. It covers instructions for the different node types and how to safely expose your node's RPC server for external access. Whether you're building a local development environment, powering dApps, or supporting network decentralization, this guide provides all the essentials. ## Set Up a Node Now that you're familiar with the different types of nodes, this section will walk you through configuring, securing, and maintaining a node on Polkadot or any Polkadot SDK-based chain. ### Prerequisites Before getting started, ensure the following prerequisites are met: - Ensure [Rust](https://www.rust-lang.org/tools/install){target=\_blank} is installed on your operating system - [Install the necessary dependencies for the Polkadot SDK](/develop/parachains/install-polkadot-sdk/){target=\_blank} !!! warning This setup is not recommended for validators. If you plan to run a validator, refer to the [Running a Validator](/infrastructure/running-a-validator/){target=\_blank} guide for proper instructions. ### Install and Build the Polkadot Binary This section will walk you through installing and building the Polkadot binary for different operating systems and methods. ??? interface "macOS" To get started, update and configure the Rust toolchain by running the following commands: ```bash source ~/.cargo/env rustup default stable rustup update rustup update nightly rustup target add wasm32-unknown-unknown --toolchain nightly rustup component add rust-src --toolchain stable-aarch64-apple-darwin ``` You can verify your installation by running: ```bash rustup show rustup +nightly show ``` You should see output similar to the following:
Secret phrase: twist buffalo mixture excess device drastic vague mammal fitness punch match hammer Network ID: substrate Secret seed: 0x5faa9e5defe42b201388d5c2b8202d6625a344abc9aa52943a71f12cb90b88a9 Public key (hex): 0x28cc2fdb6e28835e2bbac9a16feb65c23d448c9314ef12fe083b61bab8fc2755 Account ID: 0x28cc2fdb6e28835e2bbac9a16feb65c23d448c9314ef12fe083b61bab8fc2755 Public key (SS58): 5CzCRpXzHYhuo6G3gYFR3cgV6X3qCNwVt51m8q14ZcChsSXQ SS58 Address: 5CzCRpXzHYhuo6G3gYFR3cgV6X3qCNwVt51m8q14ZcChsSXQ
Network launched 🚀🚀 | ||
---|---|---|
Namespace | zombie-75a01b93c92d571f6198a67bcb380fcd | |
Provider | native | |
Node Information | ||
Name | alice | |
Direct Link | https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:55308#explorer | |
Prometheus Link | http://127.0.0.1:55310/metrics | |
Log Cmd | tail -f /tmp/zombie-794af21178672e1ff32c612c3c7408dc_-2397036-6717MXDxcS55/alice.log | |
Node Information | ||
Name | bob | |
Direct Link | https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:55312#explorer | |
Prometheus Link | http://127.0.0.1:50634/metrics | |
Log Cmd | tail -f /tmp/zombie-794af21178672e1ff32c612c3c7408dc_-2397036-6717MXDxcS55/bob.log | |
Node Information | ||
Name | collator01 | |
Direct Link | https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:55316#explorer | |
Prometheus Link | http://127.0.0.1:55318/metrics | |
Log Cmd | tail -f /tmp/zombie-794af21178672e1ff32c612c3c7408dc_-2397036-6717MXDxcS55/collator01.log | |
Parachain ID | 100 | |
ChainSpec Path | /tmp/zombie-794af21178672e1ff32c612c3c7408dc_-2397036-6717MXDxcS55/100-rococo-local.json |
{ execution_result: { success: true, value: { actual_weight: undefined, pays_fee: { type: 'Yes', value: undefined } } }, emitted_events: [ { type: 'Balances', value: { type: 'Transfer', value: { from: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', to: '13YMK2ePPKQeW7ynqLozB65WYjMnNgffQ9uR4AzyGmqnKeLq', amount: 120000000000n } } }, { type: 'Balances', value: { type: 'Issued', value: { amount: 0n } } }, { type: 'XcmPallet', value: { type: 'Attempted', value: { outcome: { type: 'Complete', value: { used: { ref_time: 251861000n, proof_size: 6196n } } } } } }, { type: 'Balances', value: { type: 'Burned', value: { who: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', amount: 397000000n } } }, { type: 'Balances', value: { type: 'Minted', value: { who: '13UVJyLnbVp9RBZYFwFGyDvVd1y27Tt8tkntv6Q7JVPhFsTB', amount: 397000000n } } }, { type: 'XcmPallet', value: { type: 'FeesPaid', value: { paying: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: { type: 'Polkadot', value: undefined }, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } }, fees: [ { id: { parents: 0, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 397000000n } } ] } } }, { type: 'XcmPallet', value: { type: 'Sent', value: { origin: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: { type: 'Polkadot', value: undefined }, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } }, destination: { parents: 0, interior: { type: 'X1', value: { type: 'Parachain', value: 4001 } } }, message: [ { type: 'ReserveAssetDeposited', value: [ { id: { parents: 1, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 120000000000n } } ] }, { type: 'ClearOrigin', value: undefined }, { type: 'BuyExecution', value: { fees: { id: { parents: 1, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 120000000000n } }, weight_limit: { type: 'Unlimited', value: undefined } } }, { type: 'DepositAsset', value: { assets: { type: 'Wild', value: { type: 'AllCounted', value: 1 } }, beneficiary: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: undefined, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } } } } ], message_id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } ], local_xcm: undefined, destination: { type: 'V4', value: { parents: 0, interior: { type: 'X1', value: { type: 'Parachain', value: 4001 } } } }, remote_xcm: { type: 'V3', value: [ { type: 'ReserveAssetDeposited', value: [ { id: { type: 'Concrete', value: { parents: 1, interior: { type: 'Here', value: undefined } } }, fun: { type: 'Fungible', value: 120000000000n } } ] }, { type: 'ClearOrigin', value: undefined }, { type: 'BuyExecution', value: { fees: { id: { type: 'Concrete', value: { parents: 1, interior: { type: 'Here', value: undefined } } }, fun: { type: 'Fungible', value: 120000000000n } }, weight_limit: { type: 'Unlimited', value: undefined } } }, { type: 'DepositAsset', value: { assets: { type: 'Wild', value: { type: 'AllCounted', value: 1 } }, beneficiary: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: undefined, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } } } }, { type: 'SetTopic', value: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } ] } }
{ execution_result: { success: true, value: { actual_weight: undefined, pays_fee: { type: 'Yes', value: undefined } } }, emitted_events: [ { type: 'Balances', value: { type: 'Transfer', value: { from: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', to: '13YMK2ePPKQeW7ynqLozB65WYjMnNgffQ9uR4AzyGmqnKeLq', amount: 120000000000n } } }, { type: 'Balances', value: { type: 'Issued', value: { amount: 0n } } }, { type: 'XcmPallet', value: { type: 'Attempted', value: { outcome: { type: 'Complete', value: { used: { ref_time: 251861000n, proof_size: 6196n } } } } } }, { type: 'Balances', value: { type: 'Burned', value: { who: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', amount: 397000000n } } }, { type: 'Balances', value: { type: 'Minted', value: { who: '13UVJyLnbVp9RBZYFwFGyDvVd1y27Tt8tkntv6Q7JVPhFsTB', amount: 397000000n } } }, { type: 'XcmPallet', value: { type: 'FeesPaid', value: { paying: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: { type: 'Polkadot', value: undefined }, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } }, fees: [ { id: { parents: 0, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 397000000n } } ] } } }, { type: 'XcmPallet', value: { type: 'Sent', value: { origin: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: { type: 'Polkadot', value: undefined }, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } }, destination: { parents: 0, interior: { type: 'X1', value: { type: 'Parachain', value: 4001 } } }, message: [ { type: 'ReserveAssetDeposited', value: [ { id: { parents: 1, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 120000000000n } } ] }, { type: 'ClearOrigin', value: undefined }, { type: 'BuyExecution', value: { fees: { id: { parents: 1, interior: { type: 'Here', value: undefined } }, fun: { type: 'Fungible', value: 120000000000n } }, weight_limit: { type: 'Unlimited', value: undefined } } }, { type: 'DepositAsset', value: { assets: { type: 'Wild', value: { type: 'AllCounted', value: 1 } }, beneficiary: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: undefined, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } } } } ], message_id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } ], local_xcm: undefined, destination: { type: 'V4', value: { parents: 0, interior: { type: 'X1', value: { type: 'Parachain', value: 4001 } } } }, remote_xcm: { type: 'V3', value: [ { type: 'ReserveAssetDeposited', value: [ { id: { type: 'Concrete', value: { parents: 1, interior: { type: 'Here', value: undefined } } }, fun: { type: 'Fungible', value: 120000000000n } } ] }, { type: 'ClearOrigin', value: undefined }, { type: 'BuyExecution', value: { fees: { id: { type: 'Concrete', value: { parents: 1, interior: { type: 'Here', value: undefined } } }, fun: { type: 'Fungible', value: 120000000000n } }, weight_limit: { type: 'Unlimited', value: undefined } } }, { type: 'DepositAsset', value: { assets: { type: 'Wild', value: { type: 'AllCounted', value: 1 } }, beneficiary: { parents: 0, interior: { type: 'X1', value: { type: 'AccountId32', value: { network: undefined, id: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } } } } } }, { type: 'SetTopic', value: FixedSizeBinary { asText: [Function (anonymous)], asHex: [Function (anonymous)], asOpaqueHex: [Function (anonymous)], asBytes: [Function (anonymous)], asOpaqueBytes: [Function (anonymous)] } } ] } }
{ execution_result: { type: 'Complete', value: { used: { ref_time: 15574200000n, proof_size: 359300n } } }, emitted_events: [ { type: 'System', value: { type: 'NewAccount', value: { account: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET' } } }, { type: 'Balances', value: { type: 'Endowed', value: { account: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', free_balance: 10203500000n } } }, { type: 'Balances', value: { type: 'Minted', value: { who: '12pGtwHPL4tUAUcyeCoJ783NKRspztpWmXv4uxYRwiEnYNET', amount: 10203500000n } } }, { type: 'Balances', value: { type: 'Issued', value: { amount: 1796500000n } } }, { type: 'Balances', value: { type: 'Deposit', value: { who: '13UVJyLgBASGhE2ok3TvxUfaQBGUt88JCcdYjHvUhvQkFTTx', amount: 1796500000n } } } ], forwarded_xcms: [ [ { type: 'V4', value: { parents: 1, interior: { type: 'Here', value: undefined } } }, [] ] ] }
[ { type: 'V3', value: { type: 'Concrete', value: { parents: 1, interior: { type: 'Here', value: undefined } } } } ]
{ type: 'V3', value: [ { id: { type: 'Concrete', value: { parents: 0, interior: { type: 'Here', value: undefined } } }, fun: { type: 'Fungible', value: 396000000n } } ] }