Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CChainParams Class Reference

CChainParams defines various tweakable parameters of a given instance of the Bitcoin system. More...

#include <chainparams.h>

Inheritance diagram for CChainParams:
[legend]
Collaboration diagram for CChainParams:
[legend]

Classes

struct  SigNetOptions
 SigNetOptions holds configurations for creating a signet CChainParams. More...
struct  VersionBitsParameters
 VersionBitsParameters holds activation parameters. More...
struct  RegTestOptions
 RegTestOptions holds configurations for creating a regtest CChainParams. More...

Public Types

enum  Base58Type {
  PUBKEY_ADDRESS , SCRIPT_ADDRESS , SECRET_KEY , EXT_PUBLIC_KEY ,
  EXT_SECRET_KEY , MAX_BASE58_TYPES
}

Public Member Functions

const Consensus::ParamsGetConsensus () const
const MessageStartCharsMessageStart () const
uint16_t GetDefaultPort () const
std::vector< int > GetAvailableSnapshotHeights () const
const CBlockGenesisBlock () const
bool DefaultConsistencyChecks () const
 Default value for -checkmempool and -checkblockindex argument.
bool IsTestChain () const
 If this chain is exclusively used for testing.
bool IsMockableChain () const
 If this chain allows time to be mocked.
uint64_t PruneAfterHeight () const
uint64_t AssumedBlockchainSize () const
 Minimum free space (in GB) needed for data directory.
uint64_t AssumedChainStateSize () const
 Minimum free space (in GB) needed for data directory when pruned; Does not include prune target.
bool MineBlocksOnDemand () const
 Whether it is possible to mine blocks on demand (no retargeting).
std::string GetChainTypeString () const
 Return the chain type string.
ChainType GetChainType () const
 Return the chain type.
const std::vector< std::string > & DNSSeeds () const
 Return the list of hostnames to look up for DNS seeds.
const std::vector< unsigned char > & Base58Prefix (Base58Type type) const
const std::string & Bech32HRP () const
const std::vector< uint8_t > & FixedSeeds () const
const HeadersSyncParamsHeadersSync () const
std::optional< AssumeutxoDataAssumeutxoForHeight (int height) const
std::optional< AssumeutxoDataAssumeutxoForBlockhash (const uint256 &blockhash) const
const ChainTxDataTxData () const

Static Public Member Functions

static std::unique_ptr< const CChainParamsRegTest (const RegTestOptions &options)
static std::unique_ptr< const CChainParamsSigNet (const SigNetOptions &options)
static std::unique_ptr< const CChainParamsMain ()
static std::unique_ptr< const CChainParamsTestNet ()
static std::unique_ptr< const CChainParamsTestNet4 ()

Protected Member Functions

 CChainParams ()=default

Protected Attributes

Consensus::Params consensus
MessageStartChars pchMessageStart
uint16_t nDefaultPort
uint64_t nPruneAfterHeight
uint64_t m_assumed_blockchain_size
uint64_t m_assumed_chain_state_size
std::vector< std::string > vSeeds
std::vector< unsigned char > base58Prefixes [MAX_BASE58_TYPES]
std::string bech32_hrp
ChainType m_chain_type
CBlock genesis
std::vector< uint8_t > vFixedSeeds
bool fDefaultConsistencyChecks
bool m_is_mockable_chain
std::vector< AssumeutxoDatam_assumeutxo_data
ChainTxData chainTxData
HeadersSyncParams m_headers_sync_params

Detailed Description

CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.

Definition at line 76 of file chainparams.h.

Member Enumeration Documentation

◆ Base58Type

Enumerator
PUBKEY_ADDRESS 
SCRIPT_ADDRESS 
SECRET_KEY 
EXT_PUBLIC_KEY 
EXT_SECRET_KEY 
MAX_BASE58_TYPES 

Definition at line 79 of file chainparams.h.

Constructor & Destructor Documentation

◆ CChainParams()

CChainParams::CChainParams ( )
protecteddefault

Member Function Documentation

◆ AssumedBlockchainSize()

uint64_t CChainParams::AssumedBlockchainSize ( ) const
inline

Minimum free space (in GB) needed for data directory.

Definition at line 103 of file chainparams.h.

◆ AssumedChainStateSize()

uint64_t CChainParams::AssumedChainStateSize ( ) const
inline

Minimum free space (in GB) needed for data directory when pruned; Does not include prune target.

Definition at line 105 of file chainparams.h.

◆ AssumeutxoForBlockhash()

std::optional< AssumeutxoData > CChainParams::AssumeutxoForBlockhash ( const uint256 & blockhash) const
inline

Definition at line 123 of file chainparams.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssumeutxoForHeight()

std::optional< AssumeutxoData > CChainParams::AssumeutxoForHeight ( int height) const
inline

Definition at line 119 of file chainparams.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Base58Prefix()

const std::vector< unsigned char > & CChainParams::Base58Prefix ( Base58Type type) const
inline

Definition at line 114 of file chainparams.h.

Here is the caller graph for this function:

◆ Bech32HRP()

const std::string & CChainParams::Bech32HRP ( ) const
inline

Definition at line 115 of file chainparams.h.

◆ DefaultConsistencyChecks()

bool CChainParams::DefaultConsistencyChecks ( ) const
inline

Default value for -checkmempool and -checkblockindex argument.

Definition at line 96 of file chainparams.h.

Here is the caller graph for this function:

◆ DNSSeeds()

const std::vector< std::string > & CChainParams::DNSSeeds ( ) const
inline

Return the list of hostnames to look up for DNS seeds.

Definition at line 113 of file chainparams.h.

◆ FixedSeeds()

const std::vector< uint8_t > & CChainParams::FixedSeeds ( ) const
inline

Definition at line 116 of file chainparams.h.

◆ GenesisBlock()

const CBlock & CChainParams::GenesisBlock ( ) const
inline

Definition at line 94 of file chainparams.h.

Here is the caller graph for this function:

◆ GetAvailableSnapshotHeights()

std::vector< int > CChainParams::GetAvailableSnapshotHeights ( ) const

Definition at line 716 of file chainparams.cpp.

◆ GetChainType()

ChainType CChainParams::GetChainType ( ) const
inline

Return the chain type.

Definition at line 111 of file chainparams.h.

Here is the caller graph for this function:

◆ GetChainTypeString()

std::string CChainParams::GetChainTypeString ( ) const
inline

Return the chain type string.

Definition at line 109 of file chainparams.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConsensus()

const Consensus::Params & CChainParams::GetConsensus ( ) const
inline

Definition at line 89 of file chainparams.h.

Here is the caller graph for this function:

◆ GetDefaultPort()

uint16_t CChainParams::GetDefaultPort ( ) const
inline

Definition at line 91 of file chainparams.h.

Here is the caller graph for this function:

◆ HeadersSync()

const HeadersSyncParams & CChainParams::HeadersSync ( ) const
inline

Definition at line 117 of file chainparams.h.

Here is the caller graph for this function:

◆ IsMockableChain()

bool CChainParams::IsMockableChain ( ) const
inline

If this chain allows time to be mocked.

Definition at line 100 of file chainparams.h.

◆ IsTestChain()

bool CChainParams::IsTestChain ( ) const
inline

If this chain is exclusively used for testing.

Definition at line 98 of file chainparams.h.

Here is the caller graph for this function:

◆ Main()

std::unique_ptr< const CChainParams > CChainParams::Main ( )
static

Definition at line 701 of file chainparams.cpp.

Here is the caller graph for this function:

◆ MessageStart()

const MessageStartChars & CChainParams::MessageStart ( ) const
inline

Definition at line 90 of file chainparams.h.

Here is the caller graph for this function:

◆ MineBlocksOnDemand()

bool CChainParams::MineBlocksOnDemand ( ) const
inline

Whether it is possible to mine blocks on demand (no retargeting).

Definition at line 107 of file chainparams.h.

◆ PruneAfterHeight()

uint64_t CChainParams::PruneAfterHeight ( ) const
inline

Definition at line 101 of file chainparams.h.

Here is the caller graph for this function:

◆ RegTest()

std::unique_ptr< const CChainParams > CChainParams::RegTest ( const RegTestOptions & options)
static

Definition at line 696 of file chainparams.cpp.

Here is the caller graph for this function:

◆ SigNet()

std::unique_ptr< const CChainParams > CChainParams::SigNet ( const SigNetOptions & options)
static

Definition at line 691 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TestNet()

std::unique_ptr< const CChainParams > CChainParams::TestNet ( )
static

Definition at line 706 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TestNet4()

std::unique_ptr< const CChainParams > CChainParams::TestNet4 ( )
static

Definition at line 711 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TxData()

const ChainTxData & CChainParams::TxData ( ) const
inline

Definition at line 128 of file chainparams.h.

Here is the caller graph for this function:

Member Data Documentation

◆ base58Prefixes

std::vector<unsigned char> CChainParams::base58Prefixes[MAX_BASE58_TYPES]
protected

Definition at line 173 of file chainparams.h.

◆ bech32_hrp

std::string CChainParams::bech32_hrp
protected

Definition at line 174 of file chainparams.h.

◆ chainTxData

ChainTxData CChainParams::chainTxData
protected

Definition at line 181 of file chainparams.h.

◆ consensus

Consensus::Params CChainParams::consensus
protected

Definition at line 166 of file chainparams.h.

◆ fDefaultConsistencyChecks

bool CChainParams::fDefaultConsistencyChecks
protected

Definition at line 178 of file chainparams.h.

◆ genesis

CBlock CChainParams::genesis
protected

Definition at line 176 of file chainparams.h.

◆ m_assumed_blockchain_size

uint64_t CChainParams::m_assumed_blockchain_size
protected

Definition at line 170 of file chainparams.h.

◆ m_assumed_chain_state_size

uint64_t CChainParams::m_assumed_chain_state_size
protected

Definition at line 171 of file chainparams.h.

◆ m_assumeutxo_data

std::vector<AssumeutxoData> CChainParams::m_assumeutxo_data
protected

Definition at line 180 of file chainparams.h.

◆ m_chain_type

ChainType CChainParams::m_chain_type
protected

Definition at line 175 of file chainparams.h.

◆ m_headers_sync_params

HeadersSyncParams CChainParams::m_headers_sync_params
protected

Definition at line 182 of file chainparams.h.

◆ m_is_mockable_chain

bool CChainParams::m_is_mockable_chain
protected

Definition at line 179 of file chainparams.h.

◆ nDefaultPort

uint16_t CChainParams::nDefaultPort
protected

Definition at line 168 of file chainparams.h.

◆ nPruneAfterHeight

uint64_t CChainParams::nPruneAfterHeight
protected

Definition at line 169 of file chainparams.h.

◆ pchMessageStart

MessageStartChars CChainParams::pchMessageStart
protected

Definition at line 167 of file chainparams.h.

◆ vFixedSeeds

std::vector<uint8_t> CChainParams::vFixedSeeds
protected

Definition at line 177 of file chainparams.h.

◆ vSeeds

std::vector<std::string> CChainParams::vSeeds
protected

Definition at line 172 of file chainparams.h.


The documentation for this class was generated from the following files: