Documentation ¶
Overview ¶
*
- @file
- @copyright defined in aergo/LICENSE.txt
Index ¶
- Constants
- Variables
- type AdminService
- type AergoRPCService
- func (rpc *AergoRPCService) Blockchain(ctx context.Context, in *types.Empty) (*types.BlockchainStatus, error)
- func (rpc *AergoRPCService) BroadcastToEventStream(events []*types.Event) error
- func (rpc *AergoRPCService) BroadcastToListBlockMetadataStream(meta *types.BlockMetadata)
- func (rpc *AergoRPCService) BroadcastToListBlockStream(block *types.Block)
- func (rpc *AergoRPCService) ChainStat(ctx context.Context, in *types.Empty) (*types.ChainStats, error)
- func (rpc *AergoRPCService) CommitTX(ctx context.Context, in *types.TxList) (*types.CommitResultList, error)
- func (rpc *AergoRPCService) CreateAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *AergoRPCService) ExportAccount(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
- func (rpc *AergoRPCService) ExportAccountKeystore(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
- func (rpc *AergoRPCService) GetABI(ctx context.Context, in *types.SingleBytes) (*types.ABI, error)
- func (rpc *AergoRPCService) GetAccountVotes(ctx context.Context, in *types.AccountAddress) (*types.AccountVoteInfo, error)
- func (rpc *AergoRPCService) GetAccounts(ctx context.Context, in *types.Empty) (*types.AccountList, error)
- func (rpc *AergoRPCService) GetBlock(ctx context.Context, in *types.SingleBytes) (*types.Block, error)
- func (rpc *AergoRPCService) GetBlockBody(ctx context.Context, in *types.BlockBodyParams) (*types.BlockBodyPaged, error)
- func (rpc *AergoRPCService) GetBlockMetadata(ctx context.Context, in *types.SingleBytes) (*types.BlockMetadata, error)
- func (rpc *AergoRPCService) GetBlockTX(ctx context.Context, in *types.SingleBytes) (*types.TxInBlock, error)
- func (rpc *AergoRPCService) GetChainInfo(ctx context.Context, in *types.Empty) (*types.ChainInfo, error)
- func (rpc *AergoRPCService) GetConfChangeProgress(ctx context.Context, in *types.SingleBytes) (*types.ConfChangeProgress, error)
- func (rpc *AergoRPCService) GetConsensusInfo(ctx context.Context, in *types.Empty) (*types.ConsensusInfo, error)
- func (rpc *AergoRPCService) GetEnterpriseConfig(ctx context.Context, in *types.EnterpriseConfigKey) (*types.EnterpriseConfig, error)
- func (rpc *AergoRPCService) GetNameInfo(ctx context.Context, in *types.Name) (*types.NameInfo, error)
- func (rpc *AergoRPCService) GetPeers(ctx context.Context, in *types.PeersParams) (*types.PeerList, error)
- func (rpc *AergoRPCService) GetReceipt(ctx context.Context, in *types.SingleBytes) (*types.Receipt, error)
- func (rpc *AergoRPCService) GetServerInfo(ctx context.Context, in *types.KeyParams) (*types.ServerInfo, error)
- func (rpc *AergoRPCService) GetStaking(ctx context.Context, in *types.AccountAddress) (*types.Staking, error)
- func (rpc *AergoRPCService) GetState(ctx context.Context, in *types.SingleBytes) (*types.State, error)
- func (rpc *AergoRPCService) GetStateAndProof(ctx context.Context, in *types.AccountAndRoot) (*types.AccountProof, error)
- func (rpc *AergoRPCService) GetTX(ctx context.Context, in *types.SingleBytes) (*types.Tx, error)
- func (rpc *AergoRPCService) GetVotes(ctx context.Context, in *types.VoteParams) (*types.VoteList, error)
- func (rpc *AergoRPCService) ImportAccount(ctx context.Context, in *types.ImportFormat) (*types.Account, error)
- func (rpc *AergoRPCService) ListBlockHeaders(ctx context.Context, in *types.ListParams) (*types.BlockHeaderList, error)
- func (rpc *AergoRPCService) ListBlockMetadata(ctx context.Context, in *types.ListParams) (*types.BlockMetadataList, error)
- func (rpc *AergoRPCService) ListBlockMetadataStream(in *types.Empty, stream types.AergoRPCService_ListBlockMetadataStreamServer) error
- func (rpc *AergoRPCService) ListBlockStream(in *types.Empty, stream types.AergoRPCService_ListBlockStreamServer) error
- func (rpc *AergoRPCService) ListEventStream(in *types.FilterInfo, stream types.AergoRPCService_ListEventStreamServer) error
- func (rpc *AergoRPCService) ListEvents(ctx context.Context, in *types.FilterInfo) (*types.EventList, error)
- func (rpc *AergoRPCService) LockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *AergoRPCService) Metric(ctx context.Context, req *types.MetricsRequest) (*types.Metrics, error)
- func (rpc *AergoRPCService) NodeState(ctx context.Context, in *types.NodeReq) (*types.SingleBytes, error)
- func (rpc *AergoRPCService) QueryContract(ctx context.Context, in *types.Query) (*types.SingleBytes, error)
- func (rpc *AergoRPCService) QueryContractState(ctx context.Context, in *types.StateQuery) (*types.StateQueryProof, error)
- func (rpc *AergoRPCService) SendTX(ctx context.Context, tx *types.Tx) (*types.CommitResult, error)
- func (rpc *AergoRPCService) SetConsensusAccessor(ca consensus.ConsensusAccessor)
- func (rpc *AergoRPCService) SignTX(ctx context.Context, in *types.Tx) (*types.Tx, error)
- func (rpc *AergoRPCService) Statistics() *map[string]interface{}
- func (rpc *AergoRPCService) UnlockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *AergoRPCService) VerifyTX(ctx context.Context, in *types.Tx) (*types.VerifyResult, error)
- type Authentication
- type EventStream
- type ListBlockMetaStream
- type ListBlockStream
- type RPC
- func (ns *RPC) AfterStart()
- func (ns *RPC) BeforeStart()
- func (ns *RPC) BeforeStop()
- func (ns *RPC) CallRequest(actor string, msg interface{}, timeout time.Duration) (interface{}, error)
- func (ns *RPC) CallRequestDefaultTimeout(actor string, msg interface{}) (interface{}, error)
- func (ns *RPC) CollectServerInfo(categories []string) *types.ServerInfo
- func (ns *RPC) FutureRequest(actor string, msg interface{}, timeout time.Duration) *actor.Future
- func (ns *RPC) FutureRequestDefaultTimeout(actor string, msg interface{}) *actor.Future
- func (ns *RPC) GetChainAccessor() types.ChainAccessor
- func (ns *RPC) Receive(context actor.Context)
- func (ns *RPC) SendRequest(actor string, msg interface{})
- func (ns *RPC) SetConsensusAccessor(ca consensus.ConsensusAccessor)
- func (ns *RPC) SetHub(hub *component.ComponentHub)
- func (ns *RPC) Statistics() *map[string]interface{}
- func (ns *RPC) TellRequest(actor string, msg interface{})
Constants ¶
const DefaultBlockBroadcastBuffer = 5
Variables ¶
var (
ErrUninitAccessor = errors.New("accessor is not initilized")
)
Functions ¶
This section is empty.
Types ¶
type AdminService ¶
type AdminService struct { *component.ComponentHub *log.Logger types.UnimplementedAdminRPCServiceServer // contains filtered or unexported fields }
func NewAdminService ¶
func NewAdminService(conf *config.RPCConfig, hub *component.ComponentHub) *AdminService
func (*AdminService) MempoolTx ¶
func (as *AdminService) MempoolTx(ctx context.Context, in *types.AccountList) (*types.SingleBytes, error)
MempoolTx returns the TX-relasted statistics of the current mempool.
func (*AdminService) MempoolTxStat ¶
func (as *AdminService) MempoolTxStat(ctx context.Context, in *types.Empty) (*types.SingleBytes, error)
MempoolTxStat returns the TX-relasted statistics of the current mempool.
func (*AdminService) Start ¶
func (as *AdminService) Start()
type AergoRPCService ¶
type AergoRPCService struct { types.UnimplementedAergoRPCServiceServer // 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 ¶
func (rpc *AergoRPCService) BroadcastToEventStream(events []*types.Event) error
func (*AergoRPCService) BroadcastToListBlockMetadataStream ¶
func (rpc *AergoRPCService) BroadcastToListBlockMetadataStream(meta *types.BlockMetadata)
func (*AergoRPCService) BroadcastToListBlockStream ¶
func (rpc *AergoRPCService) BroadcastToListBlockStream(block *types.Block)
func (*AergoRPCService) ChainStat ¶
func (rpc *AergoRPCService) ChainStat(ctx context.Context, in *types.Empty) (*types.ChainStats, error)
ChainStat handles rpc request chainstat.
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) ExportAccountKeystore ¶
func (rpc *AergoRPCService) ExportAccountKeystore(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 ¶
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 ¶
func (rpc *AergoRPCService) GetBlockBody(ctx context.Context, in *types.BlockBodyParams) (*types.BlockBodyPaged, error)
GetBlockBody handle rpc request getblockbody
func (*AergoRPCService) GetBlockMetadata ¶
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 ¶
func (rpc *AergoRPCService) GetChainInfo(ctx context.Context, in *types.Empty) (*types.ChainInfo, error)
GetChainInfo handles a getchaininfo RPC request.
func (*AergoRPCService) GetConfChangeProgress ¶
func (rpc *AergoRPCService) GetConfChangeProgress(ctx context.Context, in *types.SingleBytes) (*types.ConfChangeProgress, error)
func (*AergoRPCService) GetConsensusInfo ¶
func (rpc *AergoRPCService) GetConsensusInfo(ctx context.Context, in *types.Empty) (*types.ConsensusInfo, error)
GetConsensusInfo handle rpc request blockchain. It has no additional input parameter
func (*AergoRPCService) GetEnterpriseConfig ¶
func (rpc *AergoRPCService) GetEnterpriseConfig(ctx context.Context, in *types.EnterpriseConfigKey) (*types.EnterpriseConfig, error)
GetEnterpriseConfig return aergo.enterprise configure values. key "ADMINS" is for getting register admin addresses and "ALL" is for getting all key list.
func (*AergoRPCService) GetNameInfo ¶
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 ¶
func (rpc *AergoRPCService) GetServerInfo(ctx context.Context, in *types.KeyParams) (*types.ServerInfo, error)
func (*AergoRPCService) GetStaking ¶
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 ¶
func (rpc *AergoRPCService) ListBlockMetadata(ctx context.Context, in *types.ListParams) (*types.BlockMetadataList, error)
ListBlockMetadata handle rpc request
func (*AergoRPCService) ListBlockMetadataStream ¶
func (rpc *AergoRPCService) ListBlockMetadataStream(in *types.Empty, stream types.AergoRPCService_ListBlockMetadataStreamServer) error
ListBlockMetadataStream starts a stream of new blocks' metadata
func (*AergoRPCService) ListBlockStream ¶
func (rpc *AergoRPCService) ListBlockStream(in *types.Empty, stream types.AergoRPCService_ListBlockStreamServer) error
ListBlockStream starts a stream of new blocks
func (*AergoRPCService) ListEventStream ¶
func (rpc *AergoRPCService) ListEventStream(in *types.FilterInfo, stream types.AergoRPCService_ListEventStreamServer) error
func (*AergoRPCService) ListEvents ¶
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 ¶
func (rpc *AergoRPCService) Metric(ctx context.Context, req *types.MetricsRequest) (*types.Metrics, error)
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 ¶
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 ¶
func (rpc *AergoRPCService) SetConsensusAccessor(ca consensus.ConsensusAccessor)
func (*AergoRPCService) Statistics ¶
func (rpc *AergoRPCService) Statistics() *map[string]interface{}
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 Authentication ¶
type Authentication = int
const ( ReadBlockChain Authentication = 1 WriteBlockChain Authentication = 2 ShowNode Authentication = 4 ControlNode Authentication = 8 )
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
type ListBlockMetaStream ¶
type ListBlockMetaStream struct {
// contains filtered or unexported fields
}
ListBlockMetaStream manages server stream of listBlock RPC FIXME this class has a lot of duplication to ListBlockStream
func NewListBlockMetaStream ¶
func NewListBlockMetaStream(id uint32, stream types.AergoRPCService_ListBlockMetadataStreamServer) *ListBlockMetaStream
func (*ListBlockMetaStream) GoAway ¶
func (s *ListBlockMetaStream) GoAway()
func (*ListBlockMetaStream) Send ¶
func (s *ListBlockMetaStream) Send(block *types.BlockMetadata) error
func (*ListBlockMetaStream) StartSend ¶
func (s *ListBlockMetaStream) StartSend()
type ListBlockStream ¶
type ListBlockStream struct {
// contains filtered or unexported fields
}
ListBlockStream manages server stream of listBlock RPC
func NewListBlockStream ¶
func NewListBlockStream(id uint32, stream types.AergoRPCService_ListBlockStreamServer) *ListBlockStream
func (*ListBlockStream) GoAway ¶
func (s *ListBlockStream) GoAway()
func (*ListBlockStream) StartSend ¶
func (s *ListBlockStream) StartSend()
type RPC ¶
type RPC struct { *component.BaseComponent // contains filtered or unexported fields }
RPC is actor for providing rpc service
func (*RPC) AfterStart ¶
func (ns *RPC) AfterStart()
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 ¶
CallRequest implement interface method of ActorService
func (*RPC) CollectServerInfo ¶
func (ns *RPC) CollectServerInfo(categories []string) *types.ServerInfo
func (*RPC) FutureRequest ¶
FutureRequest implement interface method of ActorService
func (*RPC) FutureRequestDefaultTimeout ¶
FutureRequestDefaultTimeout implement interface method of ActorService
func (*RPC) GetChainAccessor ¶
func (ns *RPC) GetChainAccessor() types.ChainAccessor
GetChainAccessor implment interface method of ActorService
func (*RPC) SendRequest ¶
SendRequest implement interface method of ActorService
func (*RPC) SetConsensusAccessor ¶
func (ns *RPC) SetConsensusAccessor(ca consensus.ConsensusAccessor)
func (*RPC) SetHub ¶
func (ns *RPC) SetHub(hub *component.ComponentHub)
func (*RPC) Statistics ¶
func (*RPC) TellRequest ¶
TellRequest implement interface method of ActorService