Config.json complete reference for v1.0 [EN]

Complete reference of config.json for mainnet v0.9+

Code reference https://github.com/nknorg/nkn/blob/v0.9/util/config/config.go#75

{
	Version                   int           `json:"Version"`
	SeedList                  []string      `json:"SeedList"`
	WsCertPath                string        `json:"WsCertPath"`
	WsKeyPath                 string        `json:"WsKeyPath"`
	RPCCert                   string        `json:"RPCCert"`
	RPCKey                    string        `json:"RPCKey"`
	HttpWsPort                uint16        `json:"HttpWsPort"`
	HttpJsonPort              uint16        `json:"HttpJsonPort"`
	NodePort                  uint16        `json:"-"`
	LogLevel                  int           `json:"LogLevel"`
	IsTLS                     bool          `json:"IsTLS"`
	MaxLogSize                int64         `json:"MaxLogSize"`
	GenesisBlockProposer      string        `json:"GenesisBlockProposer"`
	MinTxnFee                 int64         `json:"MinTxnFee"`
	Hostname                  string        `json:"Hostname"`
	Transport                 string        `json:"Transport"`
	NAT                       bool          `json:"NAT"`
	MiningDebug               bool          `json:"MiningDebug"`
	BeneficiaryAddr           string        `json:"BeneficiaryAddr"`
	SyncBatchWindowSize       uint32        `json:"SyncBatchWindowSize"`
	SyncBlockHeadersBatchSize uint32        `json:"SyncBlockHeadersBatchSize"`
	SyncBlocksBatchSize       uint32        `json:"SyncBlocksBatchSize"`
	RPCReadTimeout            time.Duration `json:"RPCReadTimeout"`        // in seconds
	RPCWriteTimeout           time.Duration `json:"RPCWriteTimeout"`       // in seconds
	KeepAliveTimeout          time.Duration `json:"KeepAliveTimeout"`      // in seconds
	NATPortMappingTimeout     time.Duration `json:"NATPortMappingTimeout"` // in seconds
}

Configuration options

  • SeedList

Before a new node can join NKN network, it needs to acquire neighbor information from any of the existing live nodes in NKN network
When nknd is initiated, it will randomly pick a seed node, and send request to that seed node to get its neighbor list
Any live node can become seed node for others. NKN project team provide 8 seed nodes that can run stably for long period of time.

  • IsTLS

If HttpJson RPC service is using TLS for connection

  • HttpJsonPort

NKN’s designated port for HttpJson service, and its default value is 30003.

  • RPCCert、RPCKey

When HttpJson is using TLS connection, RPCCert is the certificate while RPCKey is the private key.

  • HttpWsPort

NKN’s designated port for WebSocket service, and its default value is 30002. If the last 3 digits of port is 440 (for example 30443), then it is TLS connection.

  • WsCertPath、WsKeyPath

When WebSocket use TLS connection,both certificate and private key need to be provided.

  • NodePort

nkn network overlay port,and its default value is 30001

  • LogLevel

Level of logging: [0:Debug, 1:Info, 2:Warning, 3:Error]

  • MaxLogSize

The maximum log file size before a new log file is created.
unit in MB,and its default value is 20MB

  • GenesisBlockProposer

Public key of the designated generis block proposer, default value is the public key of NKN developer team.

  • MinTxnFee

The minimal transaction fee charged by this node. Node will refuse any transaction with lower fee than the MinTxnFee. Its default value is 0.

  • Hostname

Designated public IP address of this node. Upon bootup, the node will use external service to find out own public IP address. Default value is empty.
If you want to run a local testnet with a single machine, Hostname should be set to “127.0.0.1”

  • NAT

Whether automatic port forwarding is enabled (requires home router to support UPnP and PMP functionality). Default value is True.

  • Transport

Whether use tcp or udp for socket connection. Default value is “tcp”.

  • MiningDebug

Whether to display node’s current timestamp and proposalSubmitted in getnodestate API. It will help debug Mining issues. Default value is True.

  • BeneficiaryAddr

Configure the wallet address that will receive mining rewards. This will enable the decoupling of miner wallet and asset holding wallet, thus improving security.
If this configuration is not empty, all mining reward will go to BeneficiaryAddr wallet address. Otherwise the mining reward will go to local mining wallet. Default value is empty.

  • SyncBatchWindowSize

During initial synchronization of blockchain data, the number of concurrent job threads. default value is 1024.
The higher the window size, the faster the initial synchronization speed.
However on smaller devices built with less RAM, smaller window size is recommended to avoid out of memory errors during initial synchronization.

  • SyncBlockHeadersBatchSize

During blockchain data synchronization, the number of BlockHeaders each job thread will fetch. Default value is 256.

  • SyncBlocksBatchSize

During blockchain data synchronization, the number of Blocks each job thread will fetch. Default value is 8.

  • RPCReadTimeout,RPCWriteTimeout,KeepAliveTimeout

Timeout intervals for Read, Write and KeepAlive of HttpJson service

3 Likes