Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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  RegTestOptions
 RegTestOptions holds configurations for creating a regtest CChainParams. More...
 
struct  SigNetOptions
 SigNetOptions holds configurations for creating a signet CChainParams. More...
 
struct  VersionBitsParameters
 VersionBitsParameters holds activation parameters. 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. More...
 
bool IsTestChain () const
 If this chain is exclusively used for testing. More...
 
bool IsMockableChain () const
 If this chain allows time to be mocked. More...
 
uint64_t PruneAfterHeight () const
 
uint64_t AssumedBlockchainSize () const
 Minimum free space (in GB) needed for data directory. More...
 
uint64_t AssumedChainStateSize () const
 Minimum free space (in GB) needed for data directory when pruned; Does not include prune target. More...
 
bool MineBlocksOnDemand () const
 Whether it is possible to mine blocks on demand (no retargeting) More...
 
std::string GetChainTypeString () const
 Return the chain type string. More...
 
ChainType GetChainType () const
 Return the chain type. More...
 
const std::vector< std::string > & DNSSeeds () const
 Return the list of hostnames to look up for DNS seeds. More...
 
const std::vector< unsigned char > & Base58Prefix (Base58Type type) const
 
const std::string & Bech32HRP () const
 
const std::vector< uint8_t > & FixedSeeds () const
 
const CCheckpointDataCheckpoints () 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
 
CCheckpointData checkpointData
 
std::vector< AssumeutxoDatam_assumeutxo_data
 
ChainTxData chainTxData
 

Detailed Description

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

Definition at line 80 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 83 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 107 of file chainparams.h.

Here is the caller graph for this function:

◆ 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 109 of file chainparams.h.

◆ AssumeutxoForBlockhash()

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

Definition at line 127 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 123 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 118 of file chainparams.h.

Here is the caller graph for this function:

◆ Bech32HRP()

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

Definition at line 119 of file chainparams.h.

◆ Checkpoints()

const CCheckpointData & CChainParams::Checkpoints ( ) const
inline

Definition at line 121 of file chainparams.h.

◆ DefaultConsistencyChecks()

bool CChainParams::DefaultConsistencyChecks ( ) const
inline

Default value for -checkmempool and -checkblockindex argument.

Definition at line 100 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 117 of file chainparams.h.

Here is the caller graph for this function:

◆ FixedSeeds()

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

Definition at line 120 of file chainparams.h.

Here is the caller graph for this function:

◆ GenesisBlock()

const CBlock & CChainParams::GenesisBlock ( ) const
inline

Definition at line 98 of file chainparams.h.

Here is the caller graph for this function:

◆ GetAvailableSnapshotHeights()

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

Definition at line 680 of file chainparams.cpp.

Here is the caller graph for this function:

◆ GetChainType()

ChainType CChainParams::GetChainType ( ) const
inline

Return the chain type.

Definition at line 115 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 113 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 93 of file chainparams.h.

Here is the caller graph for this function:

◆ GetDefaultPort()

uint16_t CChainParams::GetDefaultPort ( ) const
inline

Definition at line 95 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 104 of file chainparams.h.

Here is the caller graph for this function:

◆ IsTestChain()

bool CChainParams::IsTestChain ( ) const
inline

If this chain is exclusively used for testing.

Definition at line 102 of file chainparams.h.

Here is the caller graph for this function:

◆ Main()

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

Definition at line 665 of file chainparams.cpp.

Here is the caller graph for this function:

◆ MessageStart()

const MessageStartChars & CChainParams::MessageStart ( ) const
inline

Definition at line 94 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 111 of file chainparams.h.

◆ PruneAfterHeight()

uint64_t CChainParams::PruneAfterHeight ( ) const
inline

Definition at line 105 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 660 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 655 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TestNet()

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

Definition at line 670 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TestNet4()

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

Definition at line 675 of file chainparams.cpp.

Here is the caller graph for this function:

◆ TxData()

const ChainTxData & CChainParams::TxData ( ) const
inline

Definition at line 132 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 177 of file chainparams.h.

◆ bech32_hrp

std::string CChainParams::bech32_hrp
protected

Definition at line 178 of file chainparams.h.

◆ chainTxData

ChainTxData CChainParams::chainTxData
protected

Definition at line 186 of file chainparams.h.

◆ checkpointData

CCheckpointData CChainParams::checkpointData
protected

Definition at line 184 of file chainparams.h.

◆ consensus

Consensus::Params CChainParams::consensus
protected

Definition at line 170 of file chainparams.h.

◆ fDefaultConsistencyChecks

bool CChainParams::fDefaultConsistencyChecks
protected

Definition at line 182 of file chainparams.h.

◆ genesis

CBlock CChainParams::genesis
protected

Definition at line 180 of file chainparams.h.

◆ m_assumed_blockchain_size

uint64_t CChainParams::m_assumed_blockchain_size
protected

Definition at line 174 of file chainparams.h.

◆ m_assumed_chain_state_size

uint64_t CChainParams::m_assumed_chain_state_size
protected

Definition at line 175 of file chainparams.h.

◆ m_assumeutxo_data

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

Definition at line 185 of file chainparams.h.

◆ m_chain_type

ChainType CChainParams::m_chain_type
protected

Definition at line 179 of file chainparams.h.

◆ m_is_mockable_chain

bool CChainParams::m_is_mockable_chain
protected

Definition at line 183 of file chainparams.h.

◆ nDefaultPort

uint16_t CChainParams::nDefaultPort
protected

Definition at line 172 of file chainparams.h.

◆ nPruneAfterHeight

uint64_t CChainParams::nPruneAfterHeight
protected

Definition at line 173 of file chainparams.h.

◆ pchMessageStart

MessageStartChars CChainParams::pchMessageStart
protected

Definition at line 171 of file chainparams.h.

◆ vFixedSeeds

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

Definition at line 181 of file chainparams.h.

◆ vSeeds

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

Definition at line 176 of file chainparams.h.


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