Documentation ¶
Overview ¶
*
- @file
- @copyright defined in meycoin/LICENSE.txt
Index ¶
- Variables
- type AdminService
- type Authentication
- type EventStream
- type MeyCoinRPCService
- func (rpc *MeyCoinRPCService) Blockchain(ctx context.Context, in *types.Empty) (*types.BlockchainStatus, error)
- func (rpc *MeyCoinRPCService) BroadcastToEventStream(events []*types.Event) error
- func (rpc *MeyCoinRPCService) BroadcastToListBlockMetadataStream(meta *types.BlockMetadata)
- func (rpc *MeyCoinRPCService) BroadcastToListBlockStream(block *types.Block)
- func (rpc *MeyCoinRPCService) ChainStat(ctx context.Context, in *types.Empty) (*types.ChainStats, error)
- func (rpc *MeyCoinRPCService) CommitTX(ctx context.Context, in *types.TxList) (*types.CommitResultList, error)
- func (rpc *MeyCoinRPCService) CreateAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *MeyCoinRPCService) ExportAccount(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
- func (rpc *MeyCoinRPCService) ExportAccountKeystore(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
- func (rpc *MeyCoinRPCService) GetABI(ctx context.Context, in *types.SingleBytes) (*types.ABI, error)
- func (rpc *MeyCoinRPCService) GetAccountVotes(ctx context.Context, in *types.AccountAddress) (*types.AccountVoteInfo, error)
- func (rpc *MeyCoinRPCService) GetAccounts(ctx context.Context, in *types.Empty) (*types.AccountList, error)
- func (rpc *MeyCoinRPCService) GetBlock(ctx context.Context, in *types.SingleBytes) (*types.Block, error)
- func (rpc *MeyCoinRPCService) GetBlockBody(ctx context.Context, in *types.BlockBodyParams) (*types.BlockBodyPaged, error)
- func (rpc *MeyCoinRPCService) GetBlockMetadata(ctx context.Context, in *types.SingleBytes) (*types.BlockMetadata, error)
- func (rpc *MeyCoinRPCService) GetBlockTX(ctx context.Context, in *types.SingleBytes) (*types.TxInBlock, error)
- func (rpc *MeyCoinRPCService) GetChainInfo(ctx context.Context, in *types.Empty) (*types.ChainInfo, error)
- func (rpc *MeyCoinRPCService) GetConfChangeProgress(ctx context.Context, in *types.SingleBytes) (*types.ConfChangeProgress, error)
- func (rpc *MeyCoinRPCService) GetConsensusInfo(ctx context.Context, in *types.Empty) (*types.ConsensusInfo, error)
- func (rpc *MeyCoinRPCService) GetEnterpriseConfig(ctx context.Context, in *types.EnterpriseConfigKey) (*types.EnterpriseConfig, error)
- func (rpc *MeyCoinRPCService) GetNameInfo(ctx context.Context, in *types.Name) (*types.NameInfo, error)
- func (rpc *MeyCoinRPCService) GetPeers(ctx context.Context, in *types.PeersParams) (*types.PeerList, error)
- func (rpc *MeyCoinRPCService) GetReceipt(ctx context.Context, in *types.SingleBytes) (*types.Receipt, error)
- func (rpc *MeyCoinRPCService) GetServerInfo(ctx context.Context, in *types.KeyParams) (*types.ServerInfo, error)
- func (rpc *MeyCoinRPCService) GetStaking(ctx context.Context, in *types.AccountAddress) (*types.Staking, error)
- func (rpc *MeyCoinRPCService) GetState(ctx context.Context, in *types.SingleBytes) (*types.State, error)
- func (rpc *MeyCoinRPCService) GetStateAndProof(ctx context.Context, in *types.AccountAndRoot) (*types.AccountProof, error)
- func (rpc *MeyCoinRPCService) GetTX(ctx context.Context, in *types.SingleBytes) (*types.Tx, error)
- func (rpc *MeyCoinRPCService) GetVotes(ctx context.Context, in *types.VoteParams) (*types.VoteList, error)
- func (rpc *MeyCoinRPCService) ImportAccount(ctx context.Context, in *types.ImportFormat) (*types.Account, error)
- func (rpc *MeyCoinRPCService) ListBlockHeaders(ctx context.Context, in *types.ListParams) (*types.BlockHeaderList, error)
- func (rpc *MeyCoinRPCService) ListBlockMetadata(ctx context.Context, in *types.ListParams) (*types.BlockMetadataList, error)
- func (rpc *MeyCoinRPCService) ListBlockMetadataStream(in *types.Empty, stream types.MeyCoinRPCService_ListBlockMetadataStreamServer) error
- func (rpc *MeyCoinRPCService) ListBlockStream(in *types.Empty, stream types.MeyCoinRPCService_ListBlockStreamServer) error
- func (rpc *MeyCoinRPCService) ListEventStream(in *types.FilterInfo, stream types.MeyCoinRPCService_ListEventStreamServer) error
- func (rpc *MeyCoinRPCService) ListEvents(ctx context.Context, in *types.FilterInfo) (*types.EventList, error)
- func (rpc *MeyCoinRPCService) LockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *MeyCoinRPCService) Metric(ctx context.Context, req *types.MetricsRequest) (*types.Metrics, error)
- func (rpc *MeyCoinRPCService) NodeState(ctx context.Context, in *types.NodeReq) (*types.SingleBytes, error)
- func (rpc *MeyCoinRPCService) QueryContract(ctx context.Context, in *types.Query) (*types.SingleBytes, error)
- func (rpc *MeyCoinRPCService) QueryContractState(ctx context.Context, in *types.StateQuery) (*types.StateQueryProof, error)
- func (rpc *MeyCoinRPCService) SendTX(ctx context.Context, tx *types.Tx) (*types.CommitResult, error)
- func (rpc *MeyCoinRPCService) SetConsensusAccessor(ca consensus.ConsensusAccessor)
- func (rpc *MeyCoinRPCService) SignTX(ctx context.Context, in *types.Tx) (*types.Tx, error)
- func (rpc *MeyCoinRPCService) UnlockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
- func (rpc *MeyCoinRPCService) VerifyTX(ctx context.Context, in *types.Tx) (*types.VerifyResult, error)
- 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 ¶
This section is empty.
Variables ¶
var (
ErrUninitAccessor = errors.New("accessor is not initilized")
)
Functions ¶
This section is empty.
Types ¶
type AdminService ¶
type AdminService struct { *component.ComponentHub *log.Logger // 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 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 MeyCoinRPCService ¶
type MeyCoinRPCService struct {
// contains filtered or unexported fields
}
MeyCoinRPCService implements GRPC server which is defined in rpc.proto
func (*MeyCoinRPCService) Blockchain ¶
func (rpc *MeyCoinRPCService) Blockchain(ctx context.Context, in *types.Empty) (*types.BlockchainStatus, error)
Blockchain handle rpc request blockchain. It has no additional input parameter
func (*MeyCoinRPCService) BroadcastToEventStream ¶
func (rpc *MeyCoinRPCService) BroadcastToEventStream(events []*types.Event) error
func (*MeyCoinRPCService) BroadcastToListBlockMetadataStream ¶
func (rpc *MeyCoinRPCService) BroadcastToListBlockMetadataStream(meta *types.BlockMetadata)
func (*MeyCoinRPCService) BroadcastToListBlockStream ¶
func (rpc *MeyCoinRPCService) BroadcastToListBlockStream(block *types.Block)
func (*MeyCoinRPCService) ChainStat ¶
func (rpc *MeyCoinRPCService) ChainStat(ctx context.Context, in *types.Empty) (*types.ChainStats, error)
ChainStat handles rpc request chainstat.
func (*MeyCoinRPCService) CommitTX ¶
func (rpc *MeyCoinRPCService) CommitTX(ctx context.Context, in *types.TxList) (*types.CommitResultList, error)
CommitTX handle rpc request commit
func (*MeyCoinRPCService) CreateAccount ¶
func (rpc *MeyCoinRPCService) CreateAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
CreateAccount handle rpc request newaccount
func (*MeyCoinRPCService) ExportAccount ¶
func (rpc *MeyCoinRPCService) ExportAccount(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
func (*MeyCoinRPCService) ExportAccountKeystore ¶
func (rpc *MeyCoinRPCService) ExportAccountKeystore(ctx context.Context, in *types.Personal) (*types.SingleBytes, error)
func (*MeyCoinRPCService) GetABI ¶
func (rpc *MeyCoinRPCService) GetABI(ctx context.Context, in *types.SingleBytes) (*types.ABI, error)
func (*MeyCoinRPCService) GetAccountVotes ¶
func (rpc *MeyCoinRPCService) GetAccountVotes(ctx context.Context, in *types.AccountAddress) (*types.AccountVoteInfo, error)
func (*MeyCoinRPCService) GetAccounts ¶
func (rpc *MeyCoinRPCService) GetAccounts(ctx context.Context, in *types.Empty) (*types.AccountList, error)
GetAccounts handle rpc request getaccounts
func (*MeyCoinRPCService) GetBlock ¶
func (rpc *MeyCoinRPCService) GetBlock(ctx context.Context, in *types.SingleBytes) (*types.Block, error)
GetBlock handle rpc request getblock
func (*MeyCoinRPCService) GetBlockBody ¶
func (rpc *MeyCoinRPCService) GetBlockBody(ctx context.Context, in *types.BlockBodyParams) (*types.BlockBodyPaged, error)
GetBlockBody handle rpc request getblockbody
func (*MeyCoinRPCService) GetBlockMetadata ¶
func (rpc *MeyCoinRPCService) GetBlockMetadata(ctx context.Context, in *types.SingleBytes) (*types.BlockMetadata, error)
GetBlockMetadata handle rpc request getblock
func (*MeyCoinRPCService) GetBlockTX ¶
func (rpc *MeyCoinRPCService) GetBlockTX(ctx context.Context, in *types.SingleBytes) (*types.TxInBlock, error)
GetBlockTX handle rpc request gettx
func (*MeyCoinRPCService) GetChainInfo ¶
func (rpc *MeyCoinRPCService) GetChainInfo(ctx context.Context, in *types.Empty) (*types.ChainInfo, error)
GetChainInfo handles a getchaininfo RPC request.
func (*MeyCoinRPCService) GetConfChangeProgress ¶
func (rpc *MeyCoinRPCService) GetConfChangeProgress(ctx context.Context, in *types.SingleBytes) (*types.ConfChangeProgress, error)
func (*MeyCoinRPCService) GetConsensusInfo ¶
func (rpc *MeyCoinRPCService) GetConsensusInfo(ctx context.Context, in *types.Empty) (*types.ConsensusInfo, error)
GetConsensusInfo handle rpc request blockchain. It has no additional input parameter
func (*MeyCoinRPCService) GetEnterpriseConfig ¶
func (rpc *MeyCoinRPCService) GetEnterpriseConfig(ctx context.Context, in *types.EnterpriseConfigKey) (*types.EnterpriseConfig, error)
GetEnterpriseConfig return meycoin.enterprise configure values. key "ADMINS" is for getting register admin addresses and "ALL" is for getting all key list.
func (*MeyCoinRPCService) GetNameInfo ¶
func (*MeyCoinRPCService) GetPeers ¶
func (rpc *MeyCoinRPCService) GetPeers(ctx context.Context, in *types.PeersParams) (*types.PeerList, error)
GetPeers handle rpc request getpeers
func (*MeyCoinRPCService) GetReceipt ¶
func (rpc *MeyCoinRPCService) GetReceipt(ctx context.Context, in *types.SingleBytes) (*types.Receipt, error)
func (*MeyCoinRPCService) GetServerInfo ¶
func (rpc *MeyCoinRPCService) GetServerInfo(ctx context.Context, in *types.KeyParams) (*types.ServerInfo, error)
func (*MeyCoinRPCService) GetStaking ¶
func (rpc *MeyCoinRPCService) GetStaking(ctx context.Context, in *types.AccountAddress) (*types.Staking, error)
GetStaking handle rpc request getstaking
func (*MeyCoinRPCService) GetState ¶
func (rpc *MeyCoinRPCService) GetState(ctx context.Context, in *types.SingleBytes) (*types.State, error)
GetState handle rpc request getstate
func (*MeyCoinRPCService) GetStateAndProof ¶
func (rpc *MeyCoinRPCService) GetStateAndProof(ctx context.Context, in *types.AccountAndRoot) (*types.AccountProof, error)
GetStateAndProof handle rpc request getstateproof
func (*MeyCoinRPCService) GetTX ¶
func (rpc *MeyCoinRPCService) GetTX(ctx context.Context, in *types.SingleBytes) (*types.Tx, error)
GetTX handle rpc request gettx
func (*MeyCoinRPCService) GetVotes ¶
func (rpc *MeyCoinRPCService) GetVotes(ctx context.Context, in *types.VoteParams) (*types.VoteList, error)
GetVotes handle rpc request getvotes
func (*MeyCoinRPCService) ImportAccount ¶
func (rpc *MeyCoinRPCService) ImportAccount(ctx context.Context, in *types.ImportFormat) (*types.Account, error)
func (*MeyCoinRPCService) ListBlockHeaders ¶
func (rpc *MeyCoinRPCService) ListBlockHeaders(ctx context.Context, in *types.ListParams) (*types.BlockHeaderList, error)
ListBlockHeaders (Deprecated) handle rpc request listblocks
func (*MeyCoinRPCService) ListBlockMetadata ¶
func (rpc *MeyCoinRPCService) ListBlockMetadata(ctx context.Context, in *types.ListParams) (*types.BlockMetadataList, error)
ListBlockMetadata handle rpc request
func (*MeyCoinRPCService) ListBlockMetadataStream ¶
func (rpc *MeyCoinRPCService) ListBlockMetadataStream(in *types.Empty, stream types.MeyCoinRPCService_ListBlockMetadataStreamServer) error
ListBlockMetadataStream starts a stream of new blocks' metadata
func (*MeyCoinRPCService) ListBlockStream ¶
func (rpc *MeyCoinRPCService) ListBlockStream(in *types.Empty, stream types.MeyCoinRPCService_ListBlockStreamServer) error
ListBlockStream starts a stream of new blocks
func (*MeyCoinRPCService) ListEventStream ¶
func (rpc *MeyCoinRPCService) ListEventStream(in *types.FilterInfo, stream types.MeyCoinRPCService_ListEventStreamServer) error
func (*MeyCoinRPCService) ListEvents ¶
func (rpc *MeyCoinRPCService) ListEvents(ctx context.Context, in *types.FilterInfo) (*types.EventList, error)
func (*MeyCoinRPCService) LockAccount ¶
func (rpc *MeyCoinRPCService) LockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
LockAccount handle rpc request lockaccount
func (*MeyCoinRPCService) Metric ¶
func (rpc *MeyCoinRPCService) Metric(ctx context.Context, req *types.MetricsRequest) (*types.Metrics, error)
func (*MeyCoinRPCService) NodeState ¶
func (rpc *MeyCoinRPCService) NodeState(ctx context.Context, in *types.NodeReq) (*types.SingleBytes, error)
NodeState handle rpc request nodestate
func (*MeyCoinRPCService) QueryContract ¶
func (rpc *MeyCoinRPCService) QueryContract(ctx context.Context, in *types.Query) (*types.SingleBytes, error)
func (*MeyCoinRPCService) QueryContractState ¶
func (rpc *MeyCoinRPCService) 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 (*MeyCoinRPCService) SendTX ¶
func (rpc *MeyCoinRPCService) 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 (*MeyCoinRPCService) SetConsensusAccessor ¶
func (rpc *MeyCoinRPCService) SetConsensusAccessor(ca consensus.ConsensusAccessor)
func (*MeyCoinRPCService) UnlockAccount ¶
func (rpc *MeyCoinRPCService) UnlockAccount(ctx context.Context, in *types.Personal) (*types.Account, error)
UnlockAccount handle rpc request unlockaccount
func (*MeyCoinRPCService) VerifyTX ¶
func (rpc *MeyCoinRPCService) VerifyTX(ctx context.Context, in *types.Tx) (*types.VerifyResult, error)
VerifyTX handle rpc request verifytx
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