Documentation
¶
Index ¶
- type Local
- func (c *Local) DialPeers(_ context.Context, peers []string, persistent, unconditional, private bool) (*ctypes.ResultDialPeers, error)
- func (c *Local) DialSeeds(_ context.Context, seeds []string) (*ctypes.ResultDialSeeds, error)
- func (c *Local) GenesisChunked(_ context.Context, id uint) (*ctypes.ResultGenesisChunk, error)
- func (c *Local) Health(context.Context) (*ctypes.ResultHealth, error)
- func (c *Local) IsRunning() bool
- func (c *Local) NetInfo(context.Context) (*ctypes.ResultNetInfo, error)
- func (c *Local) QueryRequest(hash string) (*ctypes.ResultDvsRequest, error)
- func (c *Local) RequestDVS(_ context.Context, data []byte, height int64, chainid int64, ...) (*ctypes.ResultRequest, error)
- func (c *Local) RequestDVSAsync(_ context.Context, data []byte, height int64, chainid int64, ...) (*ctypes.ResultRequestDvsAsync, error)
- func (c *Local) SetLogger(l log.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct {
// *types.EventBus
Logger log.Logger
// contains filtered or unexported fields
}
Local is a Client implementation that directly executes the rpc functions on a given node, without going through HTTP or GRPC.
This implementation is useful for:
* Running tests against a node in-process without the overhead of going through an http server * Communication between an AVSI app and PellDVS when they are compiled in process.
For real clients, you probably want to use client.HTTP. For more powerful control during testing, you probably want the "client/mock" package.
You can subscribe for any event published by PellDVS using Subscribe method. Note delivery is best-effort. If you don't read events fast enough, PellDVS might cancel the subscription. The client will attempt to resubscribe (you don't need to do anything). It will keep trying indefinitely with exponential backoff (10ms -> 20ms -> 40ms) until successful.
func (*Local) GenesisChunked ¶
func (*Local) QueryRequest ¶
func (c *Local) QueryRequest(hash string) (*ctypes.ResultDvsRequest, error)