CatapultServer  v0.5.0.1 (Elephant)
catapult::tools Namespace Reference

Namespaces

 address
 
 benchmark
 
 health
 
 nemgen
 
 network
 
 statusgen
 

Classes

class  CommandParser
 Interface for command line parsing. More...
 
class  KeyValueOutputBuilder
 
class  MultiNodeConnector
 Helper class for connecting to multiple nodes. More...
 
class  NetworkCensusTool
 A base class for a tool that performs a network census by communicating with all nodes. More...
 
class  RandomGenerator
 Random generator. More...
 
class  Tool
 Interface for the tools. More...
 

Typedefs

using OptionsBuilder = boost::program_options::options_description_easy_init
 Options builder. More...
 
using OptionsPositional = boost::program_options::positional_options_description
 Definition of positional arguments. More...
 
using Options = boost::program_options::variables_map
 Provides access to parsed options. More...
 
using PacketIoFuture = thread::future< std::shared_ptr< ionet::PacketIo > >
 Future that returns a packet io shared pointer. More...
 

Functions

template<typename TValue >
std::string Join (const std::vector< TValue > &values, const std::string &separator)
 Joins all values with separator. More...
 
template<typename TValue >
auto OptionsValue ()
 Helper wrapper to simplify defining values with no specified storage. More...
 
template<typename TValue >
auto OptionsValue (TValue &value)
 Helper wrapper to simplify defining values where value is used as storage. More...
 
auto OptionsSwitch ()
 Helper wrapper to simplify defining toggle values. More...
 
uint64_t Random ()
 Generates a uint64_t random number. More...
 
uint8_t RandomByte ()
 Generates a uint8_t random number. More...
 
config::CatapultConfiguration LoadConfiguration (const std::string &resourcesPath)
 Loads the configuration from resourcesPath. More...
 
std::vector< ionet::NodeLoadOptionalApiPeers (const std::string &resourcesPath, model::NetworkIdentifier networkIdentifier)
 Loads optional api peers configuration from resourcesPath for network networkIdentifier. More...
 
std::vector< ionet::NodeLoadPeers (const std::string &resourcesPath, model::NetworkIdentifier networkIdentifier)
 Loads p2p peers configuration from resourcesPath for network networkIdentifier. More...
 
crypto::KeyPair LoadServerKeyPair ()
 Returns server key pair used by tools. More...
 
crypto::KeyPair GenerateRandomKeyPair ()
 Returns random key pair. More...
 
std::vector< AddressPrepareAddresses (size_t count)
 Generate count deterministic addresses. More...
 
int ToolMain (int argc, const char **argv, Tool &tool)
 
PacketIoFuture ConnectToLocalNode (const crypto::KeyPair &clientKeyPair, const Key &serverPublicKey, const std::shared_ptr< thread::IoThreadPool > &pPool)
 
PacketIoFuture ConnectToNode (const crypto::KeyPair &clientKeyPair, const ionet::Node &node, const std::shared_ptr< thread::IoThreadPool > &pPool)
 Connects to node as a client with clientKeyPair using pPool. More...
 
std::shared_ptr< thread::IoThreadPoolCreateStartedThreadPool (uint32_t numThreads=1)
 Creates a started thread pool with numThreads threads. More...
 
template<typename TAction , typename TFuture >
bool UnwrapFutureAndSuppressErrors (const char *description, TFuture &&future, TAction action)
 

Typedef Documentation

◆ Options

using catapult::tools::Options = typedef boost::program_options::variables_map

Provides access to parsed options.

◆ OptionsBuilder

using catapult::tools::OptionsBuilder = typedef boost::program_options::options_description_easy_init

Options builder.

◆ OptionsPositional

using catapult::tools::OptionsPositional = typedef boost::program_options::positional_options_description

Definition of positional arguments.

◆ PacketIoFuture

Future that returns a packet io shared pointer.

Function Documentation

◆ ConnectToLocalNode()

PacketIoFuture catapult::tools::ConnectToLocalNode ( const crypto::KeyPair clientKeyPair,
const Key serverPublicKey,
const std::shared_ptr< thread::IoThreadPool > &  pPool 
)

Connects to localhost as a client with clientKeyPair using pPool. Localhost is expected to have identity serverPublicKey.

Here is the call graph for this function:

◆ ConnectToNode()

PacketIoFuture catapult::tools::ConnectToNode ( const crypto::KeyPair clientKeyPair,
const ionet::Node node,
const std::shared_ptr< thread::IoThreadPool > &  pPool 
)

Connects to node as a client with clientKeyPair using pPool.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateStartedThreadPool()

std::shared_ptr< thread::IoThreadPool > catapult::tools::CreateStartedThreadPool ( uint32_t  numThreads)

Creates a started thread pool with numThreads threads.

Here is the call graph for this function:

◆ GenerateRandomKeyPair()

crypto::KeyPair catapult::tools::GenerateRandomKeyPair ( )

Returns random key pair.

Here is the call graph for this function:

◆ Join()

template<typename TValue >
std::string catapult::tools::Join ( const std::vector< TValue > &  values,
const std::string &  separator 
)

Joins all values with separator.

Here is the caller graph for this function:

◆ LoadConfiguration()

config::CatapultConfiguration catapult::tools::LoadConfiguration ( const std::string &  resourcesPathStr)

Loads the configuration from resourcesPath.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadOptionalApiPeers()

std::vector< ionet::Node > catapult::tools::LoadOptionalApiPeers ( const std::string &  resourcesPath,
model::NetworkIdentifier  networkIdentifier 
)

Loads optional api peers configuration from resourcesPath for network networkIdentifier.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadPeers()

std::vector< ionet::Node > catapult::tools::LoadPeers ( const std::string &  resourcesPath,
model::NetworkIdentifier  networkIdentifier 
)

Loads p2p peers configuration from resourcesPath for network networkIdentifier.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadServerKeyPair()

crypto::KeyPair catapult::tools::LoadServerKeyPair ( )

Returns server key pair used by tools.

Here is the call graph for this function:

◆ OptionsSwitch()

auto catapult::tools::OptionsSwitch ( )
inline

Helper wrapper to simplify defining toggle values.

◆ OptionsValue() [1/2]

template<typename TValue >
auto catapult::tools::OptionsValue ( )

Helper wrapper to simplify defining values with no specified storage.

◆ OptionsValue() [2/2]

template<typename TValue >
auto catapult::tools::OptionsValue ( TValue &  value)

Helper wrapper to simplify defining values where value is used as storage.

◆ PrepareAddresses()

std::vector< Address > catapult::tools::PrepareAddresses ( size_t  count)

Generate count deterministic addresses.

Here is the call graph for this function:

◆ Random()

uint64_t catapult::tools::Random ( )

Generates a uint64_t random number.

Here is the caller graph for this function:

◆ RandomByte()

uint8_t catapult::tools::RandomByte ( )

Generates a uint8_t random number.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToolMain()

int catapult::tools::ToolMain ( int  argc,
const char **  argv,
Tool tool 
)

Bootstraps and executes the tool. argc and argv are arguments passed to main.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnwrapFutureAndSuppressErrors()

template<typename TAction , typename TFuture >
bool catapult::tools::UnwrapFutureAndSuppressErrors ( const char *  description,
TFuture &&  future,
TAction  action 
)

Gets the value associated with future and forwards it to action on success. On failure, false is returned and description is included in a warning log.

Here is the call graph for this function: