DECENT
Functions
Network broadcastAPI

Functions

string graphene::app::network_broadcast_api::info ()
 
void graphene::app::network_broadcast_api::broadcast_transaction (const signed_transaction &trx)
 Broadcast a transaction to the network. More...
 
fc::variant graphene::app::network_broadcast_api::broadcast_transaction_synchronous (const signed_transaction &trx)
 This call will not return until the transaction is included in a block. More...
 
void graphene::app::network_broadcast_api::broadcast_transaction_with_callback (confirmation_callback cb, const signed_transaction &trx)
 This version of broadcast transaction registers a callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block. More...
 
void graphene::app::network_broadcast_api::broadcast_block (const signed_block &block)
 Broadcast a block to the network. More...
 
void graphene::app::network_broadcast_api::on_applied_block (const signed_block &b)
 Not reflected, thus not accessible to API clients. This function is registered to receive the applied_block signal from the chain database when a block is received. It then dispatches callbacks to clients who have requested to be notified when a particular txid is included in a block. More...
 

Detailed Description

Function Documentation

◆ broadcast_block()

void graphene::app::network_broadcast_api::broadcast_block ( const signed_block block)

Broadcast a block to the network.

Parameters
blockthe signed block to broadcast

Definition at line 164 of file api.cpp.

◆ broadcast_transaction()

void graphene::app::network_broadcast_api::broadcast_transaction ( const signed_transaction trx)

Broadcast a transaction to the network.

Parameters
trxthe transaction to broadcast
Note
the transaction will be checked for validity in the local database prior to broadcasting. If it fails to apply locally, an error will be thrown and the transaction will not be broadcast

Definition at line 148 of file api.cpp.

◆ broadcast_transaction_synchronous()

fc::variant graphene::app::network_broadcast_api::broadcast_transaction_synchronous ( const signed_transaction trx)

This call will not return until the transaction is included in a block.

Parameters
trxthe transaction to broadcast

Definition at line 155 of file api.cpp.

◆ broadcast_transaction_with_callback()

void graphene::app::network_broadcast_api::broadcast_transaction_with_callback ( confirmation_callback  cb,
const signed_transaction trx 
)

This version of broadcast transaction registers a callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block.

Parameters
cbcallback function
trxthe transaction to broadcast

Definition at line 170 of file api.cpp.

◆ info()

string graphene::app::network_broadcast_api::info ( )
inline

Get the name of the API.

Returns
the name of the API

Definition at line 199 of file api.hpp.

◆ on_applied_block()

void graphene::app::network_broadcast_api::on_applied_block ( const signed_block b)

Not reflected, thus not accessible to API clients. This function is registered to receive the applied_block signal from the chain database when a block is received. It then dispatches callbacks to clients who have requested to be notified when a particular txid is included in a block.

Parameters
bthe signed block

we need to ensure the database_api is not deleted for the life of the async operation

Definition at line 124 of file api.cpp.