rpc

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUninitAccessor = errors.New("accessor is not initilized")
)

Functions

This section is empty.

Types

type AergoRPCService

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

AergoRPCService implements GRPC server which is defined in rpc.proto

func (*AergoRPCService) Blockchain

func (rpc *AergoRPCService) Blockchain(ctx context.Context, in *types.Empty) (*types.BlockchainStatus, error)

Blockchain handle rpc request blockchain. It has no additional input parameter

func (*AergoRPCService) BroadcastToEventStream added in v0.12.0

func (rpc *AergoRPCService) BroadcastToEventStream(events []*types.Event) error

func (*AergoRPCService) BroadcastToListBlockMetadataStream added in v0.9.4

func (rpc *AergoRPCService) BroadcastToListBlockMetadataStream(meta *types.BlockMetadata)

func (*AergoRPCService) BroadcastToListBlockStream

func (rpc *AergoRPCService) BroadcastToListBlockStream(block *types.Block)

func (*AergoRPCService) CommitTX

func (rpc *AergoRPCService) CommitTX(ctx context.Context, in *types.TxList) (*types.CommitResultList, error)

CommitTX handle rpc request commit

func (*AergoRPCService) CreateAccount

func (rpc *AergoRPCService) CreateAccount(ctx context.Context, in *types.Personal) (*types.Account, error)

CreateAccount handle rpc request newaccount

func (*AergoRPCService) ExportAccount

func (rpc *AergoRPCService) ExportAccount(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)

func (*AergoRPCService) GetABI

func (rpc *AergoRPCService) GetABI(ctx context.Context, in *types.SingleBytes) (*types.ABI, error)

func (*AergoRPCService) GetAccountVotes added in v1.0.0

func (rpc *AergoRPCService) GetAccountVotes(ctx context.Context, in *types.AccountAddress) (*types.AccountVoteInfo, error)

func (*AergoRPCService) GetAccounts

func (rpc *AergoRPCService) GetAccounts(ctx context.Context, in *types.Empty) (*types.AccountList, error)

GetAccounts handle rpc request getaccounts

func (*AergoRPCService) GetBlock

func (rpc *AergoRPCService) GetBlock(ctx context.Context, in *types.SingleBytes) (*types.Block, error)

GetBlock handle rpc request getblock

func (*AergoRPCService) GetBlockBody added in v0.11.0

GetBlockBody handle rpc request getblockbody

func (*AergoRPCService) GetBlockMetadata added in v0.11.0

func (rpc *AergoRPCService) GetBlockMetadata(ctx context.Context, in *types.SingleBytes) (*types.BlockMetadata, error)

GetBlockMetadata handle rpc request getblock

func (*AergoRPCService) GetBlockTX

func (rpc *AergoRPCService) GetBlockTX(ctx context.Context, in *types.SingleBytes) (*types.TxInBlock, error)

GetBlockTX handle rpc request gettx

func (*AergoRPCService) GetChainInfo added in v0.11.0

func (rpc *AergoRPCService) GetChainInfo(ctx context.Context, in *types.Empty) (*types.ChainInfo, error)

GetChainInfo handles a getchaininfo RPC request.

func (*AergoRPCService) GetConsensusInfo added in v1.0.0

func (rpc *AergoRPCService) GetConsensusInfo(ctx context.Context, in *types.Empty) (*types.ConsensusInfo, error)

Blockchain handle rpc request blockchain. It has no additional input parameter

func (*AergoRPCService) GetNameInfo added in v0.9.4

func (rpc *AergoRPCService) GetNameInfo(ctx context.Context, in *types.Name) (*types.NameInfo, error)

func (*AergoRPCService) GetPeers

func (rpc *AergoRPCService) GetPeers(ctx context.Context, in *types.PeersParams) (*types.PeerList, error)

GetPeers handle rpc request getpeers

func (*AergoRPCService) GetReceipt

func (rpc *AergoRPCService) GetReceipt(ctx context.Context, in *types.SingleBytes) (*types.Receipt, error)

func (*AergoRPCService) GetServerInfo added in v1.0.0

func (rpc *AergoRPCService) GetServerInfo(ctx context.Context, in *types.KeyParams) (*types.ServerInfo, error)

func (*AergoRPCService) GetStaking added in v0.8.1

func (rpc *AergoRPCService) GetStaking(ctx context.Context, in *types.AccountAddress) (*types.Staking, error)

GetStaking handle rpc request getstaking

func (*AergoRPCService) GetState

func (rpc *AergoRPCService) GetState(ctx context.Context, in *types.SingleBytes) (*types.State, error)

GetState handle rpc request getstate

func (*AergoRPCService) GetStateAndProof

func (rpc *AergoRPCService) GetStateAndProof(ctx context.Context, in *types.AccountAndRoot) (*types.AccountProof, error)

GetStateAndProof handle rpc request getstateproof

func (*AergoRPCService) GetTX

func (rpc *AergoRPCService) GetTX(ctx context.Context, in *types.SingleBytes) (*types.Tx, error)

GetTX handle rpc request gettx

func (*AergoRPCService) GetVotes

func (rpc *AergoRPCService) GetVotes(ctx context.Context, in *types.VoteParams) (*types.VoteList, error)

GetVotes handle rpc request getvotes

func (*AergoRPCService) ImportAccount

func (rpc *AergoRPCService) ImportAccount(ctx context.Context, in *types.ImportFormat) (*types.Account, error)

func (*AergoRPCService) ListBlockHeaders

