Bitcoin Core  0.15.99
P2P Digital Currency
Public Types | Public Member Functions | List of all members
interfaces::Node Class Referenceabstract

Top-level interface for a bitcoin node (bitcoind process). More...

#include <node.h>

Public Types

using NodesStats = std::vector< std::tuple< CNodeStats, bool, CNodeStateStats >>
 Get stats for connected nodes. More...
 
using InitMessageFn = std::function< void(const std::string &message)>
 Register handler for init messages. More...
 
using MessageBoxFn = std::function< bool(const std::string &message, const std::string &caption, unsigned int style)>
 Register handler for message box messages. More...
 
using QuestionFn = std::function< bool(const std::string &message, const std::string &non_interactive_message, const std::string &caption, unsigned int style)>
 Register handler for question messages. More...
 
using ShowProgressFn = std::function< void(const std::string &title, int progress, bool resume_possible)>
 Register handler for progress messages. More...
 
using LoadWalletFn = std::function< void(std::unique_ptr< Wallet > wallet)>
 Register handler for load wallet messages. More...
 
using NotifyNumConnectionsChangedFn = std::function< void(int new_num_connections)>
 Register handler for number of connections changed messages. More...
 
using NotifyNetworkActiveChangedFn = std::function< void(bool network_active)>
 Register handler for network active messages. More...
 
using NotifyAlertChangedFn = std::function< void()>
 Register handler for notify alert messages. More...
 
using BannedListChangedFn = std::function< void()>
 Register handler for ban list messages. More...
 
using NotifyBlockTipFn = std::function< void(bool initial_download, int height, int64_t block_time, double verification_progress)>
 Register handler for block tip messages. More...
 
using NotifyHeaderTipFn = std::function< void(bool initial_download, int height, int64_t block_time, double verification_progress)>
 Register handler for header tip messages. More...
 

Public Member Functions

virtual ~Node ()
 
virtual void parseParameters (int argc, const char *const argv[])=0
 Set command line arguments. More...
 
virtual bool softSetArg (const std::string &arg, const std::string &value)=0
 Set a command line argument if it doesn't already have a value. More...
 
virtual bool softSetBoolArg (const std::string &arg, bool value)=0
 Set a command line boolean argument if it doesn't already have a value. More...
 
virtual void readConfigFile (const std::string &conf_path)=0
 Load settings from configuration file. More...
 
virtual void selectParams (const std::string &network)=0
 Choose network parameters. More...
 
virtual std::string getNetwork ()=0
 Get network name. More...
 
virtual void initLogging ()=0
 Init logging. More...
 
virtual void initParameterInteraction ()=0
 Init parameter interaction. More...
 
virtual std::string getWarnings (const std::string &type)=0
 Get warnings. More...
 
virtual uint32_t getLogCategories ()=0
 
virtual bool baseInitialize ()=0
 Initialize app dependencies. More...
 
virtual bool appInitMain ()=0
 Start node. More...
 
virtual void appShutdown ()=0
 Stop node. More...
 
virtual void startShutdown ()=0
 Start shutdown. More...
 
virtual bool shutdownRequested ()=0
 Return whether shutdown was requested. More...
 
virtual std::string helpMessage (HelpMessageMode mode)=0
 Get help message string. More...
 
virtual void mapPort (bool use_upnp)=0
 Map port. More...
 
virtual bool getProxy (Network net, proxyType &proxy_info)=0
 Get proxy. More...
 
virtual size_t getNodeCount (CConnman::NumConnections flags)=0
 Get number of connections. More...
 
virtual bool getNodesStats (NodesStats &stats)=0
 
virtual bool getBanned (banmap_t &banmap)=0
 Get ban map entries. More...
 
virtual bool ban (const CNetAddr &net_addr, BanReason reason, int64_t ban_time_offset)=0
 Ban node. More...
 
virtual bool unban (const CSubNet &ip)=0
 Unban node. More...
 
virtual bool disconnect (NodeId id)=0
 Disconnect node. More...
 
virtual int64_t getTotalBytesRecv ()=0
 Get total bytes recv. More...
 
virtual int64_t getTotalBytesSent ()=0
 Get total bytes sent. More...
 
virtual size_t getMempoolSize ()=0
 Get mempool size. More...
 
