Polkadot Wiki

Polkadot Wiki

  • 入门指南
  • 学习
  • 建立
  • 参与
  • Kusama
  • Contribute
  • Languages icon中文
    • English
    • Русский
    • 参与翻译

›Integration Guide

概述

  • 入门教程
  • 认领
  • Redenomination of DOT
  • 奖助金计划
  • Thousand Validators Programme
  • Polkadot Ambassador Programme
  • 研究专页
  • 社区
  • 贡献
  • Contributors
  • 专业术语
  • Using ENS with DOT/KSM accounts
  • Ledger Application
  • How to Protect Yourself from Scams
  • 常见问题(FAQ)

学习

  • Polkadot 上线流程
  • Basics

    • Polkadot 架构
    • Polkadot 账户
    • 创建帐户
    • 备份和恢复账户
    • DOT
    • 网络安全
    • Polkadot 共识机制
    • Nominator
    • Validator
    • Collator
    • 治理
    • 身份
    • 如何转账
    • 交易费用
    • Polkadot 主机 (PH)
    • 财政库
    • How to use W3F Registrar

    Parachains

    • 平行链
    • 平行线程
    • 桥接
    • 平行链插槽拍卖
    • Parachain Crowdloans

    Advanced

    • 抵押
    • 代理账户
    • 可用性和有效性
    • 随机性
    • 跨链消息传递 (XCMP)
    • SPREE
    • WebAssembly (Wasm)
    • Sequential Phragmén Method
    • Simple Payouts

    Cryptography

    • 密码学讲解
    • 密匙

    Polkadot Comparisons

    • Comparing Polkadot and Kusama
    • 以太坊 2.0
    • Cosmos
    • Dfinity
    • 与其它比较

建立

  • 开发者专页
  • Development Guide

    • Polkadot 開發者入门指南
    • 平行链开发套件(PDKs)
    • 平行链构建指南
    • Cumulus
    • Building Parachains on Rococo
    • 智能合约
    • 预言机
    • Polkadot 钱包

    Integration Guide

    • Integration Initiation
    • Polkadot 协议
    • 节点管理
    • 节点互动
    • 交易创建

    Tools

    • 工具索引

    Resources

    • 黑客马拉松

参与

  • 网络维护者
  • Parameters
  • Nodes and Dapps

    • 设置全节点
    • 网络
    • 为远程连接设置安全的 WebSocket
    • 解决错误

    Nominator Guides

    • How to Nominate on Polkadot
    • Unbonding and Rebonding

    Validator Guides

    • 如何在 Polkadot 上运行验证节点
    • 验证人付款概述
    • 如何把节点设定为 `systemd` 进程运行
    • 安全验证人节点
    • 如何使用 Polkadot 安全验证人设置
    • 设置哨兵节点
    • 如何升级验证人节点
    • Monitor your node
    • How to Chill

    Governance Guides

    • 参与民主权利
    • 加入议会
    • 投票选举议员
Translate

节点管理

This page contains basic information about running a Parity Polkadot client. There are a lot of ways to obtain/run a client, e.g. compiling from source, running in Docker, or downloading a binary. This guide will always refer to the executable as polkadot.

Always refer to the client's help polkadot --help for the most up-to-date information.

Other client implementation teams: Feel free to make a PR to this page with instructions (or a link to instructions) for your client.

Basic Node Operations

Selecting a chain

Use the --chain <chainspec> option to select the chain. Can be polkadot, kusama, westend, or a custom chain spec. By default, the client will start Polkadot. Watch How a single codebase can power four different blockchains to learn more about how the chain selection works internally.

Archive node

An archive node does not prune any block or state data. Use the --archive flag. Certain types of nodes like validators must run in archive mode. Likewise, all events are cleared from state in each block, so if you want to store events then you will need an archive node.

To upgrade a node, please refer to this video

Exporting blocks

To export blocks to a file, use export-blocks. Export in JSON (default) or binary (--binary true).

polkadot export-blocks --from 0 <output_file>

RPC ports

