Documentation
¶
Index ¶
- Constants
- Variables
- type MasterServerSideOp
- func (m *MasterServerSideOp) AddMinorBlockHeader(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- func (m *MasterServerSideOp) BroadcastNewMinorBlock(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- func (m *MasterServerSideOp) BroadcastNewTip(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- func (m *MasterServerSideOp) BroadcastTransactions(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- func (m *MasterServerSideOp) GetMinorBlockHeaderList(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- func (m *MasterServerSideOp) GetMinorBlockList(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
- type PrivateP2PAPI
- func (api *PrivateP2PAPI) BroadcastMinorBlock(branch uint32, block *types.MinorBlock) error
- func (api *PrivateP2PAPI) BroadcastNewTip(branch uint32, rootBlockHeader *types.RootBlockHeader, ...) error
- func (api *PrivateP2PAPI) BroadcastTransactions(branch uint32, txs []*types.Transaction)
- func (api *PrivateP2PAPI) GetMinorBlockHeaders(hash common.Hash, amount uint32, branch uint32, reverse bool, peerId string) ([]*types.MinorBlockHeader, error)
- func (api *PrivateP2PAPI) GetMinorBlockList(hashList []common.Hash, branch uint32, peerId string) ([]*types.MinorBlock, error)
- type ProtocolManager
- func (pm *ProtocolManager) BroadcastTip(header *types.RootBlockHeader)
- func (pm *ProtocolManager) BroadcastTransactions(branch uint32, txs []*types.Transaction, sourcePeerId string)
- func (pm *ProtocolManager) HandleGetMinorBlockHeaderListRequest(rpcId uint64, branch uint32, request *p2p.GetMinorBlockHeaderListRequest) (*p2p.GetMinorBlockHeaderListResponse, error)
- func (pm *ProtocolManager) HandleGetMinorBlockListRequest(peerId string, rpcId uint64, branch uint32, ...) (*p2p.GetMinorBlockListResponse, error)
- func (pm *ProtocolManager) HandleGetRootBlockHeaderListRequest(blockHeaderReq *p2p.GetRootBlockHeaderListRequest) (*p2p.GetRootBlockHeaderListResponse, error)
- func (pm *ProtocolManager) HandleGetRootBlockListRequest(request *p2p.GetRootBlockListRequest) (*p2p.GetRootBlockListResponse, error)
- func (pm *ProtocolManager) HandleNewMinorTip(branch uint32, tip *p2p.Tip, peer *peer) error
- func (pm *ProtocolManager) HandleNewRootTip(tip *p2p.Tip, peer *peer) error
- func (pm *ProtocolManager) HandleNewTransactionListRequest(peerId string, rpcId uint64, branch uint32, request *p2p.NewTransactionList) error
- func (pm *ProtocolManager) Start(maxPeers int)
- func (pm *ProtocolManager) Stop()
- type QKCMasterBackend
- func (s *QKCMasterBackend) APIs() []ethRPC.API
- func (s *QKCMasterBackend) AddRootBlock(rootBlock *types.RootBlock) error
- func (s *QKCMasterBackend) AddTransaction(tx *types.Transaction) error
- func (s *QKCMasterBackend) ConnectToSlaves() error
- func (s *QKCMasterBackend) CreateBlockToMine() (types.IBlock, error)
- func (s *QKCMasterBackend) CreateTransactions(numTxPerShard, xShardPercent uint32, tx *types.Transaction) error
- func (s *QKCMasterBackend) CurrentBlock() *types.RootBlock
- func (s *QKCMasterBackend) EstimateGas(tx *types.Transaction, fromAddress *account.Address) (uint32, error)
- func (s *QKCMasterBackend) ExecuteTransaction(tx *types.Transaction, address *account.Address, height *uint64) ([]byte, error)
- func (s *QKCMasterBackend) GasPrice(branch account.Branch) (uint64, error)
- func (s *QKCMasterBackend) GetAccountData(address *account.Address, height *uint64) (map[uint32]*rpc.AccountBranchData, error)
- func (s *QKCMasterBackend) GetBlockCount() (map[uint32]map[account.Recipient]uint32, error)
- func (s *QKCMasterBackend) GetClusterConfig() *config.ClusterConfig
- func (s *QKCMasterBackend) GetCode(address *account.Address, height *uint64) ([]byte, error)
- func (s *QKCMasterBackend) GetLastMinorBlockByFullShardID(fullShardId uint32) (uint64, error)
- func (s *QKCMasterBackend) GetLogs(branch account.Branch, address []account.Address, topics [][]common.Hash, ...) ([]*types.Log, error)
- func (s *QKCMasterBackend) GetMinorBlockByHash(blockHash common.Hash, branch account.Branch) (*types.MinorBlock, error)
- func (s *QKCMasterBackend) GetMinorBlockByHeight(height *uint64, branch account.Branch) (*types.MinorBlock, error)
- func (s *QKCMasterBackend) GetPeers() []rpc.PeerInfoForDisPlay
- func (s *QKCMasterBackend) GetPrimaryAccountData(address *account.Address, blockHeight *uint64) (*rpc.AccountBranchData, error)
- func (s *QKCMasterBackend) GetRootBlockByHash(hash common.Hash) (*types.RootBlock, error)
- func (s *QKCMasterBackend) GetRootBlockByNumber(blockNumber *uint64) (*types.RootBlock, error)
- func (s *QKCMasterBackend) GetSlavePoolLen() int
- func (s *QKCMasterBackend) GetStats() (map[string]interface{}, error)
- func (s *QKCMasterBackend) GetStorageAt(address *account.Address, key common.Hash, height *uint64) (common.Hash, error)
- func (s *QKCMasterBackend) GetTip() uint64
- func (s *QKCMasterBackend) GetTransactionByHash(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, error)
- func (s *QKCMasterBackend) GetTransactionReceipt(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, *types.Receipt, error)
- func (s *QKCMasterBackend) GetTransactionsByAddress(address *account.Address, start []byte, limit uint32) ([]*rpc.TransactionDetail, []byte, error)
- func (s *QKCMasterBackend) GetWork(branch account.Branch) (*consensus.MiningWork, error)
- func (s *QKCMasterBackend) Heartbeat()
- func (s *QKCMasterBackend) Init(srvr *p2p.Server) error
- func (s *QKCMasterBackend) InsertMinedBlock(block types.IBlock) error
- func (s *QKCMasterBackend) IsMining() bool
- func (s *QKCMasterBackend) IsSyncing() bool
- func (s *QKCMasterBackend) NetWorkInfo() map[string]interface{}
- func (s *QKCMasterBackend) Protocols() []p2p.Protocol
- func (s *QKCMasterBackend) SendMiningConfigToSlaves(mining bool) error
- func (s *QKCMasterBackend) SetMining(mining bool)
- func (s *QKCMasterBackend) SetTargetBlockTime(rootBlockTime *uint32, minorBlockTime *uint32) error
- func (s *QKCMasterBackend) Start() error
- func (s *QKCMasterBackend) Stop() error
- func (s *QKCMasterBackend) SubmitWork(branch account.Branch, headerHash common.Hash, nonce uint64, ...) (bool, error)
- func (s *QKCMasterBackend) UpdateShardStatus(status *rpc.ShardStatus)
- func (s *QKCMasterBackend) UpdateTxCountHistory(txCount, xShardTxCount uint32, createTime uint64)
- type SlaveConnection
- func (s *SlaveConnection) AddBlockListForSync(request *rpc.AddBlockListForSyncRequest) (*rpc.ShardStatus, error)
- func (s *SlaveConnection) AddRootBlock(rootBlock *types.RootBlock, expectSwitch bool) error
- func (s *SlaveConnection) AddTransaction(tx *types.Transaction) error
- func (s *SlaveConnection) AddTransactions(request *p2p.NewTransactionList) (*rpc.HashList, error)
- func (s *SlaveConnection) EstimateGas(tx *types.Transaction, fromAddress *account.Address) (uint32, error)
- func (s *SlaveConnection) ExecuteTransaction(tx *types.Transaction, fromAddress *account.Address, height *uint64) ([]byte, error)
- func (s *SlaveConnection) GasPrice(branch account.Branch) (uint64, error)
- func (s *SlaveConnection) GenTx(numTxPerShard, xShardPercent uint32, tx *types.Transaction) error
- func (s *SlaveConnection) GetAccountData(address *account.Address, height *uint64) (*rpc.GetAccountDataResponse, error)
- func (s *SlaveConnection) GetCode(address *account.Address, height *uint64) ([]byte, error)
- func (s *SlaveConnection) GetLogs(branch account.Branch, address []account.Address, topics [][]common.Hash, ...) ([]*types.Log, error)
- func (s *SlaveConnection) GetMinorBlockByHash(blockHash common.Hash, branch account.Branch) (*types.MinorBlock, error)
- func (s *SlaveConnection) GetMinorBlockByHeight(height uint64, branch account.Branch) (*types.MinorBlock, error)
- func (s *SlaveConnection) GetMinorBlockHeaders(request *p2p.GetMinorBlockHeaderListRequest) (*p2p.GetMinorBlockHeaderListResponse, error)
- func (s *SlaveConnection) GetMinorBlocks(request *rpc.GetMinorBlockListRequest) (*p2p.GetMinorBlockListResponse, error)
- func (s *SlaveConnection) GetShardMaskList() []*types.ChainMask
- func (s *SlaveConnection) GetSlaveID() string
- func (s *SlaveConnection) GetStorageAt(address *account.Address, key common.Hash, height *uint64) (common.Hash, error)
- func (s *SlaveConnection) GetTransactionByHash(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, error)
- func (s *SlaveConnection) GetTransactionReceipt(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, *types.Receipt, error)
- func (s *SlaveConnection) GetTransactionsByAddress(address *account.Address, start []byte, limit uint32) ([]*rpc.TransactionDetail, []byte, error)
- func (s *SlaveConnection) GetUnconfirmedHeaders() (*rpc.GetUnconfirmedHeadersResponse, error)
- func (s *SlaveConnection) GetWork(branch account.Branch) (*consensus.MiningWork, error)
- func (s *SlaveConnection) HandleNewMinorBlock(request *p2p.NewBlockMinor) (bool, error)
- func (s *SlaveConnection) HandleNewTip(request *rpc.HandleNewTipRequest) (bool, error)
- func (s *SlaveConnection) HasShard(fullShardID uint32) bool
- func (s *SlaveConnection) HeartBeat() bool
- func (s *SlaveConnection) MasterInfo(ip string, port uint16, rootTip *types.RootBlock) error
- func (s *SlaveConnection) SendConnectToSlaves(slaveInfoLst []*rpc.SlaveInfo) error
- func (s *SlaveConnection) SendMiningConfigToSlaves(artificialTxConfig *rpc.ArtificialTxConfig, mining bool) error
- func (s *SlaveConnection) SendPing() ([]byte, []*types.ChainMask, error)
- func (s *SlaveConnection) SetMining(mining bool) error
- func (s *SlaveConnection) SubmitWork(work *rpc.SubmitWorkRequest) (success bool, err error)
- type TxForQueue
Constants ¶
const ( QKCProtocolName = "quarkchain" QKCProtocolVersion = 1 QKCProtocolLength = 16 )
QKCProtocol details
Variables ¶
var (
ErrNoBranchConn = errors.New("no such branch's connection")
)
Functions ¶
This section is empty.
Types ¶
type MasterServerSideOp ¶
type MasterServerSideOp struct {
// contains filtered or unexported fields
}
func NewServerSideOp ¶
func NewServerSideOp(master *QKCMasterBackend) *MasterServerSideOp
func (*MasterServerSideOp) AddMinorBlockHeader ¶
func (*MasterServerSideOp) BroadcastNewMinorBlock ¶
func (*MasterServerSideOp) BroadcastNewTip ¶
func (m *MasterServerSideOp) BroadcastNewTip(ctx context.Context, req *rpc.Request) (*rpc.Response, error)
p2p apis
func (*MasterServerSideOp) BroadcastTransactions ¶
func (*MasterServerSideOp) GetMinorBlockHeaderList ¶
func (*MasterServerSideOp) GetMinorBlockList ¶
type PrivateP2PAPI ¶
type PrivateP2PAPI struct {
// contains filtered or unexported fields
}
func NewPrivateP2PAPI ¶
func NewPrivateP2PAPI(peers *peerSet) *PrivateP2PAPI
NewPrivateP2PAPI creates a new peer shard p2p protocol API.
func (*PrivateP2PAPI) BroadcastMinorBlock ¶
func (api *PrivateP2PAPI) BroadcastMinorBlock(branch uint32, block *types.MinorBlock) error
BroadcastMinorBlock will be called when a minor block first time added to a chain
func (*PrivateP2PAPI) BroadcastNewTip ¶
func (api *PrivateP2PAPI) BroadcastNewTip(branch uint32, rootBlockHeader *types.RootBlockHeader, minorBlockHeaderList []*types.MinorBlockHeader) error
func (*PrivateP2PAPI) BroadcastTransactions ¶
func (api *PrivateP2PAPI) BroadcastTransactions(branch uint32, txs []*types.Transaction)
BroadcastTransactions only be called when run performance test which the txs are created by shard itself, so broadcast to all the peer
func (*PrivateP2PAPI) GetMinorBlockHeaders ¶
func (api *PrivateP2PAPI) GetMinorBlockHeaders(hash common.Hash, amount uint32, branch uint32, reverse bool, peerId string) ([]*types.MinorBlockHeader, error)
func (*PrivateP2PAPI) GetMinorBlockList ¶
func (api *PrivateP2PAPI) GetMinorBlockList(hashList []common.Hash, branch uint32, peerId string) ([]*types.MinorBlock, error)
type ProtocolManager ¶
type ProtocolManager struct {
// contains filtered or unexported fields
}
ProtocolManager QKC manager
func NewProtocolManager ¶
func NewProtocolManager(env config.ClusterConfig, rootBlockChain *core.RootBlockChain, statsChan chan *rpc.ShardStatus, synchronizer synchronizer.Synchronizer, getShardConnFunc func(fullShardId uint32) []rpc.ShardConnForP2P) (*ProtocolManager, error)
NewQKCManager new qkc manager
func (*ProtocolManager) BroadcastTip ¶
func (pm *ProtocolManager) BroadcastTip(header *types.RootBlockHeader)
func (*ProtocolManager) BroadcastTransactions ¶
func (pm *ProtocolManager) BroadcastTransactions(branch uint32, txs []*types.Transaction, sourcePeerId string)
func (*ProtocolManager) HandleGetMinorBlockHeaderListRequest ¶
func (pm *ProtocolManager) HandleGetMinorBlockHeaderListRequest(rpcId uint64, branch uint32, request *p2p.GetMinorBlockHeaderListRequest) (*p2p.GetMinorBlockHeaderListResponse, error)
func (*ProtocolManager) HandleGetMinorBlockListRequest ¶
func (pm *ProtocolManager) HandleGetMinorBlockListRequest(peerId string, rpcId uint64, branch uint32, request *p2p.GetMinorBlockListRequest) (*p2p.GetMinorBlockListResponse, error)
func (*ProtocolManager) HandleGetRootBlockHeaderListRequest ¶
func (pm *ProtocolManager) HandleGetRootBlockHeaderListRequest(blockHeaderReq *p2p.GetRootBlockHeaderListRequest) (*p2p.GetRootBlockHeaderListResponse, error)
func (*ProtocolManager) HandleGetRootBlockListRequest ¶
func (pm *ProtocolManager) HandleGetRootBlockListRequest(request *p2p.GetRootBlockListRequest) (*p2p.GetRootBlockListResponse, error)
func (*ProtocolManager) HandleNewMinorTip ¶
func (pm *ProtocolManager) HandleNewMinorTip(branch uint32, tip *p2p.Tip, peer *peer) error
func (*ProtocolManager) HandleNewRootTip ¶
func (pm *ProtocolManager) HandleNewRootTip(tip *p2p.Tip, peer *peer) error
func (*ProtocolManager) HandleNewTransactionListRequest ¶
func (pm *ProtocolManager) HandleNewTransactionListRequest(peerId string, rpcId uint64, branch uint32, request *p2p.NewTransactionList) error
func (*ProtocolManager) Stop ¶
func (pm *ProtocolManager) Stop()
type QKCMasterBackend ¶
type QKCMasterBackend struct {
// contains filtered or unexported fields
}
QKCMasterBackend masterServer include connections
func New ¶
func New(ctx *service.ServiceContext, cfg *config.ClusterConfig) (*QKCMasterBackend, error)
New new master with config
func (*QKCMasterBackend) APIs ¶
func (s *QKCMasterBackend) APIs() []ethRPC.API
APIs return all apis for master Server
func (*QKCMasterBackend) AddRootBlock ¶
func (s *QKCMasterBackend) AddRootBlock(rootBlock *types.RootBlock) error
AddRootBlock add root block to all slaves
func (*QKCMasterBackend) AddTransaction ¶
func (s *QKCMasterBackend) AddTransaction(tx *types.Transaction) error
func (*QKCMasterBackend) ConnectToSlaves ¶
func (s *QKCMasterBackend) ConnectToSlaves() error
func (*QKCMasterBackend) CreateBlockToMine ¶
func (s *QKCMasterBackend) CreateBlockToMine() (types.IBlock, error)
miner api
func (*QKCMasterBackend) CreateTransactions ¶
func (s *QKCMasterBackend) CreateTransactions(numTxPerShard, xShardPercent uint32, tx *types.Transaction) error
CreateTransactions Create transactions and add to the network for load testing
func (*QKCMasterBackend) CurrentBlock ¶
func (s *QKCMasterBackend) CurrentBlock() *types.RootBlock
func (*QKCMasterBackend) EstimateGas ¶
func (s *QKCMasterBackend) EstimateGas(tx *types.Transaction, fromAddress *account.Address) (uint32, error)
func (*QKCMasterBackend) ExecuteTransaction ¶
func (s *QKCMasterBackend) ExecuteTransaction(tx *types.Transaction, address *account.Address, height *uint64) ([]byte, error)
func (*QKCMasterBackend) GasPrice ¶
func (s *QKCMasterBackend) GasPrice(branch account.Branch) (uint64, error)
func (*QKCMasterBackend) GetAccountData ¶
func (s *QKCMasterBackend) GetAccountData(address *account.Address, height *uint64) (map[uint32]*rpc.AccountBranchData, error)
GetAccountData get account Data for jsonRpc
func (*QKCMasterBackend) GetBlockCount ¶
func (*QKCMasterBackend) GetClusterConfig ¶
func (s *QKCMasterBackend) GetClusterConfig() *config.ClusterConfig
func (*QKCMasterBackend) GetLastMinorBlockByFullShardID ¶
func (s *QKCMasterBackend) GetLastMinorBlockByFullShardID(fullShardId uint32) (uint64, error)
func (*QKCMasterBackend) GetMinorBlockByHash ¶
func (s *QKCMasterBackend) GetMinorBlockByHash(blockHash common.Hash, branch account.Branch) (*types.MinorBlock, error)
func (*QKCMasterBackend) GetMinorBlockByHeight ¶
func (s *QKCMasterBackend) GetMinorBlockByHeight(height *uint64, branch account.Branch) (*types.MinorBlock, error)
func (*QKCMasterBackend) GetPeers ¶
func (s *QKCMasterBackend) GetPeers() []rpc.PeerInfoForDisPlay
func (*QKCMasterBackend) GetPrimaryAccountData ¶
func (s *QKCMasterBackend) GetPrimaryAccountData(address *account.Address, blockHeight *uint64) (*rpc.AccountBranchData, error)
GetPrimaryAccountData get primary account data for jsonRpc
func (*QKCMasterBackend) GetRootBlockByHash ¶
func (*QKCMasterBackend) GetRootBlockByNumber ¶
func (s *QKCMasterBackend) GetRootBlockByNumber(blockNumber *uint64) (*types.RootBlock, error)
func (*QKCMasterBackend) GetSlavePoolLen ¶
func (s *QKCMasterBackend) GetSlavePoolLen() int
func (*QKCMasterBackend) GetStats ¶
func (s *QKCMasterBackend) GetStats() (map[string]interface{}, error)
func (*QKCMasterBackend) GetStorageAt ¶
func (*QKCMasterBackend) GetTip ¶
func (s *QKCMasterBackend) GetTip() uint64
func (*QKCMasterBackend) GetTransactionByHash ¶
func (s *QKCMasterBackend) GetTransactionByHash(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, error)
func (*QKCMasterBackend) GetTransactionReceipt ¶
func (*QKCMasterBackend) GetTransactionsByAddress ¶
func (s *QKCMasterBackend) GetTransactionsByAddress(address *account.Address, start []byte, limit uint32) ([]*rpc.TransactionDetail, []byte, error)
func (*QKCMasterBackend) GetWork ¶
func (s *QKCMasterBackend) GetWork(branch account.Branch) (*consensus.MiningWork, error)
return root chain work if branch is nil
func (*QKCMasterBackend) Heartbeat ¶
func (s *QKCMasterBackend) Heartbeat()
func (*QKCMasterBackend) Init ¶
func (s *QKCMasterBackend) Init(srvr *p2p.Server) error
Start start node -> start qkcMaster
func (*QKCMasterBackend) InsertMinedBlock ¶
func (s *QKCMasterBackend) InsertMinedBlock(block types.IBlock) error
func (*QKCMasterBackend) IsMining ¶
func (s *QKCMasterBackend) IsMining() bool
func (*QKCMasterBackend) IsSyncing ¶
func (s *QKCMasterBackend) IsSyncing() bool
func (*QKCMasterBackend) NetWorkInfo ¶
func (s *QKCMasterBackend) NetWorkInfo() map[string]interface{}
func (*QKCMasterBackend) Protocols ¶
func (s *QKCMasterBackend) Protocols() []p2p.Protocol
Protocols p2p protocols, p2p Server will start in node.Start
func (*QKCMasterBackend) SendMiningConfigToSlaves ¶
func (s *QKCMasterBackend) SendMiningConfigToSlaves(mining bool) error
SendMiningConfigToSlaves send mining config to slaves,used in jsonRpc
func (*QKCMasterBackend) SetMining ¶
func (s *QKCMasterBackend) SetMining(mining bool)
func (*QKCMasterBackend) SetTargetBlockTime ¶
func (s *QKCMasterBackend) SetTargetBlockTime(rootBlockTime *uint32, minorBlockTime *uint32) error
SetTargetBlockTime set target Time from jsonRpc
func (*QKCMasterBackend) Start ¶
func (s *QKCMasterBackend) Start() error
InitCluster init cluster : 1:ConnectToSlaves 2:logSummary 3:check if has all shards 4.setup slave to slave 5:init shards
func (*QKCMasterBackend) Stop ¶
func (s *QKCMasterBackend) Stop() error
Stop stop node -> stop qkcMaster
func (*QKCMasterBackend) SubmitWork ¶
func (s *QKCMasterBackend) SubmitWork(branch account.Branch, headerHash common.Hash, nonce uint64, mixHash common.Hash) (bool, error)
submit root chain work if branch is nil
func (*QKCMasterBackend) UpdateShardStatus ¶
func (s *QKCMasterBackend) UpdateShardStatus(status *rpc.ShardStatus)
UpdateShardStatus update shard status for branchg
func (*QKCMasterBackend) UpdateTxCountHistory ¶
func (s *QKCMasterBackend) UpdateTxCountHistory(txCount, xShardTxCount uint32, createTime uint64)
UpdateTxCountHistory update Tx count queue
type SlaveConnection ¶
type SlaveConnection struct {
// contains filtered or unexported fields
}
func NewSlaveConn ¶
func NewSlaveConn(target string, shardMaskList []*types.ChainMask, slaveID string) *SlaveConnection
create slave connection manager
func (*SlaveConnection) AddBlockListForSync ¶
func (s *SlaveConnection) AddBlockListForSync(request *rpc.AddBlockListForSyncRequest) (*rpc.ShardStatus, error)
func (*SlaveConnection) AddRootBlock ¶
func (s *SlaveConnection) AddRootBlock(rootBlock *types.RootBlock, expectSwitch bool) error
func (*SlaveConnection) AddTransaction ¶
func (s *SlaveConnection) AddTransaction(tx *types.Transaction) error
func (*SlaveConnection) AddTransactions ¶
func (s *SlaveConnection) AddTransactions(request *p2p.NewTransactionList) (*rpc.HashList, error)
func (*SlaveConnection) EstimateGas ¶
func (s *SlaveConnection) EstimateGas(tx *types.Transaction, fromAddress *account.Address) (uint32, error)
func (*SlaveConnection) ExecuteTransaction ¶
func (s *SlaveConnection) ExecuteTransaction(tx *types.Transaction, fromAddress *account.Address, height *uint64) ([]byte, error)
func (*SlaveConnection) GasPrice ¶
func (s *SlaveConnection) GasPrice(branch account.Branch) (uint64, error)
func (*SlaveConnection) GenTx ¶
func (s *SlaveConnection) GenTx(numTxPerShard, xShardPercent uint32, tx *types.Transaction) error
func (*SlaveConnection) GetAccountData ¶
func (s *SlaveConnection) GetAccountData(address *account.Address, height *uint64) (*rpc.GetAccountDataResponse, error)
func (*SlaveConnection) GetMinorBlockByHash ¶
func (s *SlaveConnection) GetMinorBlockByHash(blockHash common.Hash, branch account.Branch) (*types.MinorBlock, error)
func (*SlaveConnection) GetMinorBlockByHeight ¶
func (s *SlaveConnection) GetMinorBlockByHeight(height uint64, branch account.Branch) (*types.MinorBlock, error)
func (*SlaveConnection) GetMinorBlockHeaders ¶
func (s *SlaveConnection) GetMinorBlockHeaders(request *p2p.GetMinorBlockHeaderListRequest) (*p2p.GetMinorBlockHeaderListResponse, error)
func (*SlaveConnection) GetMinorBlocks ¶
func (s *SlaveConnection) GetMinorBlocks(request *rpc.GetMinorBlockListRequest) (*p2p.GetMinorBlockListResponse, error)
func (*SlaveConnection) GetShardMaskList ¶
func (s *SlaveConnection) GetShardMaskList() []*types.ChainMask
func (*SlaveConnection) GetSlaveID ¶
func (s *SlaveConnection) GetSlaveID() string
func (*SlaveConnection) GetStorageAt ¶
func (*SlaveConnection) GetTransactionByHash ¶
func (s *SlaveConnection) GetTransactionByHash(txHash common.Hash, branch account.Branch) (*types.MinorBlock, uint32, error)
func (*SlaveConnection) GetTransactionReceipt ¶
func (*SlaveConnection) GetTransactionsByAddress ¶
func (s *SlaveConnection) GetTransactionsByAddress(address *account.Address, start []byte, limit uint32) ([]*rpc.TransactionDetail, []byte, error)
func (*SlaveConnection) GetUnconfirmedHeaders ¶
func (s *SlaveConnection) GetUnconfirmedHeaders() (*rpc.GetUnconfirmedHeadersResponse, error)
func (*SlaveConnection) GetWork ¶
func (s *SlaveConnection) GetWork(branch account.Branch) (*consensus.MiningWork, error)
func (*SlaveConnection) HandleNewMinorBlock ¶
func (s *SlaveConnection) HandleNewMinorBlock(request *p2p.NewBlockMinor) (bool, error)
func (*SlaveConnection) HandleNewTip ¶
func (s *SlaveConnection) HandleNewTip(request *rpc.HandleNewTipRequest) (bool, error)
func (*SlaveConnection) HasShard ¶
func (s *SlaveConnection) HasShard(fullShardID uint32) bool
func (*SlaveConnection) HeartBeat ¶
func (s *SlaveConnection) HeartBeat() bool
func (*SlaveConnection) MasterInfo ¶
func (*SlaveConnection) SendConnectToSlaves ¶
func (s *SlaveConnection) SendConnectToSlaves(slaveInfoLst []*rpc.SlaveInfo) error
func (*SlaveConnection) SendMiningConfigToSlaves ¶
func (s *SlaveConnection) SendMiningConfigToSlaves(artificialTxConfig *rpc.ArtificialTxConfig, mining bool) error
func (*SlaveConnection) SendPing ¶
func (s *SlaveConnection) SendPing() ([]byte, []*types.ChainMask, error)
func (*SlaveConnection) SetMining ¶
func (s *SlaveConnection) SetMining(mining bool) error
func (*SlaveConnection) SubmitWork ¶
func (s *SlaveConnection) SubmitWork(work *rpc.SubmitWorkRequest) (success bool, err error)