Documentation ¶
Index ¶
- Constants
- func RegisterMasterServerSideOpServer(s *grpc.Server, srv MasterServerSideOpServer)
- func RegisterSlaveServerSideOpServer(s *grpc.Server, srv SlaveServerSideOpServer)
- func StartGRPCServer(hostport string, apis []rpc.API) (net.Listener, *grpc.Server, error)
- type AccountBranchData
- type AddBlockListForSyncRequest
- type AddBlockListForSyncResponse
- type AddMinorBlockHeaderRequest
- type AddMinorBlockHeaderResponse
- type AddMinorBlockRequest
- type AddRootBlockRequest
- type AddRootBlockResponse
- type AddTransactionRequest
- type AddXshardTxListRequest
- type ArtificialTxConfig
- type BatchAddXshardTxListRequest
- type BroadcastMinorBlock
- type BroadcastNewTip
- type BroadcastTransactions
- type Client
- type ConnectToSlavesRequest
- type ConnectToSlavesResponse
- type ConnectToSlavesResult
- type CrossShardTransactionList
- type EcoInfo
- type EstimateGasRequest
- type EstimateGasResponse
- type ExecuteTransactionRequest
- type ExecuteTransactionResponse
- type GasPriceRequest
- type GasPriceResponse
- type GenTxRequest
- type GetAccountDataRequest
- type GetAccountDataResponse
- type GetCodeRequest
- type GetCodeResponse
- type GetEcoInfoListResponse
- type GetLogRequest
- type GetLogResponse
- type GetMinorBlockHeaderListRequest
- type GetMinorBlockHeaderListResponse
- type GetMinorBlockListRequest
- type GetMinorBlockListResponse
- type GetMinorBlockRequest
- type GetMinorBlockResponse
- type GetNextBlockToMineRequest
- type GetNextBlockToMineResponse
- type GetStorageRequest
- type GetStorageResponse
- type GetTransactionListByAddressRequest
- type GetTransactionListByAddressResponse
- type GetTransactionReceiptRequest
- type GetTransactionReceiptResponse
- type GetTransactionRequest
- type GetTransactionResponse
- type GetUnconfirmedHeadersResponse
- type GetWorkRequest
- type GetWorkResponse
- type HandleNewTipRequest
- type HashList
- type HeadersInfo
- type ISlaveConn
- type MasterInfo
- type MasterServerSideOpClient
- type MasterServerSideOpServer
- type MineRequest
- type NetworkError
- type PeerInfoForDisPlay
- type Ping
- type Pong
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetData() []byte
- func (m *Request) GetOp() uint32
- func (m *Request) GetRpcId() int64
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetData() []byte
- func (m *Response) GetRpcId() int64
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type ShardConnForP2P
- type ShardStatus
- type SlaveInfo
- type SlaveServerSideOpClient
- type SlaveServerSideOpServer
- type SubmitWorkRequest
- type SubmitWorkResponse
- type TransactionDetail
- type UnimplementedMasterServerSideOpServer
- func (*UnimplementedMasterServerSideOpServer) AddMinorBlockHeader(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedMasterServerSideOpServer) BroadcastNewMinorBlock(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedMasterServerSideOpServer) BroadcastNewTip(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedMasterServerSideOpServer) BroadcastTransactions(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedMasterServerSideOpServer) GetMinorBlockHeaderList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedMasterServerSideOpServer) GetMinorBlockList(ctx context.Context, req *Request) (*Response, error)
- type UnimplementedSlaveServerSideOpServer
- func (*UnimplementedSlaveServerSideOpServer) AddMinorBlockListForSync(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) AddRootBlock(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) AddTransaction(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) AddTransactions(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) AddXshardTxList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) BatchAddXshardTxList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) EstimateGas(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) ExecuteTransaction(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GasPrice(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GenTx(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetAccountData(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetCode(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetLogs(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetMinorBlock(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetMinorBlockHeaderList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetMinorBlockList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetStorageAt(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetTransaction(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetTransactionListByAddress(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetTransactionReceipt(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetUnconfirmedHeaderList(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) GetWork(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) HandleNewMinorBlock(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) HandleNewTip(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) HeartBeat(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) MasterInfo(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) Ping(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) SetMining(ctx context.Context, req *Request) (*Response, error)
- func (*UnimplementedSlaveServerSideOpServer) SubmitWork(ctx context.Context, req *Request) (*Response, error)
Constants ¶
const ( OpHeartBeat = iota OpMasterInfo OpPing OpConnectToSlaves OpAddRootBlock OpGetNextBlockToMine OpGetUnconfirmedHeaderList OpGetAccountData OpAddTransaction OpAddMinorBlockHeader OpAddXshardTxList OpCreateClusterPeerConnection OpGetMinorBlock OpGetTransaction OpBatchAddXshardTxList OpExecuteTransaction OpGetTransactionReceipt OpGetMine OpGenTx OpGetTransactionListByAddress OpGetLogs OpEstimateGas OpGetStorageAt OpGetCode OpGasPrice OpGetWork OpSubmitWork OpAddMinorBlockListForSync // p2p api OpBroadcastNewTip OpBroadcastTransactions OpBroadcastNewMinorBlock OpGetMinorBlockList OpGetMinorBlockHeaderList OpHandleNewTip OpAddTransactions OpHandleNewMinorBlock OpSetMining MasterServer = serverType(1) SlaveServer = serverType(0) )
Variables ¶
This section is empty.
Functions ¶
func RegisterMasterServerSideOpServer ¶
func RegisterMasterServerSideOpServer(s *grpc.Server, srv MasterServerSideOpServer)
func RegisterSlaveServerSideOpServer ¶
func RegisterSlaveServerSideOpServer(s *grpc.Server, srv SlaveServerSideOpServer)
Types ¶
type AccountBranchData ¶
type AddBlockListForSyncResponse ¶
type AddBlockListForSyncResponse struct {
ShardStatus *ShardStatus `json:"shard_status" gencodec:"required"`
}
type AddMinorBlockHeaderRequest ¶
type AddMinorBlockHeaderRequest struct { MinorBlockHeader *types.MinorBlockHeader `json:"minor_block_header" gencodec:"required"` TxCount uint32 `json:"tx_count" gencodec:"required"` XShardTxCount uint32 `json:"x_shard_tx_count" gencodec:"required"` ShardStats *ShardStatus `json:"shard_stats" gencodec:"required"` }
slave -> master
Notify master about a successfully added minro block. Piggyback the ShardStatus in the same request.
type AddMinorBlockHeaderResponse ¶
type AddMinorBlockHeaderResponse struct {
ArtificialTxConfig *ArtificialTxConfig `json:"artificial_tx_config" gencodec:"required"`
}
type AddMinorBlockRequest ¶
type AddMinorBlockRequest struct {
MinorBlockData []byte `json:"minor_block_data" gencodec:"required" bytesizeofslicelen:"4"`
}
For adding blocks mined through JRPC
type AddRootBlockRequest ¶
type AddRootBlockRequest struct { RootBlock *types.RootBlock `json:"root_block" gencodec:"required"` ExpectSwitch bool `json:"expect_switch" gencodec:"required"` }
Add root block to each slave
type AddRootBlockResponse ¶
type AddRootBlockResponse struct {
Switched bool `json:"switched" gencodec:"required"`
}
type AddTransactionRequest ¶
type AddTransactionRequest struct {
Tx *types.Transaction `json:"tx" gencodec:"required"`
}
type AddXshardTxListRequest ¶
type AddXshardTxListRequest struct { Branch uint32 `json:"branch" gencodec:"required"` MinorBlockHash common.Hash `json:"minor_block_hash" gencodec:"required"` TxList []*types.CrossShardTransactionDeposit `json:"tx_list" gencodec:"required" bytesizeofslicelen:"4"` }
type ArtificialTxConfig ¶
type BatchAddXshardTxListRequest ¶
type BatchAddXshardTxListRequest struct {
AddXshardTxListRequestList []*AddXshardTxListRequest `json:"add_xshard_tx_list_request_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type BroadcastMinorBlock ¶
type BroadcastMinorBlock struct { Branch uint32 `json:"branch" gencodec:"required"` MinorBlock *types.MinorBlock `json:"minor_block" gencodec:"required"` }
type BroadcastNewTip ¶
type BroadcastNewTip struct { Branch uint32 `json:"branch" gencodec:"required"` RootBlockHeader *types.RootBlockHeader `json:"root_block_header" gencodec:"required"` MinorBlockHeaderList []*types.MinorBlockHeader `json:"minor_block_header_list" gencodec:"required" bytesizeofslicelen:"4"` }
type BroadcastTransactions ¶
type BroadcastTransactions struct { Branch uint32 `json:"branch" gencodec:"required"` Txs []*types.Transaction `json:"txs" gencodec:"required" bytesizeofslicelen:"4"` }
type Client ¶
type Client interface { Call(hostport string, req *Request) (*Response, error) GetOpName(uint32) string }
Client wraps the GRPC client.
type ConnectToSlavesRequest ¶
type ConnectToSlavesRequest struct {
SlaveInfoList []*SlaveInfo `json:"slave_info_list" gencodec:"required" bytesizeofslicelen:"4"`
}
Master instructs a slave to connect to other slaves
type ConnectToSlavesResponse ¶
type ConnectToSlavesResponse struct {
ResultList []*ConnectToSlavesResult `json:"result_list" gencodec:"required" bytesizeofslicelen:"4"`
}
result_list must have the same size as salve_info_list in the request. Empty result means success otherwise it would a serialized error message.
type ConnectToSlavesResult ¶
type ConnectToSlavesResult struct {
Result []byte `json:"result" gencodec:"required" bytesizeofslicelen:"4"`
}
type CrossShardTransactionList ¶
type CrossShardTransactionList struct {
TxList []*types.CrossShardTransactionDeposit `json:"tx_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type EcoInfo ¶
type EcoInfo struct { Branch account.Branch `json:"branch" gencodec:"required"` Height uint64 `json:"height" gencodec:"required"` CoinbaseAmount common.Hash `json:"coinbase_amount" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` UnconfirmedHeadersCoinbaseAmount common.Hash `json:"unconfirmed_headers_coinbase_amount" gencodec:"required"` }
Necessary information for master to decide the best block to mine
type EstimateGasRequest ¶
type EstimateGasRequest struct { Tx *types.Transaction `json:"tx" gencodec:"required"` FromAddress *account.Address `json:"from_address" gencodec:"required"` }
type EstimateGasResponse ¶
type EstimateGasResponse struct {
Result uint32 `json:"result" gencodec:"required"`
}
type ExecuteTransactionRequest ¶
type ExecuteTransactionRequest struct { Tx *types.Transaction `json:"tx" gencodec:"required"` FromAddress *account.Address `json:"from_address" gencodec:"required"` BlockHeight *uint64 `json:"block_height" ser:"nil"` }
type ExecuteTransactionResponse ¶
type ExecuteTransactionResponse struct {
Result []byte `json:"result" gencodec:"required" bytesizeofslicelen:"4"`
}
type GasPriceRequest ¶
type GasPriceRequest struct {
Branch uint32 `json:"branch" gencodec:"required"`
}
type GasPriceResponse ¶
type GasPriceResponse struct {
Result uint64 `json:"result" gencodec:"required"`
}
type GenTxRequest ¶
type GenTxRequest struct { NumTxPerShard uint32 `json:"num_tx_per_shard" gencodec:"required"` XShardPercent uint32 `json:"x_shard_percent" gencodec:"required"` Tx *types.Transaction `json:"tx" gencodec:"required"` }
Generate transactions for loadtesting
type GetAccountDataRequest ¶
type GetAccountDataResponse ¶
type GetAccountDataResponse struct {
AccountBranchDataList []*AccountBranchData `json:"account_branch_data_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetCodeRequest ¶
type GetCodeResponse ¶
type GetCodeResponse struct {
Result []byte `json:"result" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetEcoInfoListResponse ¶
type GetEcoInfoListResponse struct {
EcoInfoList []*EcoInfo `json:"eco_info_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetLogRequest ¶
type GetLogRequest struct { Branch uint32 `json:"branch" gencodec:"required"` Addresses []account.Address `json:"addresses" gencodec:"required" bytesizeofslicelen:"4"` Topics [][]common.Hash `json:"topics" gencodec:"required" bytesizeofslicelen:"4"` StartBlock uint64 `json:"start_block" gencodec:"required"` EndBlock uint64 `json:"end_block" gencodec:"required"` }
type GetLogResponse ¶
type GetMinorBlockHeaderListRequest ¶
type GetMinorBlockHeaderListRequest struct { Branch uint32 `json:"branch" gencodec:"required"` BlockHash common.Hash `json:"block_hash" gencodec:"required"` Limit uint32 `json:"limit" gencodec:"required"` // value 0: heighter, 1 lower Direction uint8 `json:"direction" gencodec:"required"` PeerID string `json:"peerid" gencodec:"required"` }
type GetMinorBlockHeaderListResponse ¶
type GetMinorBlockHeaderListResponse struct {
MinorBlockHeaderList []*types.MinorBlockHeader `json:"minor_block_header" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetMinorBlockListResponse ¶
type GetMinorBlockListResponse struct {
MinorBlockList []*types.MinorBlock `json:"minor_block_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetMinorBlockRequest ¶
type GetMinorBlockRequest struct { Branch uint32 `json:"branch" gencodec:"required"` MinorBlockHash common.Hash `json:"minor_block_hash" gencodec:"required"` Height uint64 `json:"height" gencodec:"required"` }
RPCs to lookup data from shards (master -> slaves)
type GetMinorBlockResponse ¶
type GetMinorBlockResponse struct {
MinorBlock *types.MinorBlock `json:"minor_block" gencodec:"required"`
}
type GetNextBlockToMineRequest ¶
type GetNextBlockToMineRequest struct { Branch account.Branch `json:"branch" gencodec:"required"` Address account.Address `json:"address" gencodec:"required"` ArtificialTxConfig *ArtificialTxConfig `json:"artificial_tx_config" gencodec:"required"` }
type GetNextBlockToMineResponse ¶
type GetNextBlockToMineResponse struct {
Block *types.MinorBlock `json:"block" gencodec:"required"`
}
type GetStorageRequest ¶
type GetStorageResponse ¶
type GetTransactionListByAddressResponse ¶
type GetTransactionListByAddressResponse struct { TxList []*TransactionDetail `json:"tx_list" gencodec:"required" bytesizeofslicelen:"4"` Next []byte `json:"next" gencodec:"required" bytesizeofslicelen:"4"` }
type GetTransactionReceiptResponse ¶
type GetTransactionReceiptResponse struct { MinorBlock *types.MinorBlock `json:"minor_block" gencodec:"required"` Index uint32 `json:"index" gencodec:"required"` Receipt *types.Receipt `json:"receipt" gencodec:"required" bytesizeofslicelen:"4"` }
type GetTransactionRequest ¶
type GetTransactionResponse ¶
type GetTransactionResponse struct { MinorBlock *types.MinorBlock `json:"minor_block" gencodec:"required"` Index uint32 `json:"index" gencodec:"required"` }
type GetUnconfirmedHeadersResponse ¶
type GetUnconfirmedHeadersResponse struct {
HeadersInfoList []*HeadersInfo `json:"headers_info_list" gencodec:"required" bytesizeofslicelen:"4"`
}
type GetWorkRequest ¶
type GetWorkRequest struct {
Branch uint32 `json:"branch" gencodec:"required"`
}
type GetWorkResponse ¶
type HandleNewTipRequest ¶
type HandleNewTipRequest struct { PeerID string `json:"peer_id" gencodec:"required"` RootBlockHeader *types.RootBlockHeader `json:"root_block_header" gencodec:"required"` MinorBlockHeaderList []*types.MinorBlockHeader `json:"minor_block_header_list" gencodec:"required" bytesizeofslicelen:"4"` }
type HeadersInfo ¶
type HeadersInfo struct { Branch uint32 `json:"branch" gencodec:"required"` HeaderList []*types.MinorBlockHeader `json:"header_list" gencodec:"required" bytesizeofslicelen:"4"` }
type ISlaveConn ¶
type ISlaveConn interface { ShardConnForP2P GetSlaveID() string GetShardMaskList() []*types.ChainMask MasterInfo(ip string, port uint16, rootTip *types.RootBlock) error HasShard(fullShardID uint32) bool SendPing() ([]byte, []*types.ChainMask, error) HeartBeat() bool GetUnconfirmedHeaders() (*GetUnconfirmedHeadersResponse, error) GetAccountData(address *account.Address, height *uint64) (*GetAccountDataResponse, error) AddRootBlock(rootBlock *types.RootBlock, expectSwitch bool) error GenTx(numTxPerShard, xShardPercent uint32, tx *types.Transaction) error SendMiningConfigToSlaves(artificialTxConfig *ArtificialTxConfig, mining bool) error AddTransaction(tx *types.Transaction) error ExecuteTransaction(tx *types.Transaction, fromAddress *account.Address, height *uint64) ([]byte, error) GetMinorBlockByHash(blockHash common.Hash, branch account.Branch) (*types.MinorBlock, error) GetMinorBlockByHeight(height uint64, branch account.Branch) (*types.MinorBlock, error) GetTransactionByHash(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, error) GetTransactionReceipt(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, *types.Receipt, error) GetTransactionsByAddress(address *account.Address, start []byte, limit uint32) ([]*TransactionDetail, []byte, error) GetLogs(branch account.Branch, address []account.Address, topics [][]common.Hash, startBlock, endBlock uint64) ([]*types.Log, error) EstimateGas(tx *types.Transaction, fromAddress *account.Address) (uint32, error) GetStorageAt(address *account.Address, key common.Hash, height *uint64) (common.Hash, error) GetCode(address *account.Address, height *uint64) ([]byte, error) GasPrice(branch account.Branch) (uint64, error) GetWork(branch account.Branch) (*consensus.MiningWork, error) SubmitWork(work *SubmitWorkRequest) (success bool, err error) SetMining(mining bool) error }
type MasterInfo ¶
type MasterServerSideOpClient ¶
type MasterServerSideOpClient interface { AddMinorBlockHeader(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // p2p apis BroadcastNewTip(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) BroadcastTransactions(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) BroadcastNewMinorBlock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetMinorBlockList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetMinorBlockHeaderList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
MasterServerSideOpClient is the client API for MasterServerSideOp service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMasterServerSideOpClient ¶
func NewMasterServerSideOpClient(cc *grpc.ClientConn) MasterServerSideOpClient
type MasterServerSideOpServer ¶
type MasterServerSideOpServer interface { AddMinorBlockHeader(context.Context, *Request) (*Response, error) // p2p apis BroadcastNewTip(context.Context, *Request) (*Response, error) BroadcastTransactions(context.Context, *Request) (*Response, error) BroadcastNewMinorBlock(context.Context, *Request) (*Response, error) GetMinorBlockList(context.Context, *Request) (*Response, error) GetMinorBlockHeaderList(context.Context, *Request) (*Response, error) }
MasterServerSideOpServer is the server API for MasterServerSideOp service.
type MineRequest ¶
type MineRequest struct { ArtificialTxConfig *ArtificialTxConfig `json:"artificial_tx_config" gencodec:"required"` Mining bool `json:"mining" gencodec:"required"` }
Send mining instructions to slaves
type NetworkError ¶
type NetworkError struct {
Msg string
}
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
type PeerInfoForDisPlay ¶
type Request ¶
type Request struct { Op uint32 `protobuf:"varint,1,opt,name=op,proto3" json:"op,omitempty"` RpcId int64 `protobuf:"varint,2,opt,name=rpc_id,json=rpcId,proto3" json:"rpc_id,omitempty"` Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
request data
func (*Request) Descriptor ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
type Response ¶
type Response struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` RpcId int64 `protobuf:"varint,2,opt,name=rpc_id,json=rpcId,proto3" json:"rpc_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
response data
func (*Response) Descriptor ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
type ShardConnForP2P ¶
type ShardConnForP2P interface { // AddTransactions will add the tx to shard tx pool, and return the tx hash // which have been added to tx pool. so tx which cannot pass verification // or existed in tx pool will not be included in return hash list AddTransactions(request *p2p.NewTransactionList) (*HashList, error) GetMinorBlocks(request *GetMinorBlockListRequest) (*p2p.GetMinorBlockListResponse, error) GetMinorBlockHeaders(request *p2p.GetMinorBlockHeaderListRequest) (*p2p.GetMinorBlockHeaderListResponse, error) HandleNewTip(request *HandleNewTipRequest) (bool, error) HandleNewMinorBlock(request *p2p.NewBlockMinor) (bool, error) AddBlockListForSync(request *AddBlockListForSyncRequest) (*ShardStatus, error) }
type ShardStatus ¶
type ShardStatus struct { Branch account.Branch Height uint64 Difficulty *big.Int CoinbaseAddress account.Address Timestamp uint64 TxCount60s uint32 PendingTxCount uint32 TotalTxCount uint32 BlockCount60s uint32 StaleBlockCount60s uint32 LastBlockTime uint64 }
ShardStatus shard status for api
type SlaveServerSideOpClient ¶
type SlaveServerSideOpClient interface { HeartBeat(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) MasterInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // APIs for master Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GenTx(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) AddRootBlock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetUnconfirmedHeaderList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetAccountData(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) AddTransaction(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetMinorBlock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetTransaction(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) ExecuteTransaction(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetTransactionReceipt(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetTransactionListByAddress(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetLogs(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) EstimateGas(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetStorageAt(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetCode(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GasPrice(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetWork(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) SubmitWork(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // APIs for neighbor slaves AddXshardTxList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) BatchAddXshardTxList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) AddMinorBlockListForSync(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // p2p apis GetMinorBlockList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) GetMinorBlockHeaderList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) HandleNewTip(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) AddTransactions(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) HandleNewMinorBlock(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) SetMining(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
SlaveServerSideOpClient is the client API for SlaveServerSideOp service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSlaveServerSideOpClient ¶
func NewSlaveServerSideOpClient(cc *grpc.ClientConn) SlaveServerSideOpClient
type SlaveServerSideOpServer ¶
type SlaveServerSideOpServer interface { HeartBeat(context.Context, *Request) (*Response, error) MasterInfo(context.Context, *Request) (*Response, error) // APIs for master Ping(context.Context, *Request) (*Response, error) GenTx(context.Context, *Request) (*Response, error) AddRootBlock(context.Context, *Request) (*Response, error) GetUnconfirmedHeaderList(context.Context, *Request) (*Response, error) GetAccountData(context.Context, *Request) (*Response, error) AddTransaction(context.Context, *Request) (*Response, error) GetMinorBlock(context.Context, *Request) (*Response, error) GetTransaction(context.Context, *Request) (*Response, error) ExecuteTransaction(context.Context, *Request) (*Response, error) GetTransactionReceipt(context.Context, *Request) (*Response, error) GetTransactionListByAddress(context.Context, *Request) (*Response, error) GetLogs(context.Context, *Request) (*Response, error) EstimateGas(context.Context, *Request) (*Response, error) GetStorageAt(context.Context, *Request) (*Response, error) GetCode(context.Context, *Request) (*Response, error) GasPrice(context.Context, *Request) (*Response, error) GetWork(context.Context, *Request) (*Response, error) SubmitWork(context.Context, *Request) (*Response, error) // APIs for neighbor slaves AddXshardTxList(context.Context, *Request) (*Response, error) BatchAddXshardTxList(context.Context, *Request) (*Response, error) AddMinorBlockListForSync(context.Context, *Request) (*Response, error) // p2p apis GetMinorBlockList(context.Context, *Request) (*Response, error) GetMinorBlockHeaderList(context.Context, *Request) (*Response, error) HandleNewTip(context.Context, *Request) (*Response, error) AddTransactions(context.Context, *Request) (*Response, error) HandleNewMinorBlock(context.Context, *Request) (*Response, error) SetMining(context.Context, *Request) (*Response, error) }
SlaveServerSideOpServer is the server API for SlaveServerSideOp service.
type SubmitWorkRequest ¶
type SubmitWorkResponse ¶
type SubmitWorkResponse struct {
Success bool `json:"success" gencodec:"required"`
}
type TransactionDetail ¶
type TransactionDetail struct { TxHash common.Hash `json:"tx_hash" gencodec:"required"` FromAddress account.Address `json:"from_address" gencodec:"required"` ToAddress *account.Address `json:"to_address" ser:"nil"` Value serialize.Uint256 `json:"value" gencodec:"required"` BlockHeight uint64 `json:"block_height" gencodec:"required"` Timestamp uint64 `json:"timestamp" gencodec:"required"` Success bool `json:"success" gencodec:"required"` }
type UnimplementedMasterServerSideOpServer ¶
type UnimplementedMasterServerSideOpServer struct { }
UnimplementedMasterServerSideOpServer can be embedded to have forward compatible implementations.
func (*UnimplementedMasterServerSideOpServer) AddMinorBlockHeader ¶
func (*UnimplementedMasterServerSideOpServer) BroadcastNewMinorBlock ¶
func (*UnimplementedMasterServerSideOpServer) BroadcastNewTip ¶
func (*UnimplementedMasterServerSideOpServer) BroadcastTransactions ¶
func (*UnimplementedMasterServerSideOpServer) GetMinorBlockHeaderList ¶
func (*UnimplementedMasterServerSideOpServer) GetMinorBlockList ¶
type UnimplementedSlaveServerSideOpServer ¶
type UnimplementedSlaveServerSideOpServer struct { }
UnimplementedSlaveServerSideOpServer can be embedded to have forward compatible implementations.