Identifies which Bitcoin chain a node operates on.

Synopsis

Declared in <util/chaintype.h>

enum class ChainType : int;

Members

Name

Description

MAIN

The main Bitcoin network (mainnet).

TESTNET

The version 3 public test network (testnet3).

SIGNET

A signet network, where blocks require a signature.

REGTEST

A private regression test network with on‐demand block creation.

TESTNET4

The version 4 public test network (testnet4).

Non-Member Functions

Name

Description

ChainTypeFromString

Parse a chain type from its canonical string name.

ChainTypeToString

Convert a chain type to its canonical string name.

CreateBaseChainParams

Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.

GetNetworkForMagic

Determines which chain a set of network magic bytes belongs to.

SelectBaseParams

Sets the params returned by Params() to those for the given chain.

SelectParams

Sets the params returned by Params() to those for the given chain type.

Created with MrDocs