Skip to content

sgns::GeniusNode

High-level facade that initializes and coordinates account, networking, transaction, blockchain, and processing subsystems.

#include <GeniusNode.hpp>

Inherits from IComponent, std::enable_shared_from_this< GeniusNode >

Public Types

Name
enum class uint8_t NodeState { CREATING = 0, MIGRATING_DATABASE, INITIALIZING_DATABASE, INITIALIZING_PROCESSING, INITIALIZING_BLOCKCHAIN, INITIALIZING_TRANSACTIONS, READY}
Lifecycle states reported while the node is bootstrapping.
enum class uint8_t Error { INSUFFICIENT_FUNDS = 1, DATABASE_WRITE_ERROR = 2, INVALID_TRANSACTION_HASH = 3, INVALID_CHAIN_ID = 4, INVALID_TOKEN_ID = 5, TOKEN_ID_MISMATCH = 6, PROCESS_COST_ERROR = 7, PROCESS_INFO_MISSING = 8, INVALID_JSON = 9, INVALID_BLOCK_PARAMETERS = 10, NO_PROCESSOR = 11, NO_PRICE = 12, TRANSACTIONS_NOT_READY = 13, TRANSACTION_NOT_FINALIZED = 14, TRANSACTION_FAILED = 15}
Error codes returned by GeniusNode operations.

Public Functions

