NodeGRPCService class
A gRPC service client for interacting with a remote node.
This class provides methods to fetch transaction, block headers and bodies, current mempool,
broadcast a transaction and synchronization traversal from a remote node using gRPC protocol.
It requires a host
and port
to establish a connection with the remote node, and
ChannelOptions
can be optionally provided for further configuration
Constructors
- NodeGRPCService({required Object host, required int port, ChannelOptions options = const ChannelOptions(credentials: ChannelCredentials.insecure())})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → Object
-
The host name or IP address of the remote node.
final
- nodeStub → NodeRpcClient
-
The client stub for the gRPC service
final
- options → ChannelOptions
-
The configuration options for the gRPC channel.
final
- port → int
-
The port used to establish a connection with the remote node.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
broadcastTransaction(
{required IoTransaction transaction, CallOptions? options}) → Future< BroadcastTransactionRes> -
Broadcasts a
transaction
to the network. -
currentMempool(
{CallOptions? options}) → Future< CurrentMempoolRes> - Returns a CurrentMempoolRes object for the current mempool.
-
fetchBlockBody(
{required int blockId, CallOptions? options}) → Future< FetchBlockBodyRes> -
Returns a FetchBlockBodyRes object for the block at the given
blockId
. -
fetchBlockHeader(
{required int blockId, CallOptions? options}) → Future< FetchBlockHeaderRes> -
Returns a FetchBlockHeaderRes object for the block at the given
blockId
. -
fetchBlockIdAtDepth(
{required int depth, CallOptions? options}) → Future< FetchBlockIdAtDepthRes> -
Returns a FetchBlockIdAtDepthRes object for the block at the given
depth
. -
fetchBlockIdAtHeight(
{required int height, CallOptions? options}) → Future< FetchBlockIdAtHeightRes> -
Returns a FetchBlockIdAtHeightRes object for the block at the given
height
. -
fetchTransaction(
{required int transactionId, CallOptions? options}) → Future< FetchTransactionRes> -
Returns a FetchTransactionRes object for the transaction at the given
transactionId
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
synchronizationTraversal(
{CallOptions? options}) → Stream< SynchronizationTraversalRes> - Streams a SynchronizationTraversalRes object for the current synchronization traversal.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited