Help us shape the future of Go! Take the 2026 Go Developer Survey

services

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeService

type NodeService struct {
	// contains filtered or unexported fields
}

NodeService implements types.Service. It provides node specific operations that can be used by the JS module, RPC APIs etc

func New

func New(rpcAddr string) *NodeService

New creates an instance of NodeService. The function panics if rpcAddr is an invalid address.

func (*NodeService) GetBlock

func (s *NodeService) GetBlock(ctx context.Context, height *int64) (*core_types.ResultBlock, error)

GetBlock fetches a block at the given height

func (*NodeService) GetTx

func (s *NodeService) GetTx(ctx context.Context, hash []byte, proof bool) (types.BaseTx, *tmtypes.TxProof, error)

GetTx gets a transaction by hash

func (*NodeService) IsSyncing

func (s *NodeService) IsSyncing(ctx context.Context) (bool, error)

IsSyncing checks whether the node has caught up with the rest of its connected peers

func (*NodeService) NetInfo

NetInfo returns network information

type Service

type Service interface {
	GetBlock(ctx context.Context, height *int64) (*core_types.ResultBlock, error)
	IsSyncing(ctx context.Context) (bool, error)
	NetInfo(ctx context.Context) (*core_types.ResultNetInfo, error)
	GetTx(ctx context.Context, hash []byte, proof bool) (types.BaseTx, *tmtypes.TxProof, error)
}

Service provides operation that access external logic not directly offered by any of the packages of the project. For instance, access to tendermint RPC is provided.

Jump to

Keyboard shortcuts

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