func (rpc *AergoRPCService) ListBlockHeaders(ctx context.Context, in *types.ListParams) (*types.BlockHeaderList, error)

ListBlockHeaders (Deprecated) handle rpc request listblocks

func (*AergoRPCService) ListBlockMetadata added in v0.9.4

func (rpc *AergoRPCService) ListBlockMetadata(ctx context.Context, in *types.ListParams) (*types.BlockMetadataList, error)

ListBlockMetadata handle rpc request

func (*AergoRPCService) ListBlockMetadataStream added in v0.9.4

func (rpc *AergoRPCService) ListBlockMetadataStream(in *types.Empty, stream types.AergoRPCService_ListBlockMetadataStreamServer) error

func (*AergoRPCService) ListBlockStream

func (rpc *AergoRPCService) ListBlockStream(in *types.Empty, stream types.AergoRPCService_ListBlockStreamServer) error

real-time streaming most recent block header

func (*AergoRPCService) ListEventStream added in v0.12.0

func (*AergoRPCService) ListEvents added in v0.12.0

func (rpc *AergoRPCService) ListEvents(ctx context.Context, in *types.FilterInfo) (*types.EventList, error)

func (*AergoRPCService) LockAccount

func (rpc *AergoRPCService) LockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)

LockAccount handle rpc request lockaccount

func (*AergoRPCService) Metric added in v0.8.2

func (*AergoRPCService) NodeState

func (rpc *AergoRPCService) NodeState(ctx context.Context, in *types.NodeReq) (*types.SingleBytes, error)

NodeState handle rpc request nodestate

func (*AergoRPCService) QueryContract

func (rpc *AergoRPCService) QueryContract(ctx context.Context, in *types.Query) (*types.SingleBytes, error)

func (*AergoRPCService) QueryContractState added in v0.8.1

func (rpc *AergoRPCService) QueryContractState(ctx context.Context, in *types.StateQuery) (*types.StateQueryProof, error)

QueryContractState queries the state of a contract state variable without executing a contract function.

func (*AergoRPCService) SendTX

func (rpc *AergoRPCService) SendTX(ctx context.Context, tx *types.Tx) (*types.CommitResult, error)

SendTX try to fill the nonce, sign, hash, chainIdHash in the transaction automatically and commit it

func (*AergoRPCService) SetConsensusAccessor added in v1.0.0

func (rpc *AergoRPCService) SetConsensusAccessor(ca consensus.ConsensusAccessor)

func (*AergoRPCService) SignTX

func (rpc *AergoRPCService) SignTX(ctx context.Context, in *types.Tx) (*types.Tx, error)

SignTX handle rpc request signtx

func (*AergoRPCService) UnlockAccount

func (rpc *AergoRPCService) UnlockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)

UnlockAccount handle rpc request unlockaccount

func (*AergoRPCService) VerifyTX

func (rpc *AergoRPCService) VerifyTX(ctx context.Context, in *types.Tx) (*types.VerifyResult, error)

VerifyTX handle rpc request verifytx

type EventStream added in v0.12.0

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

type RPC

type RPC struct {
	*component.BaseComponent
	// contains filtered or unexported fields
}

RPC is actor for providing rpc service

func NewRPC

func NewRPC(cfg *config.Config, chainAccessor types.ChainAccessor, version string) *RPC

NewRPC create an rpc service

func (*RPC) AfterStart

func (ns *RPC) AfterStart()

func (*RPC) BeforeStart

func (ns *RPC) BeforeStart()

Start start rpc service.

func (*RPC) BeforeStop

func (ns *RPC) BeforeStop()

Stop stops rpc service.

func (*RPC) CallRequest

func (ns *RPC) CallRequest(actor string, msg interface{}, timeout time.Duration) (interface{}, error)

CallRequest implement interface method of ActorService

func (*RPC) CallRequestDefaultTimeout

func (ns *RPC) CallRequestDefaultTimeout(actor string, msg interface{}) (interface{}, error)

CallRequest implement interface method of ActorService

func (*RPC) CollectServerInfo added in v1.0.0

func (ns *RPC) CollectServerInfo(categories []string) *types.ServerInfo

func (*RPC) FutureRequest

func (ns *RPC) FutureRequest(actor string, msg interface{}, timeout time.Duration) *actor.Future

FutureRequest implement interface method of ActorService

func (*RPC) FutureRequestDefaultTimeout

func (ns *RPC) FutureRequestDefaultTimeout(actor string, msg interface{}) *actor.Future

FutureRequestDefaultTimeout implement interface method of ActorService

func (*RPC) GetChainAccessor

func (ns *RPC) GetChainAccessor() types.ChainAccessor

GetChainAccessor implment interface method of ActorService

func (*RPC) Receive

func (ns *RPC) Receive(context actor.Context)

func (*RPC) SendRequest

func (ns *RPC) SendRequest(actor string, msg interface{})

SendRequest implement interface method of ActorService

func (*RPC) SetConsensusAccessor added in v1.0.0

func (ns *RPC) SetConsensusAccessor(ca consensus.ConsensusAccessor)

func (*RPC) SetHub added in v0.8.2

func (ns *RPC) SetHub(hub *component.ComponentHub)

func (*RPC) Statistics

func (ns *RPC) Statistics() *map[string]interface{}

func (*RPC) TellRequest

func (ns *RPC) TellRequest(actor string, msg interface{})

TellRequest implement interface method of ActorService

Jump to

Keyboard shortcuts

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