Skip to main content

Subnet Configs

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

MetalGo 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
},
"appGossipNonValidatorSize": 10
}

Parameters

Private Subnet

validatorOnly (bool):

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

Metal 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.

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-virtuous-commit-thresholdbetaVirtuous
--snow-rogue-commit-thresholdbetaRogue
--snow-concurrent-repollsconcurrentRepolls
--snow-optimal-processingoptimalProcessing
--snow-max-processingmaxOutstandingItems
--snow-max-time-processingmaxItemProcessingTime
--snow-mixed-query-num-push-vdrmixedQueryNumPushVdr
--snow-mixed-query-num-push-non-vdrmixedQueryNumPushNondVdr
--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. For example in Primary Network transaction mempools are not gossipped to non-validators (--consensus-app-gossip-non-validator-size is 0). You can change this for your Subnet and share mempool with non-validators as well. 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
--consensus-app-gossip-validator-sizeappGossipValidatorSize
--consensus-app-gossip-non-validator-sizeappGossipNonValidatorSize
--consensus-app-gossip-peer-sizeappGossipPeerSize