5#include <chainparams.h>
16#include <boost/test/unit_test.hpp>
58 testNode = std::make_unique<CSeederNodeTest>(service, &
vAddr);
80 std::string
user_agent =
"/Bitcoin ABC:0.0.0(seeder)/";
179 for (
size_t i = 1; i < 10; i++) {
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CChainParams & Params()
Return the currently selected parameters.
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
static const std::string REGTEST
const CMessageHeader::MessageMagic & NetMagic() const
const CCheckpointData & Checkpoints() const
Double ended buffer combining vector and stream-like interfaces.
bool SetInternal(const std::string &name)
Create an "internal" address that represents a name or FQDN.
friend class ::CSeederNodeTest
PeerMessagingState ProcessMessage(std::string strCommand, CDataStream &recv)
A combination of a network address (CNetAddr) and a (TCP) port.
static node::NodeContext testNode
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
static const unsigned int MAX_HEADERS_RESULTS
Number of headers sent in one getheaders result.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
static const uint16_t SERVICE_PORT
static CDataStream CreateAddrMessage(std::vector< CAddress > sendAddrs, uint32_t nVersion=INIT_PROTO_VERSION)
std::ostream & operator<<(std::ostream &os, const PeerMessagingState &state)
BOOST_FIXTURE_TEST_CASE(process_verack_msg, MainNetSeederTestingSetup)
BOOST_AUTO_TEST_CASE(process_version_msg)
static const int SEEDER_INIT_VERSION
ServiceFlags
nServices flags.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static const unsigned int ADDR_SOFT_CAP
static int GetRequireHeight()
constexpr std::underlying_type< E >::type to_integral(E e)
void WriteCompactSize(CSizeComputer &os, uint64_t nSize)
A BlockHash is a unqiue identifier for a block.
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
MapCheckpoints mapCheckpoints
MainNetSeederTestingSetup()
std::vector< CAddress > vAddr
std::unique_ptr< CSeederNodeTest > testNode
SeederTestingSetup(const std::string chain=CBaseChainParams::REGTEST)
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation