4.7. Network Broadcast API

The network broadcast API is available from the full node via websockets.

If you have not set up your websockets connection, please read this article.

4.7.1. Transactions broadcast_transaction

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

Broadcast a transaction to the network.

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.

  • trx: The transaction to broadcast 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.

4.7.2. Block broadcast_block

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

Broadcast a signed block to the network.

  • block: The signed block to broadcast