rpc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetHeadInfoCall       = "chain.get_head_info"
	GetBlocksByHeightCall = "block_store.get_blocks_by_height"
	SubmitBlockCall       = "chain.submit_block"
)

RPC service constants

View Source
const (
	ChainRPC      = "chain"
	BlockStoreRPC = "block_store"
)

RPC service constants

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonRPC

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

JsonRPC

func NewJsonRPC

func NewJsonRPC(client *kjsonrpc.KoinosRPCClient) *JsonRPC

NewJsonRPC factory

func (*JsonRPC) ApplyBlock

func (k *JsonRPC) ApplyBlock(ctx context.Context, block *protocol.Block) (*chainrpc.SubmitBlockResponse, error)

func (*JsonRPC) GetBlocksByHeight

func (k *JsonRPC) GetBlocksByHeight(ctx context.Context, blockID multihash.Multihash, height uint64, numBlocks uint32) (*block_store.GetBlocksByHeightResponse, error)

func (*JsonRPC) GetHeadInfo

func (k *JsonRPC) GetHeadInfo(ctx context.Context) (*chainrpc.GetHeadInfoResponse, error)

type KoinosRPC

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

KoinosRPC implements LocalRPC implementation by communicating with a local Koinos node via AMQP

func NewKoinosRPC

func NewKoinosRPC(mq *koinosmq.Client) *KoinosRPC

NewKoinosRPC factory

func (*KoinosRPC) ApplyBlock

func (k *KoinosRPC) ApplyBlock(ctx context.Context, block *protocol.Block) (*chainrpc.SubmitBlockResponse, error)

ApplyBlock rpc call

func (*KoinosRPC) GetBlocksByHeight

func (k *KoinosRPC) GetBlocksByHeight(ctx context.Context, blockID multihash.Multihash, height uint64, numBlocks uint32) (*block_store.GetBlocksByHeightResponse, error)

// GetBlocksByHeight rpc call

func (*KoinosRPC) GetHeadInfo

func (k *KoinosRPC) GetHeadInfo(ctx context.Context) (*chainrpc.GetHeadInfoResponse, error)

GetHeadInfo rpc call

func (*KoinosRPC) IsConnectedToChain

func (k *KoinosRPC) IsConnectedToChain(ctx context.Context) (bool, error)

IsConnectedToChain returns if the AMQP connection can currently communicate with the chain microservice.

Jump to

Keyboard shortcuts

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