sgns¶
Namespaces¶
Classes¶
Types¶
| Name | |
|---|---|
| enum class | error_cli |
| enum class uint8_t | message_type |
| enum class uint8_t | bulk_pull_account_flags |
| using std::pair< std::string, base::Buffer > | EscrowDataPair |
| using std::pair< std::vector< InputUTXOInfo >, std::vector< OutputDestInfo > > | UTXOTxParameters |
| using boost::asio::ip::udp::endpoint | endpoint |
| using boost::asio::ip::tcp::endpoint | tcp_endpoint |
| typedef unsigned int | ipfs_dbi A handle for an individual database in the DB environment. |
| using db_val< IPFS_val > | ipfs_val |
Functions¶
| Name | |
|---|---|
| base::Logger | GeniusNodeLogger() |
| std::string | generate_uuid_with_ipfs_id(const std::string & ipfs_id) |
| template <size_t N,class Stream > Stream & |
operator<<(Stream & s, const Unused< N > & ) |
| template <size_t N,class Stream > Stream & |
operator>>(Stream & s, Unused< N > & ) |
| std::string | to_string(const std::vector< unsigned char > & bytes) Convert a byte array to a hexadecimal string. |
| bool | isLittleEndian() Checks if the architecture is little endian. |
| template <typename T > T |
Vector2Num(const std::vector< uint8_t > & bytes) Converts a little-endian byte vector into a number. |
| uint128_t | Vector2Num(const std::vector< uint8_t > & bytes) |
| uint256_t | Vector2Num(const std::vector< uint8_t > & bytes) |
| template <typename T > std::vector< uint8_t > |
Num2Vector(const T & num, std::size_t num_bytes_resolution =sizeof(T)) Converts a number into a byte vector (little-endian). |
| template <typename T > T |
HexASCII2Num(const char * p_char, std::size_t num_nibbles_resolution =sizeof(T) *2) Converts a hexadecimal ASCII char array into a number. |
| template <typename T > std::vector< T > |
HexASCII2NumStr(const char * p_char, std::size_t char_ptr_size) Converts a hexadecimal ASCII char array into a vector of numbers. |
| template <typename T > std::enable_if_t< std::is_same_v< typename T::value_type, uint8_t > > |
AdjustEndianess(T & data, std::optional< typename T::iterator > start =std::nullopt, std::optional< typename T::iterator > finish =std::nullopt) Adjust endianess if needed. |
| std::string | Uint256ToString(const uint256_t & value) |
| template <class... Fs> auto |
make_visitor(Fs &&... fs) Creates a compile-time visitor from a set of lambdas. |
| template <typename TVariant ,typename... TVisitors> decltype(auto) |
visit_in_place(TVariant && variant, TVisitors &&... visitors) Applies an in-place visitor to a boost::variant. |
| template <typename T ,typename Matcher > decltype(auto) |
match(T && t, Matcher && m) apply Matcher to optional T |
| template <typename T ,typename... Fs> decltype(auto) |
match_in_place(T && t, Fs &&... fs) construct visitor from Fs and apply it to optional T |
| std::string | decodeChunkedTransfer(const std::string & chunkedData) |
| GeniusProver::ProofType | GetSnarkFromProto(const SGProof::BaseProofData & proof_proto_data) |
| void | add_node_options(boost::program_options::options_description & description_a) |
| void | add_node_flag_options(boost::program_options::options_description & description_a) |
| std::error_code | update_flags(sgns::node_flags & flags_a, boost::program_options::variables_map const & vm) |
| std::error_code | handle_node_options(boost::program_options::variables_map const & vm) |
| bool | parse_port(std::string const & string_a, uint16_t & port_a) |
| bool | parse_address(std::string const & address_text_a, boost::asio::ip::address & address_a) |
| bool | parse_address_port(std::string const & string, boost::asio::ip::address & address_a, uint16_t & port_a) |
| bool | parse_endpoint(std::string const & string, sgns::endpoint & endpoint_a) |
| bool | parse_tcp_endpoint(std::string const & string, sgns::tcp_endpoint & endpoint_a) |
| uint64_t | ip_address_hash_raw(boost::asio::ip::address const & ip_a, uint16_t port =0) |
| ::sgns::error_ | read_node_config_toml(boost::filesystem::path const & , sgns::daemon_config & config_a, std::vector< std::string > const & config_overrides =std::vector< std::string >()) |
| ::sgns::error_ | read_and_update_daemon_config(boost::filesystem::path const & , sgns::daemon_config & config_a, sgns::jsonconfig & json_a) |
| sgns::node_flags const & | inactive_node_flag_defaults() |
| std::unique_ptr< sgns::inactive_node > | default_inactive_node(boost::filesystem::path const & path_a, boost::program_options::variables_map const & vm_a) |
| std::unique_ptr< sgns::block_store > | make_store() Create a block store instance for the node. |
| std::unique_ptr< container_info_component > | collect_container_info(wallets & wallets, const std::string & name) |
Types Documentation¶
enum error_cli¶
| Enumerator | Value | Description |
|---|---|---|
| generic | 1 | |
| parse_error | 2 | |
| invalid_arguments | 3 | |
| unknown_command | 4 | |
| database_write_error | 5 | |
| reading_config | 6 | |
| disable_all_network | 7 | |
| ambiguous_udp_options | 8 |
Command line related error codes
enum message_type¶
| Enumerator | Value | Description |
|---|---|---|
| invalid | 0x0 | |
| not_a_type | 0x1 | |
| keepalive | 0x2 | |
| publish | 0x3 | |
| confirm_req | 0x4 | |
| confirm_ack | 0x5 | |
| bulk_pull | 0x6 | |
| bulk_push | 0x7 | |
| frontier_req | 0x8 | |
| node_id_handshake | 0x0a | |
| bulk_pull_account | 0x0b | |
| telemetry_req | 0x0c | |
| telemetry_ack | 0x0d |
Message types are serialized to the network and existing values must thus never change as types are added, removed and reordered in the enum.
enum bulk_pull_account_flags¶
| Enumerator | Value | Description |
|---|---|---|
| pending_hash_and_amount | 0x0 | |
| pending_address_only | 0x1 | |
| pending_hash_amount_and_address | 0x2 |
using EscrowDataPair¶
using UTXOTxParameters¶
using endpoint¶
using tcp_endpoint¶
typedef ipfs_dbi¶
A handle for an individual database in the DB environment.
using ipfs_val¶
Functions Documentation¶
function GeniusNodeLogger¶
function generate_uuid_with_ipfs_id¶
function operator<<¶
function operator>>¶
function to_string¶
Convert a byte array to a hexadecimal string.
Parameters:
- bytes A vector of bytes to be converted.
Return: A hexadecimal string representation of the bytes.
function isLittleEndian¶
Checks if the architecture is little endian.
Return: true if little endian, false otherwise
function Vector2Num¶
Converts a little-endian byte vector into a number.
Parameters:
- bytes Byte vector to convert.
Template Parameters:
- T uint8_t, uint16_t, uint32_t, uint64_t, or supported multiprecision integer types.
Return: The converted number.
function Vector2Num¶
function Vector2Num¶
function Num2Vector¶
template <typename T >
static std::vector< uint8_t > Num2Vector(
const T & num,
std::size_t num_bytes_resolution =sizeof(T)
)
Converts a number into a byte vector (little-endian).
Parameters:
- num Number to convert.
- num_bytes_resolution Optional byte resolution (defaults to sizeof(T)).
Template Parameters:
- T uint8_t, uint16_t, uint32_t or uint64_t
Return: The converted byte vector.
function HexASCII2Num¶
template <typename T >
static T HexASCII2Num(
const char * p_char,
std::size_t num_nibbles_resolution =sizeof(T) *2
)
Converts a hexadecimal ASCII char array into a number.
Parameters:
- p_char Hexadecimal ASCII char array
- num_nibbles_resolution How many nibbles will constitute a number
Template Parameters:
- T uint8_t, uint16_t, uint32_t or uint64_t
Return: The converted number (8-64 bit variable)
function HexASCII2NumStr¶
template <typename T >
static std::vector< T > HexASCII2NumStr(
const char * p_char,
std::size_t char_ptr_size
)
Converts a hexadecimal ASCII char array into a vector of numbers.
Parameters:
- p_char Hexadecimal ASCII char array
- char_ptr_size Size of the char array
Template Parameters:
- T uint8_t, uint16_t, uint32_t or uint64_t
Return: The vector of converted numbers
function AdjustEndianess¶
template <typename T >
static std::enable_if_t< std::is_same_v< typename T::value_type, uint8_t > > AdjustEndianess(
T & data,
std::optional< typename T::iterator > start =std::nullopt,
std::optional< typename T::iterator > finish =std::nullopt
)
Adjust endianess if needed.
Parameters:
- data The container of data (vector/array)
- start Optional beginning of the valid data
- finish Optional ending of the valid data
Template Parameters:
- T std::vector
or std::array
function Uint256ToString¶
function make_visitor¶
Creates a compile-time visitor from a set of lambdas.
Return: Visitor instance that dispatches to the provided lambdas.
Example: ```cpp
make_visitor(, { return 2; });
This is essentially the same as: ```cpp
struct visitor : public boost::static_visitor<int> {
int operator()(int a) { return 1; }
int operator()(std::string b) { return 2; }
};
function visit_in_place¶
template <typename TVariant ,
typename... TVisitors>
decltype(auto) visit_in_place(
TVariant && variant,
TVisitors &&... visitors
)
Applies an in-place visitor to a boost::variant.
Example: ```cpp
boost::variant
visit_in_place(value, { std::cout << "(int)" << v; }, { std::cout << "(string)" << v; });
### function match
```cpp
template <typename T ,
typename Matcher >
decltype(auto) match(
T && t,
Matcher && m
)
apply Matcher to optional T
function match_in_place¶
construct visitor from Fs and apply it to optional T
function decodeChunkedTransfer¶
function GetSnarkFromProto¶
function add_node_options¶
function add_node_flag_options¶
function update_flags¶
std::error_code update_flags(
sgns::node_flags & flags_a,
boost::program_options::variables_map const & vm
)
function handle_node_options¶
function parse_port¶
function parse_address¶
function parse_address_port¶
bool parse_address_port(
std::string const & string,
boost::asio::ip::address & address_a,
uint16_t & port_a
)
function parse_endpoint¶
function parse_tcp_endpoint¶
function ip_address_hash_raw¶
function read_node_config_toml¶
::sgns::error_ read_node_config_toml(
boost::filesystem::path const & ,
sgns::daemon_config & config_a,
std::vector< std::string > const & config_overrides =std::vector< std::string >()
)
function read_and_update_daemon_config¶
::sgns::error_ read_and_update_daemon_config(
boost::filesystem::path const & ,
sgns::daemon_config & config_a,
sgns::jsonconfig & json_a
)
function inactive_node_flag_defaults¶
function default_inactive_node¶
std::unique_ptr< sgns::inactive_node > default_inactive_node(
boost::filesystem::path const & path_a,
boost::program_options::variables_map const & vm_a
)
function make_store¶
Create a block store instance for the node.
Return: Newly created block store implementation.
function collect_container_info¶
std::unique_ptr< container_info_component > collect_container_info(
wallets & wallets,
const std::string & name
)
Updated on 2026-03-04 at 13:10:43 -0800