core

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

README

PellDVS RPC

Pagination

Requests that return multiple items will be paginated to 30 items by default. You can specify further pages with the ?page parameter. You can also set a custom page size up to 100 with the ?per_page parameter.

Subscribing to events

The user can subscribe to events emitted by PellDVS, using /subscribe. If the maximum number of clients is reached or the client has too many subscriptions, an error will be returned. The subscription timeout is 5 sec. Each subscription has a buffer to accommodate short bursts of events or some slowness in clients. If the buffer gets full, the subscription will be canceled ("client is not pulling messages fast enough"). If PellDVS exits, all subscriptions are canceled ("PellDVS exited"). The user can unsubscribe using either /unsubscribe or /unsubscribe_all.

Documentation

Index

Constants

View Source
const (

	// SubscribeTimeout is the maximum time we wait to subscribe for an event.
	// must be less than the server's write timeout (see rpcserver.DefaultConfig)
	SubscribeTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	// external, thread safe interfaces
	ProxyAppQuery proxy.AppConnQuery
	DVSReactor    security.DVSReactor

	P2PPeers     peers
	P2PTransport transport

	DvsRequestIndexer requestindex.DvsRequestIndexer

	Logger log.Logger
	Config cfg.RPCConfig
}

---------------------------------------------- Environment contains objects and interfaces used by the RPC. It is expected to be setup once during startup.

func (*Environment) AVSIInfo

func (env *Environment) AVSIInfo(_ *rpctypes.Context) (*ctypes.ResultAVSIInfo, error)

AVSIInfo gets some info about the application.

func (*Environment) AVSIQuery

func (env *Environment) AVSIQuery(
	_ *rpctypes.Context,
	path string,
	data bytes.HexBytes,
	height int64,
	prove bool,
) (*ctypes.ResultAVSIQuery, error)

AVSIQuery queries the application for some information.

func (*Environment) AddUnsafeRoutes

func (env *Environment) AddUnsafeRoutes(routes RoutesMap)

AddUnsafeRoutes adds unsafe routes.

func (*Environment) GetRoutes

func (env *Environment) GetRoutes() RoutesMap

Routes is a map of available routes.

func (*Environment) Health

Health gets node health. Returns empty result (200 OK) on success, no response - in case of an error.

func (*Environment) NetInfo

NetInfo returns network info.

func (*Environment) QueryRequest

func (env *Environment) QueryRequest(_ *rpctypes.Context, hash string) (*ctypes.ResultDvsRequest, error)

QueryRequest allows you to query for a DVS request result. It returns a

func (*Environment) RequestDVS

func (env *Environment) RequestDVS(ctx *rpctypes.Context,
	data []byte,
	height int64,
	chainid int64,
	groupNumbers []uint32,
	groupThresholdPercentages []uint32,
) (*ctypes.ResultRequest, error)

func (*Environment) RequestDVSAsync

func (env *Environment) RequestDVSAsync(ctx *rpctypes.Context,
	data []byte,
	height int64,
	chainID int64,
	groupNumbers []uint32,
	groupThresholdPercentages []uint32,
) (*ctypes.ResultRequestDvsAsync, error)

func (*Environment) SearchRequest

func (env *Environment) SearchRequest(
	ctx *rpctypes.Context,
	query string,
	pagePtr, perPagePtr *int,
) (*ctypes.ResultDvsRequestSearch, error)

SearchRequest allows you to query for multiple DVS request results. It returns a

func (*Environment) UnsafeDialPeers

func (env *Environment) UnsafeDialPeers(
	_ *rpctypes.Context,
	peers []string,
	persistent, unconditional, private bool,
) (*ctypes.ResultDialPeers, error)

UnsafeDialPeers dials the given peers (comma-separated id@IP:PORT), optionally making them persistent.

func (*Environment) UnsafeDialSeeds

func (env *Environment) UnsafeDialSeeds(_ *rpctypes.Context, seeds []string) (*ctypes.ResultDialSeeds, error)

UnsafeDialSeeds dials the given seeds (comma-separated id@IP:PORT).

type RoutesMap

type RoutesMap map[string]*rpc.RPCFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL