Skip to main content

Subnet Configs

tip

This page was generated by a plugin that directly references this file in the AvalancheGo GitHub repository.

It is possible to provide parameters for a Subnet. Parameters here apply to all chains in the specified Subnet.

AvalancheGo looks for files specified with {subnetID}.json under --subnet-config-dir as documented here.

Here is an example of Subnet config file:

{
"validatorOnly": false,
"consensusParameters": {
"k": 25,
"alpha": 18
}
}

Parameters​

Private Subnet​

validatorOnly (bool)​

If true this node does not expose Subnet blockchain contents to non-validators via P2P messages. Defaults to false.

Avalanche Subnets are public by default. It means that every node can sync and listen ongoing transactions/blocks in Subnets, even they're not validating the listened Subnet.

Subnet validators can choose not to publish contents of blockchains via this configuration. If a node sets validatorOnly to true, the node exchanges messages only with this Subnet's validators. Other peers will not be able to learn contents of this Subnet from this node.

tip

This is a node-specific configuration. Every validator of this Subnet has to use this configuration in order to create a full private Subnet.

allowedNodes (string list)​

If validatorOnly=true this allows explicitly specified NodeIDs to be allowed to sync the Subnet regardless of validator status. Defaults to be empty.

tip

This is a node-specific configuration. Every validator of this Subnet has to use this configuration in order to properly allow a node in the private Subnet.

proposerMinBlockDelay (duration)​

The minimum delay performed when building snowman++ blocks. Default is set to 1 second.

As one of the ways to control network congestion, Snowman++ will only build a block proposerMinBlockDelay after the parent block's timestamp. Some high-performance custom VM may find this too strict. This flag allows tuning the frequency at which blocks are built.

Consensus Parameters​

Subnet configs supports loading new consensus parameters. JSON keys are different from their matching CLI keys. These parameters must be grouped under consensusParameters key. The consensus parameters of a Subnet default to the same values used for the Primary Network, which are given CLI Snow Parameters.

CLI KeyJSON Key
--snow-sample-sizek
--snow-quorum-sizealpha
--snow-commit-thresholdbeta
--snow-concurrent-repollsconcurrentRepolls
--snow-optimal-processingoptimalProcessing
--snow-max-processingmaxOutstandingItems
--snow-max-time-processingmaxItemProcessingTime
--snow-avalanche-batch-sizebatchSize
--snow-avalanche-num-parentsparentSize

Gossip Configs​

It's possible to define different Gossip configurations for each Subnet without changing values for Primary Network. JSON keys of these parameters are different from their matching CLI keys. These parameters default to the same values used for the Primary Network. For more information see CLI Gossip Configs.

CLI KeyJSON Key
--consensus-accepted-frontier-gossip-validator-sizegossipAcceptedFrontierValidatorSize
--consensus-accepted-frontier-gossip-non-validator-sizegossipAcceptedFrontierNonValidatorSize
--consensus-accepted-frontier-gossip-peer-sizegossipAcceptedFrontierPeerSize
--consensus-on-accept-gossip-validator-sizegossipOnAcceptValidatorSize
--consensus-on-accept-gossip-non-validator-sizegossipOnAcceptNonValidatorSize
--consensus-on-accept-gossip-peer-sizegossipOnAcceptPeerSize

Was this page helpful?