Documentation ¶
Index ¶
- Constants
- type GetAncestorBlockIDRequest
- type GetAncestorBlockIDResponse
- type GetBlocksRequest
- type GetBlocksResponse
- type GetChainIDRequest
- type GetChainIDResponse
- type GetHeadBlockRequest
- type GetHeadBlockResponse
- type KoinosRPC
- func (k *KoinosRPC) ApplyBlock(ctx context.Context, block *protocol.Block) (*chainrpc.SubmitBlockResponse, error)
- func (k *KoinosRPC) ApplyTransaction(ctx context.Context, trx *protocol.Transaction) (*chainrpc.SubmitTransactionResponse, error)
- func (k *KoinosRPC) BroadcastGossipStatus(ctx context.Context, enabled bool) error
- func (k *KoinosRPC) GetBlocksByHeight(ctx context.Context, blockID multihash.Multihash, height uint64, ...) (*block_store.GetBlocksByHeightResponse, error)
- func (k *KoinosRPC) GetBlocksByID(ctx context.Context, blockIDs []multihash.Multihash) (*block_store.GetBlocksByIdResponse, error)
- func (k *KoinosRPC) GetChainID(ctx context.Context) (*chainrpc.GetChainIdResponse, error)
- func (k *KoinosRPC) GetForkHeads(ctx context.Context) (*chainrpc.GetForkHeadsResponse, error)
- func (k *KoinosRPC) GetHeadBlock(ctx context.Context) (*chainrpc.GetHeadInfoResponse, error)
- func (k *KoinosRPC) IsConnectedToBlockStore(ctx context.Context) (bool, error)
- func (k *KoinosRPC) IsConnectedToChain(ctx context.Context) (bool, error)
- type LocalRPC
- type PeerRPC
- func (p *PeerRPC) GetAncestorBlockID(ctx context.Context, parentID multihash.Multihash, childHeight uint64) (id multihash.Multihash, err error)
- func (p *PeerRPC) GetBlocks(ctx context.Context, headBlockID multihash.Multihash, startBlockHeight uint64, ...) (blocks []protocol.Block, err error)
- func (p *PeerRPC) GetChainID(ctx context.Context) (id multihash.Multihash, err error)
- func (p *PeerRPC) GetHeadBlock(ctx context.Context) (id multihash.Multihash, height uint64, err error)
- type PeerRPCService
- func (p *PeerRPCService) GetAncestorBlockID(ctx context.Context, request *GetAncestorBlockIDRequest, ...) error
- func (p *PeerRPCService) GetBlocks(ctx context.Context, request *GetBlocksRequest, response *GetBlocksResponse) error
- func (p *PeerRPCService) GetChainID(ctx context.Context, request *GetChainIDRequest, response *GetChainIDResponse) error
- func (p *PeerRPCService) GetHeadBlock(ctx context.Context, request *GetHeadBlockRequest, ...) error
- type RemoteRPC
Constants ¶
const ( ChainRPC = "chain" BlockStoreRPC = "block_store" )
RPC service constants
const PeerRPCID = "/koinos/peerrpc/1.0.0"
PeerRPCID Identifies the peer rpc service
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetAncestorBlockIDRequest ¶ added in v0.2.0
type GetAncestorBlockIDRequest struct { ParentID multihash.Multihash ChildHeight uint64 }
GetAncestorBlockIDRequest args
type GetAncestorBlockIDResponse ¶ added in v0.2.0
type GetAncestorBlockIDResponse struct {
ID multihash.Multihash
}
GetAncestorBlockIDResponse return
type GetBlocksRequest ¶ added in v0.2.0
type GetBlocksRequest struct { HeadBlockID multihash.Multihash StartBlockHeight uint64 NumBlocks uint32 }
GetBlocksRequest args
type GetBlocksResponse ¶ added in v0.2.0
type GetBlocksResponse struct {
Blocks [][]byte
}
GetBlocksResponse return
type GetChainIDResponse ¶ added in v0.2.0
type GetChainIDResponse struct {
ID multihash.Multihash
}
GetChainIDResponse return
type GetHeadBlockRequest ¶ added in v0.2.0
type GetHeadBlockRequest struct { }
GetHeadBlockRequest args
type GetHeadBlockResponse ¶ added in v0.2.0
type GetHeadBlockResponse struct { ID multihash.Multihash Height uint64 }
GetHeadBlockResponse return
type KoinosRPC ¶
type KoinosRPC struct {
// contains filtered or unexported fields
}
KoinosRPC implements LocalRPC implementation by communicating with a local Koinos node via AMQP
func (*KoinosRPC) ApplyBlock ¶
func (k *KoinosRPC) ApplyBlock(ctx context.Context, block *protocol.Block) (*chainrpc.SubmitBlockResponse, error)
ApplyBlock rpc call
func (*KoinosRPC) ApplyTransaction ¶
func (k *KoinosRPC) ApplyTransaction(ctx context.Context, trx *protocol.Transaction) (*chainrpc.SubmitTransactionResponse, error)
ApplyTransaction rpc call
func (*KoinosRPC) BroadcastGossipStatus ¶ added in v0.3.0
BroadcastGossipStatus broadcasts the gossip status to the
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) GetBlocksByID ¶
func (k *KoinosRPC) GetBlocksByID(ctx context.Context, blockIDs []multihash.Multihash) (*block_store.GetBlocksByIdResponse, error)
GetBlocksByID rpc call
func (*KoinosRPC) GetChainID ¶
GetChainID rpc call
func (*KoinosRPC) GetForkHeads ¶
GetForkHeads rpc call
func (*KoinosRPC) GetHeadBlock ¶
GetHeadBlock rpc call
func (*KoinosRPC) IsConnectedToBlockStore ¶
IsConnectedToBlockStore returns if the AMQP connection can currently communicate with the block store microservice.
type LocalRPC ¶ added in v0.2.0
type LocalRPC interface { GetHeadBlock(ctx context.Context) (*chain.GetHeadInfoResponse, error) ApplyBlock(ctx context.Context, block *protocol.Block) (*chain.SubmitBlockResponse, error) ApplyTransaction(ctx context.Context, block *protocol.Transaction) (*chain.SubmitTransactionResponse, error) GetBlocksByHeight(ctx context.Context, blockIDs multihash.Multihash, height uint64, numBlocks uint32) (*block_store.GetBlocksByHeightResponse, error) GetChainID(ctx context.Context) (*chain.GetChainIdResponse, error) GetForkHeads(ctx context.Context) (*chain.GetForkHeadsResponse, error) GetBlocksByID(ctx context.Context, blockIDs []multihash.Multihash) (*block_store.GetBlocksByIdResponse, error) BroadcastGossipStatus(ctx context.Context, enabled bool) error IsConnectedToBlockStore(ctx context.Context) (bool, error) IsConnectedToChain(ctx context.Context) (bool, error) }
LocalRPC interface for local node RPC methods required for koinos-p2p to function
type PeerRPC ¶ added in v0.2.0
type PeerRPC struct {
// contains filtered or unexported fields
}
PeerRPC implements RemoteRPC interface by communicating via libp2p's gorpc
func NewPeerRPC ¶ added in v0.2.0
NewPeerRPC creates a PeerRPC
func (*PeerRPC) GetAncestorBlockID ¶ added in v0.2.0
func (p *PeerRPC) GetAncestorBlockID(ctx context.Context, parentID multihash.Multihash, childHeight uint64) (id multihash.Multihash, err error)
GetAncestorBlockID rpc call
func (*PeerRPC) GetBlocks ¶ added in v0.2.0
func (p *PeerRPC) GetBlocks(ctx context.Context, headBlockID multihash.Multihash, startBlockHeight uint64, numBlocks uint32) (blocks []protocol.Block, err error)
GetBlocks rpc call
func (*PeerRPC) GetChainID ¶ added in v0.2.0
GetChainID rpc call
type PeerRPCService ¶ added in v0.2.0
type PeerRPCService struct {
// contains filtered or unexported fields
}
PeerRPCService implements a libp2p_rpc service
func NewPeerRPCService ¶ added in v0.2.0
func NewPeerRPCService(local LocalRPC) *PeerRPCService
NewPeerRPCService creates a PeerRPCService
func (*PeerRPCService) GetAncestorBlockID ¶ added in v0.2.0
func (p *PeerRPCService) GetAncestorBlockID(ctx context.Context, request *GetAncestorBlockIDRequest, response *GetAncestorBlockIDResponse) error
GetAncestorBlockID peer rpc implementation
func (*PeerRPCService) GetBlocks ¶ added in v0.2.0
func (p *PeerRPCService) GetBlocks(ctx context.Context, request *GetBlocksRequest, response *GetBlocksResponse) error
GetBlocks peer rpc implementation
func (*PeerRPCService) GetChainID ¶ added in v0.2.0
func (p *PeerRPCService) GetChainID(ctx context.Context, request *GetChainIDRequest, response *GetChainIDResponse) error
GetChainID peer rpc implementation
func (*PeerRPCService) GetHeadBlock ¶ added in v0.2.0
func (p *PeerRPCService) GetHeadBlock(ctx context.Context, request *GetHeadBlockRequest, response *GetHeadBlockResponse) error
GetHeadBlock peer rpc implementation
type RemoteRPC ¶ added in v0.2.0
type RemoteRPC interface { GetChainID(ctx context.Context) (id multihash.Multihash, err error) GetHeadBlock(ctx context.Context) (id multihash.Multihash, height uint64, err error) GetAncestorBlockID(ctx context.Context, parentID multihash.Multihash, childHeight uint64) (id multihash.Multihash, err error) GetBlocks(ctx context.Context, headBlockID multihash.Multihash, startBlockHeight uint64, batchSize uint32) (blocks []protocol.Block, err error) }
RemoteRPC interface for remote node RPC methods required for koinos-p2p to function