Raven Core  3.0.0
P2P Digital Currency
chainparams.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2019 The Raven Core developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #ifndef RAVEN_CHAINPARAMS_H
8 #define RAVEN_CHAINPARAMS_H
9 
10 #include "chainparamsbase.h"
11 #include "consensus/params.h"
12 #include "primitives/block.h"
13 #include "protocol.h"
14 
15 #include <memory>
16 #include <vector>
17 
18 struct CDNSSeedData {
19  std::string host;
21  CDNSSeedData(const std::string &strHost, bool supportsServiceBitsFilteringIn) : host(strHost), supportsServiceBitsFiltering(supportsServiceBitsFilteringIn) {}
22 };
23 
24 struct SeedSpec6 {
25  uint8_t addr[16];
26  uint16_t port;
27 };
28 
29 typedef std::map<int, uint256> MapCheckpoints;
30 
33 };
34 
35 struct ChainTxData {
36  int64_t nTime;
37  int64_t nTxCount;
38  double dTxRate;
39 };
40 
49 {
50 public:
51  enum Base58Type {
57 
58  MAX_BASE58_TYPES
59  };
60 
61  const Consensus::Params& GetConsensus() const { return consensus; }
62  const CMessageHeader::MessageStartChars& MessageStart() const { return pchMessageStart; }
63  int GetDefaultPort() const { return nDefaultPort; }
64 
65  bool MiningRequiresPeers() const {return fMiningRequiresPeers; }
66  const CBlock& GenesisBlock() const { return genesis; }
68  bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
70  bool RequireStandard() const { return fRequireStandard; }
71  uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
73  bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
75  std::string NetworkIDString() const { return strNetworkID; }
76  const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
77  const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
78  const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
79  const CCheckpointData& Checkpoints() const { return checkpointData; }
80  const ChainTxData& TxData() const { return chainTxData; }
81  void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
82  void TurnOffSegwit();
83  void TurnOffCSV();
84  void TurnOffBIP34();
85  void TurnOffBIP65();
86  void TurnOffBIP66();
87  bool BIP34();
88  bool BIP65();
89  bool BIP66();
90  bool CSVEnabled() const;
91 
93  const CAmount& IssueAssetBurnAmount() const { return nIssueAssetBurnAmount; }
94  const CAmount& ReissueAssetBurnAmount() const { return nReissueAssetBurnAmount; }
95  const CAmount& IssueSubAssetBurnAmount() const { return nIssueSubAssetBurnAmount; }
96  const CAmount& IssueUniqueAssetBurnAmount() const { return nIssueUniqueAssetBurnAmount; }
97  const CAmount& IssueMsgChannelAssetBurnAmount() const { return nIssueMsgChannelAssetBurnAmount; }
98  const CAmount& IssueQualifierAssetBurnAmount() const { return nIssueQualifierAssetBurnAmount; }
99  const CAmount& IssueSubQualifierAssetBurnAmount() const { return nIssueSubQualifierAssetBurnAmount; }
100  const CAmount& IssueRestrictedAssetBurnAmount() const { return nIssueRestrictedAssetBurnAmount; }
101  const CAmount& AddNullQualifierTagBurnAmount() const { return nAddNullQualifierTagBurnAmount; }
102 
103  const std::string& IssueAssetBurnAddress() const { return strIssueAssetBurnAddress; }
104  const std::string& ReissueAssetBurnAddress() const { return strReissueAssetBurnAddress; }
105  const std::string& IssueSubAssetBurnAddress() const { return strIssueSubAssetBurnAddress; }
106  const std::string& IssueUniqueAssetBurnAddress() const { return strIssueUniqueAssetBurnAddress; }
107  const std::string& IssueMsgChannelAssetBurnAddress() const { return strIssueMsgChannelAssetBurnAddress; }
108  const std::string& IssueQualifierAssetBurnAddress() const { return strIssueQualifierAssetBurnAddress; }
109  const std::string& IssueSubQualifierAssetBurnAddress() const { return strIssueSubQualifierAssetBurnAddress; }
110  const std::string& IssueRestrictedAssetBurnAddress() const { return strIssueRestrictedAssetBurnAddress; }
111  const std::string& AddNullQualifierTagBurnAddress() const { return strAddNullQualifierTagBurnAddress; }
112  const std::string& GlobalBurnAddress() const { return strGlobalBurnAddress; }
113 
114  unsigned int DGWActivationBlock() const { return nDGWActivationBlock; }
115  unsigned int MessagingActivationBlock() const { return nMessagingActivationBlock; }
116  unsigned int RestrictedActivationBlock() const { return nRestrictedActivationBlock; }
117 
118  int MaxReorganizationDepth() const { return nMaxReorganizationDepth; }
119  int MinReorganizationPeers() const { return nMinReorganizationPeers; }
120  int MinReorganizationAge() const { return nMinReorganizationAge; }
121 
122  int GetAssetActivationHeight() const { return nAssetActivationHeight; }
125 protected:
127 
132  std::vector<CDNSSeedData> vSeeds;
133  std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
134  std::string strNetworkID;
136  std::vector<SeedSpec6> vFixedSeeds;
143 
145  // Burn Amounts
155 
156  // Burn Addresses
166 
167  // Global Burn Address
168  std::string strGlobalBurnAddress;
169 
170  unsigned int nDGWActivationBlock;
173 
177 
180 };
181 
187 std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain);
188 
193 const CChainParams &Params();
194 
199 void SelectParams(const std::string& chain);
200 
204 void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);
205 
206 void TurnOffSegwit();
207 
208 void TurnOffBIP34();
209 
210 void TurnOffBIP65();
211 
212 void TurnOffBIP66();
213 
214 void TurnOffCSV();
215 
216 #endif // RAVEN_CHAINPARAMS_H
CChainParams()
RVN End.
Definition: chainparams.h:126
std::string NetworkIDString() const
Return the BIP70 network string (main, test or regtest)
Definition: chainparams.h:75
const std::string & IssueUniqueAssetBurnAddress() const
Definition: chainparams.h:106
bool fMineBlocksOnDemand
Definition: chainparams.h:139
std::string host
Definition: chainparams.h:19
int nAssetActivationHeight
Definition: chainparams.h:178
void TurnOffBIP34()
CAmount nIssueSubQualifierAssetBurnAmount
Definition: chainparams.h:152
CAmount nIssueSubAssetBurnAmount
Definition: chainparams.h:148
double dTxRate
Definition: chainparams.h:38
const CAmount & IssueQualifierAssetBurnAmount() const
Definition: chainparams.h:98
std::map< int, uint256 > MapCheckpoints
Definition: chainparams.h:29
void TurnOffBIP66()
CAmount nIssueAssetBurnAmount
RVN Start.
Definition: chainparams.h:146
Definition: block.h:73
const CAmount & IssueSubQualifierAssetBurnAmount() const
Definition: chainparams.h:99
unsigned int MessagingActivationBlock() const
Definition: chainparams.h:115
unsigned int RestrictedActivationBlock() const
Definition: chainparams.h:116
int MinReorganizationAge() const
Definition: chainparams.h:120
int nMinReorganizationAge
Definition: chainparams.h:176
const CAmount & IssueMsgChannelAssetBurnAmount() const
Definition: chainparams.h:97
bool DefaultConsistencyChecks() const
Default value for -checkmempool and -checkblockindex argument.
Definition: chainparams.h:68
std::string strIssueSubAssetBurnAddress
Definition: chainparams.h:159
const CBlock & GenesisBlock() const
Definition: chainparams.h:66
const std::string & IssueSubQualifierAssetBurnAddress() const
Definition: chainparams.h:109
CChainParams defines various tweakable parameters of a given instance of the Raven system...
Definition: chainparams.h:48
std::string strAddNullQualifierTagBurnAddress
Definition: chainparams.h:165
CBlock genesis
Definition: chainparams.h:135
std::string strIssueSubQualifierAssetBurnAddress
Definition: chainparams.h:163
std::string strIssueUniqueAssetBurnAddress
Definition: chainparams.h:160
int MaxReorganizationDepth() const
Definition: chainparams.h:118
int64_t nTime
Definition: chainparams.h:36
int MinReorganizationPeers() const
Definition: chainparams.h:119
const CCheckpointData & Checkpoints() const
Definition: chainparams.h:79
const CAmount & IssueUniqueAssetBurnAmount() const
Definition: chainparams.h:96
CAmount nReissueAssetBurnAmount
Definition: chainparams.h:147
CAmount nIssueUniqueAssetBurnAmount
Definition: chainparams.h:149
CMessageHeader::MessageStartChars pchMessageStart
Definition: chainparams.h:129
const std::string & ReissueAssetBurnAddress() const
Definition: chainparams.h:104
ChainTxData chainTxData
Definition: chainparams.h:142
int64_t nTxCount
Definition: chainparams.h:37
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
bool supportsServiceBitsFiltering
Definition: chainparams.h:20
uint64_t PruneAfterHeight() const
Definition: chainparams.h:71
const std::string & IssueMsgChannelAssetBurnAddress() const
Definition: chainparams.h:107
uint16_t port
Definition: chainparams.h:26
bool MineBlocksOnDemand() const
Make miner stop after a block is found.
Definition: chainparams.h:73
DeploymentPos
Definition: params.h:16
bool fRequireStandard
Definition: chainparams.h:138
std::string strIssueRestrictedAssetBurnAddress
Definition: chainparams.h:164
const std::string & GlobalBurnAddress() const
Definition: chainparams.h:112
bool MiningRequiresPeers() const
Definition: chainparams.h:65
void SelectParams(const std::string &chain)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CAmount & ReissueAssetBurnAmount() const
Definition: chainparams.h:94
const CMessageHeader::MessageStartChars & MessageStart() const
Definition: chainparams.h:62
void TurnOffBIP65()
int GetDefaultPort() const
Definition: chainparams.h:63
const std::string & IssueQualifierAssetBurnAddress() const
Definition: chainparams.h:108
const std::string & IssueRestrictedAssetBurnAddress() const
Definition: chainparams.h:110
Parameters that influence chain consensus.
Definition: params.h:47
const std::string & AddNullQualifierTagBurnAddress() const
Definition: chainparams.h:111
int nMinReorganizationPeers
Definition: chainparams.h:175
CAmount nIssueQualifierAssetBurnAmount
Definition: chainparams.h:151
std::vector< CDNSSeedData > vSeeds
Definition: chainparams.h:132
unsigned char MessageStartChars[MESSAGE_START_SIZE]
Definition: protocol.h:41
void TurnOffSegwit()
std::string strReissueAssetBurnAddress
Definition: chainparams.h:158
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
Allows modifying the Version Bits regtest parameters.
const std::vector< CDNSSeedData > & DNSSeeds() const
Definition: chainparams.h:76
const CAmount & IssueAssetBurnAmount() const
RVN Start.
Definition: chainparams.h:93
void TurnOffCSV()
int GetAssetActivationHeight() const
Definition: chainparams.h:122
std::string strIssueAssetBurnAddress
Definition: chainparams.h:157
bool RequireStandard() const
Policy: Filter transactions that do not match well-defined patterns.
Definition: chainparams.h:70
int nMaxReorganizationDepth
Definition: chainparams.h:174
const CChainParams & Params()
Return the currently selected parameters.
const ChainTxData & TxData() const
Definition: chainparams.h:80
std::vector< SeedSpec6 > vFixedSeeds
Definition: chainparams.h:136
const std::string & IssueSubAssetBurnAddress() const
Definition: chainparams.h:105
bool fRequireStandard
Definition: validation.cpp:91
MapCheckpoints mapCheckpoints
Definition: chainparams.h:32
std::string strGlobalBurnAddress
Definition: chainparams.h:168
Consensus::Params consensus
Definition: chainparams.h:128
CAmount nIssueMsgChannelAssetBurnAmount
Definition: chainparams.h:150
const CAmount & IssueRestrictedAssetBurnAmount() const
Definition: chainparams.h:100
std::string strNetworkID
Definition: chainparams.h:134
bool fMiningRequiresPeers
Definition: chainparams.h:140
const std::vector< SeedSpec6 > & FixedSeeds() const
Definition: chainparams.h:78
unsigned int nDGWActivationBlock
Definition: chainparams.h:170
unsigned int DGWActivationBlock() const
Definition: chainparams.h:114
const std::string & IssueAssetBurnAddress() const
Definition: chainparams.h:103
uint64_t nPruneAfterHeight
Definition: chainparams.h:131
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:61
std::string strIssueQualifierAssetBurnAddress
Definition: chainparams.h:162
CCheckpointData checkpointData
Definition: chainparams.h:141
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
CDNSSeedData(const std::string &strHost, bool supportsServiceBitsFilteringIn)
Definition: chainparams.h:21
std::string strIssueMsgChannelAssetBurnAddress
Definition: chainparams.h:161
unsigned int nRestrictedActivationBlock
Definition: chainparams.h:172
CAmount nIssueRestrictedAssetBurnAmount
Definition: chainparams.h:153
unsigned int nMessagingActivationBlock
Definition: chainparams.h:171
CAmount nAddNullQualifierTagBurnAmount
Definition: chainparams.h:154
const CAmount & IssueSubAssetBurnAmount() const
Definition: chainparams.h:95
const CAmount & AddNullQualifierTagBurnAmount() const
Definition: chainparams.h:101
bool fDefaultConsistencyChecks
Definition: chainparams.h:137
const std::vector< unsigned char > & Base58Prefix(Base58Type type) const
Definition: chainparams.h:77