Use the --rpc-external flag to expose RPC ports and --ws-external to expose websockets. Not all RPC calls are safe to allow and you should use an RPC proxy to filter unsafe calls. Select ports with the --rpc-port and --ws-port options. To limit the hosts who can access, use the --rpc-cors option.

Execution

The Parity Polkadot client implements a Polkadot Host and a native runtime. The runtime must compile to WebAssembly and is stored on-chain. If the client's runtime is the same spec as the runtime that is stored on-chain, then the client will execute blocks using the client binary. Otherwise, the client will execute the Wasm runtime from the chain.

Therefore, when syncing the chain, the client will execute blocks from past runtimes using their associated Wasm binary. This feature also allows forkless upgrades: the client can execute a new runtime without updating the client.

Parity's Polkadot client has two Wasm execution methods, interpreted (default) and compiled. Set the preferred method to use when executing Wasm with --wasm-execution <Interpreted|Compiled>. Compiled execution will run much faster, especially when syncing the chain, but is experimental and may use more memory/CPU. A reasonable tradeoff would be to sync the chain with compiled execution and then restart the node with interpreted execution.

File Structure

The node stores a number of files in: /home/$USER/.local/share/polkadot/chains/<chain name>/. You can set a custom path with --base-path <path>.

keystore

The keystore stores session keys, which are important for validator operations.

  • Polkadot documentation
  • Substrate documentation

db

The database stores blocks and the state trie. If you are running a validator node, it also stores GRANDPA pre-votes and pre-commits and the offchain-worker DB. Use caution when migrating validator nodes to avoid equivocation. If you want to start a new machine without resyncing, you can stop your node, back up the DB, and move it to a new machine.

To delete your DB and re-sync from genesis, run:

polkadot purge-chain

An alternative database implementation, ParityDB, is available and activated with the --database paritydb option. This database uses more disk space than the default RocksBD, but is more efficient in reads and writes.

Deployment Tools

Web3 Foundation maintains Polkadot Deployer, which allows you to create local or remote cloud deployments of Polkadot nodes. See the README for instructions.

Validators, see the secure setup guide for information specific to deploying validator nodes.

Monitoring and Telemetry

Node status

You can check the node's health via RPC with:

curl -H "Content-Type: application/json" --data '{ "jsonrpc":"2.0", "method":"system_health", "params":[],"id":1 }' localhost:9933 

Logs

The Polkadot client has a number of log targets. The most interesting to users may be:

  • afg (Al's Finality Gadget - GRANDPA consensus)
  • babe
  • telemetry
  • txpool
  • usage

Other targets include: db, gossip, peerset, state-db, state-trace, sub-libp2p, trie, wasm-executor, wasm-heap.

The log levels, from least to most verbose, are:

  • error
  • warn
  • info
  • debug
  • trace

All targets are set to info logging by default. You can adjust individual log levels using the --log (-l short) option, for example -l afg=trace,sync=debug or globally with -ldebug.

Telemetry & Metrics

The Parity Polkadot client connects to telemetry by default. You can disable it with --no-telemetry, or connect only to specified telemetry servers with the --telemetry-url option (see the help options for instructions). Connecting to public telemetry may expose information that puts your node at higher risk of attack. You can run your own, private telemetry server or deploy a substrate-telemetry instance to a Kubernetes cluster using this Helm chart.

The node also exposes a Prometheus endpoint by default (disable with --no-prometheus). Substrate has a vizualizing node metrics tutorial which uses this endpoint.

Last updated on 1/27/2021 by w3fbot
← Polkadot 协议节点互动 →
  • Basic Node Operations
  • File Structure
  • Deployment Tools
  • Monitoring and Telemetry
General
  • About
  • FAQ
  • Contact
  • Build
  • Grants and Bounties
  • Careers
Technology
  • Technology
  • Token
  • Telemetry
  • Substrate
  • Whitepaper
  • Lightpaper
Community
  • Community
  • Documentation
  • Brand Assets
  • Blog
  • Element Chat
  • Medium

Subscribe to the newsletter to hear about Polkadot updates and events.

Polkadot Network
  • © 2021 Web3 Foundation
  • Impressum
  • Disclaimer
  • Privacy
  • Cookie Settings
  • PDF version