Name
std::shared_ptr< GeniusNode > New(const DevConfig_st & dev_config, bool autodht =true, bool isprocessor =true, uint16_t base_port =40001, bool is_full_node =false, bool use_upnp =true)
Creates a node using a generated or persisted account identity.
std::shared_ptr< GeniusNode > New(const DevConfig_st & dev_config, const char * eth_private_key, bool autodht =true, bool isprocessor =true, uint16_t base_port =40001, bool is_full_node =false, bool use_upnp =true)
Creates a node bound to the provided Ethereum private key.
std::shared_ptr< GeniusNode > NewFromMnemonic(const DevConfig_st & dev_config, const std::string & mnemonic, bool autodht =true, bool isprocessor =true, uint16_t base_port =40001, bool is_full_node =false, bool use_upnp =true)
Creates a node from an existing mnemonic phrase.
~GeniusNode() override
Stops node services, joins background threads, and releases processing callbacks.
std::vector< std::string > GetAvailableAccounts()
Lists the account addresses currently available in local storage.
outcome::result< void > SelectAccount(std::string_view public_address)
Selects the active account for subsequent node operations.
outcome::result< void > TransferAccount(std::string_view public_address)
Transfers node ownership to another stored account address.
outcome::result< void > DeleteAccount(std::string_view public_address)
Deletes a locally stored account.
outcome::result< void > MergeAccount(std::string_view public_address)
Merges data from another account into the currently selected one.
outcome::result< void > SetPayoutAddress(std::string_view payout_address)
Updates the payout address used by processing rewards.
outcome::result< std::string > ProcessImage(const std::string & jsondata)
Submits an image-processing request described by JSON input.
uint64_t GetProcessCost(std::shared_ptr< sgns::sgprocessing::ProcessingManager > & procmgr)
Estimates the GNUS cost of a processing request manager.
outcome::result< double > GetGNUSPrice()
Retrieves the current GNUS market price from the configured pricing service.
virtual std::string GetName() override
Returns the component name used by the component framework.
std::string GetVersion()
Returns the full SuperGenius version string.
outcome::result< std::string > MintTokens(uint64_t amount, const std::string & transaction_hash, const std::string & chainid, TokenID tokenid, std::string destination ="")
Creates and submits a mint transaction.
outcome::result< std::pair< std::string, uint64_t > > MintTokens(uint64_t amount, const std::string & transaction_hash, const std::string & chainid, TokenID tokenid, std::string destination, std::chrono::milliseconds timeout)
Creates a mint transaction and waits for it to finalize.
void AddPeer(const std::string & peer)
Adds a peer address to the underlying PubSub service.
void RefreshUPNP(uint16_t pubsubport)
Starts or restarts the background UPnP port refresh thread.
uint64_t GetBalance()
Returns the active account balance across all tokens.
uint64_t GetBalance(TokenID token_id)
Returns the active account balance for a token.
uint64_t GetBalance(const std::string & address)
Returns an address balance across all tokens.
uint64_t GetBalance(TokenID token_id, const std::string & address)
Returns an address balance for a token.
std::vector< std::vector< uint8_t > > GetInTransactions() const
Returns serialized incoming transactions known to the transaction manager.
std::vector< std::vector< uint8_t > > GetOutTransactions() const
Returns serialized outgoing transactions known to the transaction manager.
const std::vector< std::vector< uint8_t > > GetTransactions(std::optional< TransactionManager::TransactionStatus > tx_status =std::nullopt) const
Returns serialized transactions filtered by optional status.
std::string GetAddress() const
Returns the active account public address.
TokenID GetTokenID() const
Returns the configured child token identifier.
processing::ProcessingServiceImpl::ProcessingStatus GetProcessingStatus() const
Returns the current processing service status.
outcome::result< std::pair< std::string, uint64_t > > TransferFunds(uint64_t amount, const std::string & destination, TokenID token_id, std::chrono::milliseconds timeout)
Transfers funds and waits for the transaction to finalize.
outcome::result< std::string > TransferFunds(uint64_t amount, const std::string & destination, TokenID token_id)
Transfers funds without waiting for finalization.
outcome::result< std::string > PayDev(uint64_t amount, TokenID token_id)
Transfers funds to the configured developer address.
outcome::result< std::pair< std::string, uint64_t > > PayDev(uint64_t amount, TokenID token_id, std::chrono::milliseconds timeout)
Transfers funds to the configured developer address and waits for finalization.
outcome::result< std::pair< TransactionManager::TransactionStatus, uint64_t > > WaitForFinalized(const std::string & tx_id, std::chrono::milliseconds timeout)
Waits until an outgoing transaction reaches a terminal state.
std::optional< TransactionManager::TransactionStatus > IsFinalized(const std::string & tx_id)
Checks whether an outgoing transaction has reached a terminal state.
std::shared_ptr< ipfs_pubsub::GossipPubSub > GetPubSub()
Returns the underlying PubSub service.
void ResetProcessingMembers()
Releases processing service, core, queue, and result-storage references.
outcome::result< std::string > FormatTokens(uint64_t amount, TokenID tokenId)
Formats a fixed-point amount into a human-readable string.
outcome::result< uint64_t > ParseTokens(const std::string & str, TokenID tokenId)
Parses a human-readable string into a fixed-point amount.
void PrintDataStore() const
Prints the transaction GlobalDB datastore for debugging.
void StopProcessing()
Stops the processing service if it is initialized.
void StartProcessing()
Starts the processing service on the configured processing grid channel.
outcome::result< std::map< std::string, double > > GetCoinprice(const std::vector< std::string > & tokenIds)
Retrieves current USD prices for token identifiers, using a short local cache.
outcome::result< std::map< std::string, std::map< int64_t, double > > > GetCoinPriceByDate(const std::vector< std::string > & tokenIds, const std::vector< int64_t > & timestamps)
Retrieves historical USD prices for token identifiers at exact timestamps.
outcome::result< std::map< std::string, std::map< int64_t, double > > > GetCoinPricesByDateRange(const std::vector< std::string > & tokenIds, int64_t from, int64_t to)
Retrieves historical USD prices for token identifiers over a date range.
TransactionManager::TransactionStatus WaitForTransactionIncoming(const std::string & txId, std::chrono::milliseconds timeout)
Waits for an incoming transaction to be processed.
TransactionManager::TransactionStatus WaitForTransactionOutgoing(const std::string & txId, std::chrono::milliseconds timeout)
Waits for an outgoing transaction to be processed.
TransactionManager::TransactionStatus WaitForEscrowRelease(const std::string & originalEscrowId, std::chrono::milliseconds timeout)
Waits for an escrow release transaction tied to an escrow hold.
TransactionManager::State GetTransactionManagerState() const
Returns the current transaction manager lifecycle state.
void ConfigureRpcEndpoint(const std::string & chain_id, std::vector< WeightedRpcEndpoint > endpoints)
Configures RPC endpoints for a specific EVM chain on the public-chain input validator.
TransactionManager::TransactionStatus GetTransactionStatus(const std::string & txId) const
Returns a tracked transaction status by transaction hash.
void SetAuthorizedFullNodeAddress(const std::string & pub_address)
Sets the authorized full-node address for blockchain genesis verification.
const std::string & GetAuthorizedFullNodeAddress() const
Gets the current authorized full-node public address.
NodeState GetState() const
Returns the current GeniusNode lifecycle state.

Protected Functions

Name
void SendTransactionAndProof(std::shared_ptr< GeniusTransaction > tx, std::vector< uint8_t > proof)
Enqueues a transaction and its proof directly through the transaction manager.
void ConfigureTransactionFilterTimeoutsMs(uint64_t timeframe_limit_ms, uint64_t mutability_window_ms)
Configures transaction filtering time windows for tests.

Public Attributes

Name
std::chrono::milliseconds TIMEOUT_ESCROW_PAY
Escrow payout timeout.
std::chrono::milliseconds TIMEOUT_TRANSFER
Transfer timeout.
std::chrono::milliseconds TIMEOUT_MINT
Mint timeout.

Protected Attributes

Name
std::string write_base_path_
Base path for node databases, logs, and account storage.
std::shared_ptr< GeniusAccount > account_
Active account used by node services.

Friends

Name
class TransactionSyncTest
class MultiAccountTestAccess

Additional inherited members

Public Functions inherited from IComponent

Name
virtual ~IComponent() =default

Public Types Documentation

enum NodeState

Enumerator Value Description
CREATING 0 Object construction is in progress.
MIGRATING_DATABASE Versioned database migrations are running.
INITIALIZING_DATABASE Primary CRDT database is being initialized.
INITIALIZING_PROCESSING Processing modules are being initialized.
INITIALIZING_BLOCKCHAIN Blockchain service is being initialized.
INITIALIZING_TRANSACTIONS Transaction manager is being initialized.
READY Node is ready for external operations.

Lifecycle states reported while the node is bootstrapping.

enum Error

Enumerator Value Description
INSUFFICIENT_FUNDS 1 Insufficient funds for a transaction.
DATABASE_WRITE_ERROR 2 Error writing data into the database.
INVALID_TRANSACTION_HASH 3 Input transaction hash is invalid.
INVALID_CHAIN_ID 4 Chain ID is invalid.
INVALID_TOKEN_ID 5 Token ID is invalid.
TOKEN_ID_MISMATCH 6 Provided token ID does not match the configured token.
PROCESS_COST_ERROR 7 Processing cost could not be calculated.
PROCESS_INFO_MISSING 8 Processing information is missing from the JSON request.
INVALID_JSON 9 JSON cannot be parsed.
INVALID_BLOCK_PARAMETERS 10 JSON block parameters are incorrect or missing.
NO_PROCESSOR 11 No processor is available for this request type.
NO_PRICE 12 GNUS price could not be retrieved.
TRANSACTIONS_NOT_READY 13 Transaction manager is not ready.
TRANSACTION_NOT_FINALIZED 14 Requested transaction did not finalize within the timeout.
TRANSACTION_FAILED 15 Requested transaction failed.

Error codes returned by GeniusNode operations.

Public Functions Documentation

function New

static std::shared_ptr< GeniusNode > New(
    const DevConfig_st & dev_config,
    bool autodht =true,
    bool isprocessor =true,
    uint16_t base_port =40001,
    bool is_full_node =false,
    bool use_upnp =true
)

Creates a node using a generated or persisted account identity.

Parameters:

  • dev_config Runtime configuration for paths, token settings, and payout data.
  • autodht Whether to start DHT discovery.
  • isprocessor Whether this node should run processing services.
  • base_port Base pubsub port used to derive the node listening port.
  • is_full_node Whether the node should run in full-node mode.
  • use_upnp Whether to attempt UPnP port mapping.

Return: Shared node instance after asynchronous database initialization is scheduled.

function New

static std::shared_ptr< GeniusNode > New(
    const DevConfig_st & dev_config,
    const char * eth_private_key,
    bool autodht =true,
    bool isprocessor =true,
    uint16_t base_port =40001,
    bool is_full_node =false,
    bool use_upnp =true
)

Creates a node bound to the provided Ethereum private key.

Parameters:

  • dev_config Runtime configuration for paths, token settings, and payout data.
  • eth_private_key Ethereum private key used to derive the account identity.
  • autodht Whether to start DHT discovery.
  • isprocessor Whether this node should run processing services.
  • base_port Base pubsub port used to derive the node listening port.
  • is_full_node Whether the node should run in full-node mode.
  • use_upnp Whether to attempt UPnP port mapping.

Return: Shared node instance after asynchronous database initialization is scheduled.

function NewFromMnemonic

static std::shared_ptr< GeniusNode > NewFromMnemonic(
    const DevConfig_st & dev_config,
    const std::string & mnemonic,
    bool autodht =true,
    bool isprocessor =true,
    uint16_t base_port =40001,
    bool is_full_node =false,
    bool use_upnp =true
)

Creates a node from an existing mnemonic phrase.

Parameters:

  • dev_config Runtime configuration for paths, token settings, and payout data.
  • mnemonic Mnemonic phrase used to restore the account identity.
  • autodht Whether to start DHT discovery.
  • isprocessor Whether this node should run processing services.
  • base_port Base pubsub port used to derive the node listening port.
  • is_full_node Whether the node should run in full-node mode.
  • use_upnp Whether to attempt UPnP port mapping.

Return: Shared node instance after asynchronous database initialization is scheduled, or nullptr on restore failure.

function ~GeniusNode

~GeniusNode() override

Stops node services, joins background threads, and releases processing callbacks.

function GetAvailableAccounts

std::vector< std::string > GetAvailableAccounts()

Lists the account addresses currently available in local storage.

Return: Public addresses stored under the configured base write path.

function SelectAccount

outcome::result< void > SelectAccount(
    std::string_view public_address
)

Selects the active account for subsequent node operations.

Parameters:

  • public_address Stored account address to activate.

Return: Success after services are reset and database initialization is restarted, or an address error.

function TransferAccount

outcome::result< void > TransferAccount(
    std::string_view public_address
)

Transfers node ownership to another stored account address.

Parameters:

  • public_address Stored account address that should receive the current balance and become active.

Return: Success after funds are transferred and the target account is selected, or an address/transaction error.

function DeleteAccount

outcome::result< void > DeleteAccount(
    std::string_view public_address
)

Deletes a locally stored account.

Parameters:

  • public_address Stored account address to delete.

Return: Success when the account is deleted; failure when the address is active or unavailable.

function MergeAccount

outcome::result< void > MergeAccount(
    std::string_view public_address
)

Merges data from another account into the currently selected one.

Parameters:

  • public_address Stored account address to transfer into and then delete.

Return: Success when transfer and delete both complete.

function SetPayoutAddress

outcome::result< void > SetPayoutAddress(
    std::string_view payout_address
)

Updates the payout address used by processing rewards.

Parameters:

  • payout_address Address to save as the processing payout destination.

Return: Success when the address is persisted and processing reinitialization is scheduled.

function ProcessImage

outcome::result< std::string > ProcessImage(
    const std::string & jsondata
)

Submits an image-processing request described by JSON input.

Parameters:

  • jsondata Processing request JSON.

Return: Escrow transaction hash on success, or a validation, balance, or database error.

function GetProcessCost

uint64_t GetProcessCost(
    std::shared_ptr< sgns::sgprocessing::ProcessingManager > & procmgr
)

Estimates the GNUS cost of a processing request manager.

Parameters:

  • procmgr Processing manager containing parsed request data.

Return: Estimated cost in minions, or 0 when the request size, price, or cost calculation fails.

function GetGNUSPrice

outcome::result< double > GetGNUSPrice()

Retrieves the current GNUS market price from the configured pricing service.

Return: Current GNUS price in USD, or Error::NO_PRICE when unavailable.

function GetName

inline virtual std::string GetName() override

Returns the component name used by the component framework.

Return: Static component name "GeniusNode".

Reimplements: IComponent::GetName

function GetVersion

std::string GetVersion()

Returns the full SuperGenius version string.

Return: Version string built from the compiled version metadata.

function MintTokens

outcome::result< std::string > MintTokens(
    uint64_t amount,
    const std::string & transaction_hash,
    const std::string & chainid,
    TokenID tokenid,
    std::string destination =""
)

Creates and submits a mint transaction.

Parameters:

  • amount Amount to mint in token base units.
  • transaction_hash Source-chain transaction hash that justifies the mint.
  • chainid Source chain identifier where the burn or lock event occurred.
  • tokenid Token identifier to mint.
  • destination Recipient address; defaults to the active account address when empty.

Return: Mint transaction hash on success, or a transaction readiness/submission error.

function MintTokens

outcome::result< std::pair< std::string, uint64_t > > MintTokens(
    uint64_t amount,
    const std::string & transaction_hash,
    const std::string & chainid,
    TokenID tokenid,
    std::string destination,
    std::chrono::milliseconds timeout
)

Creates a mint transaction and waits for it to finalize.

Parameters:

  • amount Amount to mint in token base units.
  • transaction_hash Source-chain transaction hash that justifies the mint.
  • chainid Source chain identifier where the burn or lock event occurred.
  • tokenid Token identifier to mint.
  • destination Recipient address for the minted tokens.
  • timeout Maximum time to wait for finalization.

Return: Pair of transaction hash and elapsed milliseconds on success, or a transaction/finalization error.

function AddPeer

void AddPeer(
    const std::string & peer
)

Adds a peer address to the underlying PubSub service.

Parameters:

  • peer Peer multiaddress to add.

function RefreshUPNP

void RefreshUPNP(
    uint16_t pubsubport
)

Starts or restarts the background UPnP port refresh thread.

Parameters:

  • pubsubport TCP port to keep mapped through UPnP.

function GetBalance

uint64_t GetBalance()

Returns the active account balance across all tokens.

Return: Total local UTXO balance for the active account.

function GetBalance

uint64_t GetBalance(
    TokenID token_id
)

Returns the active account balance for a token.

Parameters:

  • token_id Token identifier to filter by.

Return: Local UTXO balance for token_id.

function GetBalance

uint64_t GetBalance(
    const std::string & address
)

Returns an address balance across all tokens.

Parameters:

  • address Address whose UTXO balance should be queried.

Return: Total local UTXO balance for address.

function GetBalance

uint64_t GetBalance(
    TokenID token_id,
    const std::string & address
)

Returns an address balance for a token.

Parameters:

  • token_id Token identifier to filter by.
  • address Address whose UTXO balance should be queried.

Return: Local UTXO balance for address and token_id.

function GetInTransactions

std::vector< std::vector< uint8_t > > GetInTransactions() const

Returns serialized incoming transactions known to the transaction manager.

Return: Incoming transaction byte vectors, or an empty vector when transactions are not ready.

function GetOutTransactions

std::vector< std::vector< uint8_t > > GetOutTransactions() const

Returns serialized outgoing transactions known to the transaction manager.

Return: Outgoing transaction byte vectors, or an empty vector when transactions are not ready.

function GetTransactions

const std::vector< std::vector< uint8_t > > GetTransactions(
    std::optional< TransactionManager::TransactionStatus > tx_status =std::nullopt
) const

Returns serialized transactions filtered by optional status.

Parameters:

  • tx_status Optional transaction status filter.

Return: Transaction byte vectors, or an empty vector when transactions are not ready.

function GetAddress

std::string GetAddress() const

Returns the active account public address.

Return: Public address of the active account.

function GetTokenID

inline TokenID GetTokenID() const

Returns the configured child token identifier.

Return: Token identifier from the node runtime configuration.

function GetProcessingStatus

inline processing::ProcessingServiceImpl::ProcessingStatus GetProcessingStatus() const

Returns the current processing service status.

Return: Processing status, or DISABLED when the service is not initialized.

function TransferFunds

outcome::result< std::pair< std::string, uint64_t > > TransferFunds(
    uint64_t amount,
    const std::string & destination,
    TokenID token_id,
    std::chrono::milliseconds timeout
)

Transfers funds and waits for the transaction to finalize.

Parameters:

  • amount Amount to transfer in token base units.
  • destination Recipient address.
  • token_id Token identifier to transfer.
  • timeout Maximum time to wait for finalization.

Return: Pair of transaction hash and elapsed milliseconds on success, or a transfer/finalization error.

function TransferFunds

outcome::result< std::string > TransferFunds(
    uint64_t amount,
    const std::string & destination,
    TokenID token_id
)

Transfers funds without waiting for finalization.

Parameters:

  • amount Amount to transfer in token base units.
  • destination Recipient address.
  • token_id Token identifier to transfer.

Return: Transfer transaction hash on success, or a readiness, balance, or submission error.

function PayDev

outcome::result< std::string > PayDev(
    uint64_t amount,
    TokenID token_id
)

Transfers funds to the configured developer address.

Parameters:

  • amount Amount to transfer in token base units.
  • token_id Token identifier to transfer.

Return: Transfer transaction hash on success, or a readiness, balance, or submission error.

function PayDev

outcome::result< std::pair< std::string, uint64_t > > PayDev(
    uint64_t amount,
    TokenID token_id,
    std::chrono::milliseconds timeout
)

Transfers funds to the configured developer address and waits for finalization.

Parameters:

  • amount Amount to transfer in token base units.
  • token_id Token identifier to transfer.
  • timeout Maximum time to wait for finalization.

Return: Pair of transaction hash and elapsed milliseconds on success, or a transfer/finalization error.

function WaitForFinalized

outcome::result< std::pair< TransactionManager::TransactionStatus, uint64_t > > WaitForFinalized(
    const std::string & tx_id,
    std::chrono::milliseconds timeout
)

Waits until an outgoing transaction reaches a terminal state.

Parameters:

  • tx_id Transaction hash to poll.
  • timeout Maximum time to wait.

Return: Pair of terminal status and elapsed milliseconds, or Error::TRANSACTION_NOT_FINALIZED on timeout.

function IsFinalized

std::optional< TransactionManager::TransactionStatus > IsFinalized(
    const std::string & tx_id
)

Checks whether an outgoing transaction has reached a terminal state.

Parameters:

  • tx_id Transaction hash to check.

Return: Terminal transaction status when available; otherwise std::nullopt.

function GetPubSub

inline std::shared_ptr< ipfs_pubsub::GossipPubSub > GetPubSub()

Returns the underlying PubSub service.

Return: Shared PubSub instance used by the node.

function ResetProcessingMembers

void ResetProcessingMembers()

Releases processing service, core, queue, and result-storage references.

function FormatTokens

outcome::result< std::string > FormatTokens(
    uint64_t amount,
    TokenID tokenId
)

Formats a fixed-point amount into a human-readable string.

Parameters:

  • amount Amount in Minion Tokens (1e-6 GNUS).
  • tokenId Optional token identifier: – empty: default (minion to GNUS) formatting – matches DevConfig.TokenID: child-token formatting – otherwise: returns Error::TOKEN_ID_MISMATCH

Return: Outcome result with the formatted string in GNUS or an error.

function ParseTokens

outcome::result< uint64_t > ParseTokens(
    const std::string & str,
    TokenID tokenId
)

Parses a human-readable string into a fixed-point amount.

Parameters:

  • str String representation of an amount in GNUS.
  • tokenId Optional token identifier: – empty: default (GNUS to minion) parsing – matches DevConfig.TokenID: child-token parsing – otherwise: returns Error::TOKEN_ID_MISMATCH

Return: Outcome result with the parsed amount in Minion Tokens (1e-6 GNUS) or an error.

function PrintDataStore

void PrintDataStore() const

Prints the transaction GlobalDB datastore for debugging.

function StopProcessing

void StopProcessing()

Stops the processing service if it is initialized.

function StartProcessing

void StartProcessing()

Starts the processing service on the configured processing grid channel.

function GetCoinprice

outcome::result< std::map< std::string, double > > GetCoinprice(
    const std::vector< std::string > & tokenIds
)

Retrieves current USD prices for token identifiers, using a short local cache.

Parameters:

  • tokenIds CoinGecko token identifiers to price.

Return: Map from token identifier to current USD price, or a price-retrieval error.

function GetCoinPriceByDate

outcome::result< std::map< std::string, std::map< int64_t, double > > > GetCoinPriceByDate(
    const std::vector< std::string > & tokenIds,
    const std::vector< int64_t > & timestamps
)

Retrieves historical USD prices for token identifiers at exact timestamps.

Parameters:

  • tokenIds CoinGecko token identifiers to price.
  • timestamps Unix timestamps to query.

Return: Nested map from token identifier to timestamp to USD price.

function GetCoinPricesByDateRange

outcome::result< std::map< std::string, std::map< int64_t, double > > > GetCoinPricesByDateRange(
    const std::vector< std::string > & tokenIds,
    int64_t from,
    int64_t to
)

Retrieves historical USD prices for token identifiers over a date range.

Parameters:

  • tokenIds CoinGecko token identifiers to price.
  • from Start Unix timestamp for the range.
  • to End Unix timestamp for the range.

Return: Nested map from token identifier to timestamp to USD price.

function WaitForTransactionIncoming

TransactionManager::TransactionStatus WaitForTransactionIncoming(
    const std::string & txId,
    std::chrono::milliseconds timeout
)

Waits for an incoming transaction to be processed.

Parameters:

  • txId Transaction hash to wait for.
  • timeout Maximum time to wait.

Return: Incoming transaction status, or INVALID when transactions are not ready.

function WaitForTransactionOutgoing

TransactionManager::TransactionStatus WaitForTransactionOutgoing(
    const std::string & txId,
    std::chrono::milliseconds timeout
)

Waits for an outgoing transaction to be processed.

Parameters:

  • txId Transaction hash to wait for.
  • timeout Maximum time to wait.

Return: Outgoing transaction status, or INVALID when transactions are not ready.

function WaitForEscrowRelease

TransactionManager::TransactionStatus WaitForEscrowRelease(
    const std::string & originalEscrowId,
    std::chrono::milliseconds timeout
)

Waits for an escrow release transaction tied to an escrow hold.

Parameters:

  • originalEscrowId Hash of the original escrow hold transaction.
  • timeout Maximum time to wait.

Return: Escrow release transaction status, or INVALID when transactions are not ready.

function GetTransactionManagerState

TransactionManager::State GetTransactionManagerState() const

Returns the current transaction manager lifecycle state.

Return: Transaction manager state, or CREATING when the manager is not available.

function ConfigureRpcEndpoint

void ConfigureRpcEndpoint(
    const std::string & chain_id,
    std::vector< WeightedRpcEndpoint > endpoints
)

Configures RPC endpoints for a specific EVM chain on the public-chain input validator.

Parameters:

  • chain_id Numeric EVM chain ID as a string (e.g. "11155111" for Sepolia).
  • endpoints Vector of weighted RPC endpoints for the chain.

Allows callers (including E2E tests) to register RPC endpoints for chains that are not in the default mainnet set (e.g. Sepolia testnet). The transaction manager must be in READY state.

function GetTransactionStatus

TransactionManager::TransactionStatus GetTransactionStatus(
    const std::string & txId
) const

Returns a tracked transaction status by transaction hash.

Parameters:

  • txId Transaction hash to look up.

Return: Outgoing status when present, then incoming status, or INVALID when unknown/not ready.

function SetAuthorizedFullNodeAddress

void SetAuthorizedFullNodeAddress(
    const std::string & pub_address
)

Sets the authorized full-node address for blockchain genesis verification.

Parameters:

  • pub_address Public address authorized to create genesis blocks.

function GetAuthorizedFullNodeAddress

const std::string & GetAuthorizedFullNodeAddress() const

Gets the current authorized full-node public address.

Return: Public address authorized to create genesis blocks.

function GetState

inline NodeState GetState() const

Returns the current GeniusNode lifecycle state.

Return: Current node state.

Protected Functions Documentation

function SendTransactionAndProof

void SendTransactionAndProof(
    std::shared_ptr< GeniusTransaction > tx,
    std::vector< uint8_t > proof
)

Enqueues a transaction and its proof directly through the transaction manager.

Parameters:

  • tx Transaction to enqueue.
  • proof Serialized proof bytes associated with tx.

function ConfigureTransactionFilterTimeoutsMs

void ConfigureTransactionFilterTimeoutsMs(
    uint64_t timeframe_limit_ms,
    uint64_t mutability_window_ms
)

Configures transaction filtering time windows for tests.

Parameters:

  • timeframe_limit_ms Timestamp tolerance in milliseconds.
  • mutability_window_ms Mutability window in milliseconds.

Public Attributes Documentation

variable TIMEOUT_ESCROW_PAY

static std::chrono::milliseconds TIMEOUT_ESCROW_PAY { 30000 };

Escrow payout timeout.

variable TIMEOUT_TRANSFER

static std::chrono::milliseconds TIMEOUT_TRANSFER { 30000 };

Transfer timeout.

variable TIMEOUT_MINT

static std::chrono::milliseconds TIMEOUT_MINT { 30000 };

Mint timeout.

Protected Attributes Documentation

variable write_base_path_

std::string write_base_path_;

Base path for node databases, logs, and account storage.

variable account_

std::shared_ptr< GeniusAccount > account_;

Active account used by node services.

Friends

friend TransactionSyncTest

friend class TransactionSyncTest(
    TransactionSyncTest 
);

friend MultiAccountTestAccess

friend class MultiAccountTestAccess(
    MultiAccountTestAccess 
);

Updated on 2026-06-05 at 17:22:18 -0700