virtual size_t getMempoolDynamicUsage ()=0
 Get mempool dynamic usage. More...
 
virtual bool getHeaderTip (int &height, int64_t &block_time)=0
 Get header tip height and time. More...
 
virtual int getNumBlocks ()=0
 Get num blocks. More...
 
virtual int64_t getLastBlockTime ()=0
 Get last block time. More...
 
virtual double getVerificationProgress ()=0
 Get verification progress. More...
 
virtual bool isInitialBlockDownload ()=0
 Is initial block download. More...
 
virtual bool getReindex ()=0
 Get reindex. More...
 
virtual bool getImporting ()=0
 Get importing. More...
 
virtual void setNetworkActive (bool active)=0
 Set network active. More...
 
virtual bool getNetworkActive ()=0
 Get network active. More...
 
virtual CAmount getMaxTxFee ()=0
 Get max tx fee. More...
 
virtual CFeeRate estimateSmartFee (int num_blocks, bool conservative, int *returned_target=nullptr)=0
 Estimate smart fee. More...
 
virtual CFeeRate getDustRelayFee ()=0
 Get dust relay fee. More...
 
virtual UniValue executeRpc (const std::string &command, const UniValue &params, const std::string &uri)=0
 Execute rpc command. More...
 
virtual std::vector< std::string > listRpcCommands ()=0
 List rpc commands. More...
 
virtual void rpcSetTimerInterfaceIfUnset (RPCTimerInterface *iface)=0
 Set RPC timer interface if unset. More...
 
virtual void rpcUnsetTimerInterface (RPCTimerInterface *iface)=0
 Unset RPC timer interface. More...
 
virtual bool getUnspentOutput (const COutPoint &output, Coin &coin)=0
 Get unspent outputs associated with a transaction. More...
 
virtual std::vector< std::unique_ptr< Wallet > > getWallets ()=0
 Return interfaces for accessing wallets (if any). More...
 
virtual std::unique_ptr< HandlerhandleInitMessage (InitMessageFn fn)=0
 
virtual std::unique_ptr< HandlerhandleMessageBox (MessageBoxFn fn)=0
 
virtual std::unique_ptr< HandlerhandleQuestion (QuestionFn fn)=0
 
virtual std::unique_ptr< HandlerhandleShowProgress (ShowProgressFn fn)=0
 
virtual std::unique_ptr< HandlerhandleLoadWallet (LoadWalletFn fn)=0
 
virtual std::unique_ptr< HandlerhandleNotifyNumConnectionsChanged (NotifyNumConnectionsChangedFn fn)=0
 
virtual std::unique_ptr< HandlerhandleNotifyNetworkActiveChanged (NotifyNetworkActiveChangedFn fn)=0
 
virtual std::unique_ptr< HandlerhandleNotifyAlertChanged (NotifyAlertChangedFn fn)=0
 
virtual std::unique_ptr< HandlerhandleBannedListChanged (BannedListChangedFn fn)=0
 
virtual std::unique_ptr< HandlerhandleNotifyBlockTip (NotifyBlockTipFn fn)=0
 
virtual std::unique_ptr< HandlerhandleNotifyHeaderTip (NotifyHeaderTipFn fn)=0
 

Detailed Description

Top-level interface for a bitcoin node (bitcoind process).

Definition at line 36 of file node.h.

Member Typedef Documentation

using interfaces::Node::BannedListChangedFn = std::function<void()>

Register handler for ban list messages.

Definition at line 217 of file node.h.

using interfaces::Node::InitMessageFn = std::function<void(const std::string& message)>

Register handler for init messages.

Definition at line 181 of file node.h.

using interfaces::Node::LoadWalletFn = std::function<void(std::unique_ptr<Wallet> wallet)>

Register handler for load wallet messages.

Definition at line 201 of file node.h.

using interfaces::Node::MessageBoxFn = std::function<bool(const std::string& message, const std::string& caption, unsigned int style)>

Register handler for message box messages.

Definition at line 186 of file node.h.

using interfaces::Node::NodesStats = std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>

Get stats for connected nodes.

Definition at line 99 of file node.h.

using interfaces::Node::NotifyAlertChangedFn = std::function<void()>

Register handler for notify alert messages.

Definition at line 213 of file node.h.

using interfaces::Node::NotifyBlockTipFn = std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>

Register handler for block tip messages.

Definition at line 222 of file node.h.

using interfaces::Node::NotifyHeaderTipFn = std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>

Register handler for header tip messages.

Definition at line 227 of file node.h.

using interfaces::Node::NotifyNetworkActiveChangedFn = std::function<void(bool network_active)>

Register handler for network active messages.

Definition at line 209 of file node.h.

using interfaces::Node::NotifyNumConnectionsChangedFn = std::function<void(int new_num_connections)>

Register handler for number of connections changed messages.

Definition at line 205 of file node.h.

using interfaces::Node::QuestionFn = std::function<bool(const std::string& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style)>

Register handler for question messages.

Definition at line 193 of file node.h.

using interfaces::Node::ShowProgressFn = std::function<void(const std::string& title, int progress, bool resume_possible)>

Register handler for progress messages.

Definition at line 197 of file node.h.

Constructor & Destructor Documentation

virtual interfaces::Node::~Node ( )
inlinevirtual

Definition at line 39 of file node.h.

Here is the call graph for this function:

Member Function Documentation

virtual bool interfaces::Node::appInitMain ( )
pure virtual

Start node.

Here is the caller graph for this function:

virtual void interfaces::Node::appShutdown ( )
pure virtual

Stop node.

Here is the caller graph for this function:

virtual bool interfaces::Node::ban ( const CNetAddr net_addr,
BanReason  reason,
int64_t  ban_time_offset 
)
pure virtual

Ban node.

Here is the caller graph for this function:

virtual bool interfaces::Node::baseInitialize ( )
pure virtual

Initialize app dependencies.

Here is the caller graph for this function:

virtual bool interfaces::Node::disconnect ( NodeId  id)
pure virtual

Disconnect node.

Here is the caller graph for this function:

virtual CFeeRate interfaces::Node::estimateSmartFee ( int  num_blocks,
bool  conservative,
int *  returned_target = nullptr 
)
pure virtual

Estimate smart fee.

virtual UniValue interfaces::Node::executeRpc ( const std::string &  command,
const UniValue params,
const std::string &  uri 
)
pure virtual

Execute rpc command.

Here is the caller graph for this function:

virtual bool interfaces::Node::getBanned ( banmap_t banmap)
pure virtual

Get ban map entries.

Here is the caller graph for this function:

virtual CFeeRate interfaces::Node::getDustRelayFee ( )
pure virtual

Get dust relay fee.

Here is the caller graph for this function:

virtual bool interfaces::Node::getHeaderTip ( int &  height,
int64_t &  block_time 
)
pure virtual

Get header tip height and time.

Here is the caller graph for this function:

virtual bool interfaces::Node::getImporting ( )
pure virtual

Get importing.

Here is the caller graph for this function:

virtual int64_t interfaces::Node::getLastBlockTime ( )
pure virtual

Get last block time.

Here is the caller graph for this function:

virtual uint32_t interfaces::Node::getLogCategories ( )
pure virtual

Here is the caller graph for this function:

virtual CAmount interfaces::Node::getMaxTxFee ( )
pure virtual

Get max tx fee.

Here is the caller graph for this function:

virtual size_t interfaces::Node::getMempoolDynamicUsage ( )
pure virtual

Get mempool dynamic usage.

Here is the caller graph for this function:

virtual size_t interfaces::Node::getMempoolSize ( )
pure virtual

Get mempool size.

Here is the caller graph for this function:

virtual std::string interfaces::Node::getNetwork ( )
pure virtual

Get network name.

Here is the caller graph for this function:

virtual bool interfaces::Node::getNetworkActive ( )
pure virtual

Get network active.

Here is the caller graph for this function:

virtual size_t interfaces::Node::getNodeCount ( CConnman::NumConnections  flags)
pure virtual

Get number of connections.

Here is the caller graph for this function:

virtual bool interfaces::Node::getNodesStats ( NodesStats stats)
pure virtual

Here is the caller graph for this function:

virtual int interfaces::Node::getNumBlocks ( )
pure virtual

Get num blocks.

Here is the caller graph for this function:

virtual bool interfaces::Node::getProxy ( Network  net,
proxyType proxy_info 
)
pure virtual

Get proxy.

Here is the caller graph for this function:

virtual bool interfaces::Node::getReindex ( )
pure virtual

Get reindex.

Here is the caller graph for this function:

virtual int64_t interfaces::Node::getTotalBytesRecv ( )
pure virtual

Get total bytes recv.

Here is the caller graph for this function:

virtual int64_t interfaces::Node::getTotalBytesSent ( )
pure virtual

Get total bytes sent.

Here is the caller graph for this function:

virtual bool interfaces::Node::getUnspentOutput ( const COutPoint output,
Coin coin 
)
pure virtual

Get unspent outputs associated with a transaction.

Here is the caller graph for this function:

virtual double interfaces::Node::getVerificationProgress ( )
pure virtual

Get verification progress.

Here is the caller graph for this function:

virtual std::vector<std::unique_ptr<Wallet> > interfaces::Node::getWallets ( )
pure virtual

Return interfaces for accessing wallets (if any).

Here is the caller graph for this function:

virtual std::string interfaces::Node::getWarnings ( const std::string &  type)
pure virtual

Get warnings.

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleBannedListChanged ( BannedListChangedFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleInitMessage ( InitMessageFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleLoadWallet ( LoadWalletFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleMessageBox ( MessageBoxFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleNotifyAlertChanged ( NotifyAlertChangedFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleNotifyBlockTip ( NotifyBlockTipFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleNotifyHeaderTip ( NotifyHeaderTipFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleNotifyNetworkActiveChanged ( NotifyNetworkActiveChangedFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleNotifyNumConnectionsChanged ( NotifyNumConnectionsChangedFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleQuestion ( QuestionFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::unique_ptr<Handler> interfaces::Node::handleShowProgress ( ShowProgressFn  fn)
pure virtual

Here is the caller graph for this function:

virtual std::string interfaces::Node::helpMessage ( HelpMessageMode  mode)
pure virtual

Get help message string.

Here is the caller graph for this function:

virtual void interfaces::Node::initLogging ( )
pure virtual

Init logging.

Here is the caller graph for this function:

virtual void interfaces::Node::initParameterInteraction ( )
pure virtual

Init parameter interaction.

Here is the caller graph for this function:

virtual bool interfaces::Node::isInitialBlockDownload ( )
pure virtual

Is initial block download.

Here is the caller graph for this function:

virtual std::vector<std::string> interfaces::Node::listRpcCommands ( )
pure virtual

List rpc commands.

Here is the caller graph for this function:

virtual void interfaces::Node::mapPort ( bool  use_upnp)
pure virtual

Map port.

Here is the caller graph for this function:

virtual void interfaces::Node::parseParameters ( int  argc,
const char *const  argv[] 
)
pure virtual

Set command line arguments.

Here is the caller graph for this function:

virtual void interfaces::Node::readConfigFile ( const std::string &  conf_path)
pure virtual

Load settings from configuration file.

Here is the caller graph for this function:

virtual void interfaces::Node::rpcSetTimerInterfaceIfUnset ( RPCTimerInterface iface)
pure virtual

Set RPC timer interface if unset.

Here is the caller graph for this function:

virtual void interfaces::Node::rpcUnsetTimerInterface ( RPCTimerInterface iface)
pure virtual

Unset RPC timer interface.

Here is the caller graph for this function:

virtual void interfaces::Node::selectParams ( const std::string &  network)
pure virtual

Choose network parameters.

Here is the caller graph for this function:

virtual void interfaces::Node::setNetworkActive ( bool  active)
pure virtual

Set network active.

Here is the caller graph for this function:

virtual bool interfaces::Node::shutdownRequested ( )
pure virtual

Return whether shutdown was requested.

Here is the caller graph for this function:

virtual bool interfaces::Node::softSetArg ( const std::string &  arg,
const std::string &  value 
)
pure virtual

Set a command line argument if it doesn't already have a value.

Here is the caller graph for this function:

virtual bool interfaces::Node::softSetBoolArg ( const std::string &  arg,
bool  value 
)
pure virtual

Set a command line boolean argument if it doesn't already have a value.

Here is the caller graph for this function:

virtual void interfaces::Node::startShutdown ( )
pure virtual

Start shutdown.

Here is the caller graph for this function:

virtual bool interfaces::Node::unban ( const CSubNet ip)
pure virtual

Unban node.

Here is the caller graph for this function:


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