Documentation ¶
Index ¶
- type Node
- func (n *Node) CheckTx(ctx context.Context, tx []byte) (*protocol.CheckTxResult, error)
- func (n *Node) Cleanup()
- func (n *Node) HandleNewBlockEarlyLocked(*runtime.BlockInfo)
- func (n *Node) HandleNewBlockLocked(*runtime.BlockInfo)
- func (n *Node) HandleRuntimeHostEventLocked(*host.Event)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) Query(ctx context.Context, round uint64, method string, args []byte, ...) ([]byte, error)
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
- func (n *Node) SubmitTx(ctx context.Context, tx []byte) (*SubmitTxSubscription, *protocol.Error, error)
- type SubmitTxSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a client node.
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Node) HandleNewBlockEarlyLocked ¶
HandleNewBlockEarlyLocked is guarded by CrossNode.
func (*Node) HandleNewBlockLocked ¶
HandleNewBlockLocked is guarded by CrossNode.
func (*Node) HandleRuntimeHostEventLocked ¶ added in v0.2202.0
HandleRuntimeHostEventLocked is guarded by CrossNode.
func (*Node) Initialized ¶
func (n *Node) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the node is initialized and ready to service requests.
func (*Node) Quit ¶
func (n *Node) Quit() <-chan struct{}
Quit returns a channel that will be closed when the service terminates.
func (*Node) SubmitTx ¶
func (n *Node) SubmitTx(ctx context.Context, tx []byte) (*SubmitTxSubscription, *protocol.Error, error)
SubmitTx submits the transaction to the transaction pool, waits for it to be checked and returns a subscription that gets a notification when the transaction is included in a block.
When the caller is not interested in the transaction execution result, it should call `Stop` on the returned subscription. Not doing so may leak resources associated with tracking the submitted transaction.
type SubmitTxSubscription ¶ added in v0.2402.0
type SubmitTxSubscription struct {
// contains filtered or unexported fields
}
SubmitTxSubscription is a subscription to a transaction submission result.
func (*SubmitTxSubscription) Result ¶ added in v0.2402.0
func (sr *SubmitTxSubscription) Result() <-chan *api.SubmitTxResult
Result returns a channel that will receive the transaction submission result once the transaction has been included in a block.
func (*SubmitTxSubscription) Stop ¶ added in v0.2402.0
func (sr *SubmitTxSubscription) Stop()
Stop notifies the client to stop watching for the transaction submission result.