6#ifndef ALTINTEGRATION_CONFIG_HPP___
7#define ALTINTEGRATION_CONFIG_HPP___
12#include "blockchain/alt_chain_params.hpp"
13#include "blockchain/btc_chain_params.hpp"
14#include "blockchain/vbk_chain_params.hpp"
16#include "stateless_validation.hpp"
43 template <
typename Block,
typename ChainParams>
58 const std::vector<std::string>& hexblocks,
59 std::shared_ptr<ChainParams>
params) {
64 b.
blocks.reserve(hexblocks.size());
65 std::transform(hexblocks.begin(),
67 std::back_inserter(b.
blocks),
68 AssertDeserializeFromRawHex<Block>);
74 std::shared_ptr<AltChainParams> alt;
75 Bootstrap<BtcBlock, BtcChainParams> btc;
76 Bootstrap<VbkBlock, VbkChainParams> vbk;
82 void SelectBtcParams(std::string net,
84 const std::vector<std::string>& blocks);
85 void SelectVbkParams(std::string net,
87 const std::vector<std::string>& blocks);
88 void SelectAltParams(std::shared_ptr<AltChainParams> param);
92 const std::vector<std::string>& hexblocks,
93 std::shared_ptr<BtcChainParams> params);
97 const std::vector<std::string>& hexblocks,
98 std::shared_ptr<VbkChainParams> params);
Base class for all Altchain-related configs.
base class for BTC params
per-chain bootstrap config
std::vector< Block > blocks
a contiguous list of blocks.
static Bootstrap create(int32_t start, const std::vector< std::string > &hexblocks, std::shared_ptr< ChainParams > params)
factory method to create this config from vector of hexencoded blocks
int32_t startHeight
height of the first bootstrap block
std::shared_ptr< ChainParams > params
network parameters - Mainnet/Testnet/Regtest...
A container for Bitcoin and Veriblock configuration data.
void validate() const
Validates config instance.
void setVBK(int32_t start, const std::vector< std::string > &hexblocks, std::shared_ptr< VbkChainParams > params)
helper, which converts array of hexstrings (blocks) into "Bootstrap" type
void setBTC(int32_t start, const std::vector< std::string > &hexblocks, std::shared_ptr< BtcChainParams > params)
helper, which converts array of hexstrings (blocks) into "Bootstrap" type
VeriBlock chain parameters.