Documentation ¶
Index ¶
- Constants
- type DebtInfo
- type DebtManager
- func (m *DebtManager) AddDebtMap(debtMap [][]*types.Debt, height uint64)
- func (m *DebtManager) AddDebts(debts []*types.Debt)
- func (m *DebtManager) GetAll() []*DebtInfo
- func (m *DebtManager) Has(hash common.Hash) bool
- func (m *DebtManager) Remove(hash common.Hash)
- func (m *DebtManager) TimingChecking()
- type PeerInfo
- type PrivateDebugAPI
- type PrivateMinerAPI
- func (api *PrivateMinerAPI) GetCoinbase() (common.Address, error)
- func (api *PrivateMinerAPI) SetCoinbase(coinbaseStr string) (bool, error)
- func (api *PrivateMinerAPI) SetThreads(threads int) (bool, error)
- func (api *PrivateMinerAPI) Start() (bool, error)
- func (api *PrivateMinerAPI) Status() (string, error)
- func (api *PrivateMinerAPI) Stop() (bool, error)
- type PublicSeeleAPI
- func (api *PublicSeeleAPI) Call(contract, payload string, height int64) (map[string]interface{}, error)
- func (api *PublicSeeleAPI) EstimateGas(tx *types.Transaction) (uint64, error)
- func (api *PublicSeeleAPI) GeneratePayload(abiJSON string, methodName string, args []string) (string, error)
- func (api *PublicSeeleAPI) GetHeight() (int64, error)
- func (api *PublicSeeleAPI) GetInfo() (api2.GetMinerInfo, error)
- func (api *PublicSeeleAPI) GetLogs(height int64, contractAddress common.Address, abiJSON, eventName string) ([]api2.GetLogsResponse, error)
- func (api *PublicSeeleAPI) GetShardNum(account common.Address) (uint, error)
- type SeeleBackend
- func (sd *SeeleBackend) ChainBackend() api.Chain
- func (sd *SeeleBackend) GenesisInfo() core.GenesisInfo
- func (sd *SeeleBackend) GetAccountIndexDB() database.Database
- func (sd *SeeleBackend) GetBlock(hash common.Hash, height int64) (*types.Block, error)
- func (sd *SeeleBackend) GetBlockTotalDifficulty(hash common.Hash) (*big.Int, error)
- func (sd *SeeleBackend) GetIndexAccountDB() database.Database
- func (sd *SeeleBackend) GetNetVersion() string
- func (sd *SeeleBackend) GetNetWorkID() string
- func (sd *SeeleBackend) GetP2pServer() *p2p.Server
- func (sd *SeeleBackend) GetReceiptByTxHash(hash common.Hash) (*types.Receipt, error)
- func (sd *SeeleBackend) GetTransaction(pool api.PoolCore, bcStore store.BlockchainStore, txHash common.Hash) (*types.Transaction, *api.BlockIndex, error)
- func (sd *SeeleBackend) IsSyncing() bool
- func (sd *SeeleBackend) Log() *log.SeeleLog
- func (sd *SeeleBackend) ProtocolBackend() api.Protocol
- func (sd *SeeleBackend) TxPoolBackend() api.Pool
- type SeeleProtocol
- func (s *SeeleProtocol) Downloader() *downloader.Downloader
- func (sp *SeeleProtocol) FindPeers(targets map[common.Address]bool) map[common.Address]consensus.Peer
- func (p *SeeleProtocol) GetProtocolVersion() (uint, error)
- func (p *SeeleProtocol) SendDifferentShardTx(tx *types.Transaction, shard uint)
- func (sp *SeeleProtocol) Start()
- func (sp *SeeleProtocol) Stop()
- type SeeleService
- func (s *SeeleService) APIs() (apis []rpc.API)
- func (s *SeeleService) AccountIndexDB() database.Database
- func (s *SeeleService) AccountStateDB() database.Database
- func (s *SeeleService) BlockChain() *core.Blockchain
- func (s *SeeleService) DebtPool() *core.DebtPool
- func (s *SeeleService) Downloader() *downloader.Downloader
- func (s *SeeleService) GenesisInfo() core.GenesisInfo
- func (s *SeeleService) GetAccountIndexDB() database.Database
- func (s *SeeleService) GetIndexAccountDB() database.Database
- func (s *SeeleService) IndexAccountDB() database.Database
- func (s *SeeleService) Miner() *miner.Miner
- func (s *SeeleService) MonitorChainHeaderChange()
- func (s *SeeleService) NetVersion() string
- func (s *SeeleService) NetWorkID() string
- func (s *SeeleService) P2PServer() *p2p.Server
- func (s *SeeleService) Protocols() (protos []p2p.Protocol)
- func (s *SeeleService) Start(srvr *p2p.Server) error
- func (s *SeeleService) Stop() error
- func (s *SeeleService) TxPool() *core.TransactionPool
- type ServiceContext
- type TpsInfo
- type TransactionPoolAPI
Constants ¶
const ( // BlockChainDir blockchain data directory based on config.DataRoot BlockChainDir = "/db/blockchain" // AccountStateDir account state info directory based on config.DataRoot AccountStateDir = "/db/accountState" // AccountIndexDir AccountIndexDir = "/db/accountIndex" // IndexAccountDir IndexAccountDir = "/db/indexAccount" // DebtManagerDir to-be-sent debt directory based on config.DataRoot DebtManagerDir = "/db/debtManager" // BlockChainRecoveryPointFile is used to store the recovery point info of blockchain. BlockChainRecoveryPointFile = "recoveryPoint.json" )
const (
// DiscHandShakeErr peer handshake error
DiscHandShakeErr = "disconnect because got handshake error"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebtManager ¶
type DebtManager struct {
// contains filtered or unexported fields
}
func NewDebtManager ¶
func NewDebtManager(debtChecker types.DebtVerifier, p propagateDebts, chain *core.Blockchain, debtManagerDB database.Database) *DebtManager
func (*DebtManager) AddDebtMap ¶
func (m *DebtManager) AddDebtMap(debtMap [][]*types.Debt, height uint64)
func (*DebtManager) AddDebts ¶
func (m *DebtManager) AddDebts(debts []*types.Debt)
func (*DebtManager) GetAll ¶
func (m *DebtManager) GetAll() []*DebtInfo
func (*DebtManager) Remove ¶
func (m *DebtManager) Remove(hash common.Hash)
func (*DebtManager) TimingChecking ¶
func (m *DebtManager) TimingChecking()
type PeerInfo ¶
type PeerInfo struct { Version uint `json:"version"` // Seele protocol version negotiated Difficulty *big.Int `json:"difficulty"` // Total difficulty of the peer's blockchain Head string `json:"head"` // SHA3 hash of the peer's best owned block }
PeerInfo represents a short summary of a connected peer.
type PrivateDebugAPI ¶
type PrivateDebugAPI struct {
// contains filtered or unexported fields
}
PrivateDebugAPI provides an API to access full node-related information for debug.
func NewPrivateDebugAPI ¶
func NewPrivateDebugAPI(s *SeeleService) *PrivateDebugAPI
NewPrivateDebugAPI creates a new NewPrivateDebugAPI object for rpc service.
func (*PrivateDebugAPI) DumpHeap ¶
func (api *PrivateDebugAPI) DumpHeap(fileName string, gcBeforeDump bool) (string, error)
DumpHeap dumps the heap usage.
func (*PrivateDebugAPI) GetPendingDebts ¶
func (api *PrivateDebugAPI) GetPendingDebts() ([]*types.Debt, error)
GetPendingDebts returns all pending debts
func (*PrivateDebugAPI) GetTPS ¶
func (api *PrivateDebugAPI) GetTPS() (*TpsInfo, error)
GetTPS get tps info
func (*PrivateDebugAPI) PrintBlock ¶
func (api *PrivateDebugAPI) PrintBlock(height int64) (*types.Block, error)
PrintBlock retrieves a block and returns its pretty printed form, when height is -1 the chain head is returned
type PrivateMinerAPI ¶
type PrivateMinerAPI struct {
// contains filtered or unexported fields
}
PrivateMinerAPI provides an API to access miner information.
func NewPrivateMinerAPI ¶
func NewPrivateMinerAPI(s *SeeleService) *PrivateMinerAPI
NewPrivateMinerAPI creates a new PrivateMinerAPI object for miner rpc service.
func (*PrivateMinerAPI) GetCoinbase ¶
func (api *PrivateMinerAPI) GetCoinbase() (common.Address, error)
GetCoinbase API is used to get the coinbase.
func (*PrivateMinerAPI) SetCoinbase ¶
func (api *PrivateMinerAPI) SetCoinbase(coinbaseStr string) (bool, error)
SetCoinbase API is used to set the coinbase.
func (*PrivateMinerAPI) SetThreads ¶
func (api *PrivateMinerAPI) SetThreads(threads int) (bool, error)
SetThreads API is used to set the number of threads.
func (*PrivateMinerAPI) Start ¶
func (api *PrivateMinerAPI) Start() (bool, error)
Start API is used to start the miner with the given number of threads.
func (*PrivateMinerAPI) Status ¶
func (api *PrivateMinerAPI) Status() (string, error)
Status API is used to view the miner's status.
func (*PrivateMinerAPI) Stop ¶
func (api *PrivateMinerAPI) Stop() (bool, error)
Stop API is used to stop the miner.
type PublicSeeleAPI ¶
type PublicSeeleAPI struct {
// contains filtered or unexported fields
}
PublicSeeleAPI provides an API to access full node-related information.
func NewPublicSeeleAPI ¶
func NewPublicSeeleAPI(s *SeeleService) *PublicSeeleAPI
NewPublicSeeleAPI creates a new PublicSeeleAPI object for rpc service.
func (*PublicSeeleAPI) Call ¶
func (api *PublicSeeleAPI) Call(contract, payload string, height int64) (map[string]interface{}, error)
Call is to execute a given transaction on a statedb of a given block height. It does not affect this statedb and blockchain and is useful for executing and retrieve values.
func (*PublicSeeleAPI) EstimateGas ¶
func (api *PublicSeeleAPI) EstimateGas(tx *types.Transaction) (uint64, error)
EstimateGas returns an estimate of the amount of gas needed to execute the given transaction against the current pending block.
func (*PublicSeeleAPI) GeneratePayload ¶
func (api *PublicSeeleAPI) GeneratePayload(abiJSON string, methodName string, args []string) (string, error)
GeneratePayload according to abi json string and methodName and args to generate payload hex string
func (*PublicSeeleAPI) GetHeight ¶
func (api *PublicSeeleAPI) GetHeight() (int64, error)
func (*PublicSeeleAPI) GetInfo ¶
func (api *PublicSeeleAPI) GetInfo() (api2.GetMinerInfo, error)
GetInfo gets the account address that mining rewards will be send to.
func (*PublicSeeleAPI) GetLogs ¶
func (api *PublicSeeleAPI) GetLogs(height int64, contractAddress common.Address, abiJSON, eventName string) ([]api2.GetLogsResponse, error)
GetLogs Get the logs that satisfies the condition in the block by height and filter
func (*PublicSeeleAPI) GetShardNum ¶
func (api *PublicSeeleAPI) GetShardNum(account common.Address) (uint, error)
GetShardNum gets the account shard number . if the address is valid, return the corresponding shard number, otherwise return 0
type SeeleBackend ¶
type SeeleBackend struct {
// contains filtered or unexported fields
}
func (*SeeleBackend) ChainBackend ¶
func (sd *SeeleBackend) ChainBackend() api.Chain
ChainBackend block chain db
func (*SeeleBackend) GenesisInfo ¶
func (sd *SeeleBackend) GenesisInfo() core.GenesisInfo
func (*SeeleBackend) GetAccountIndexDB ¶
func (sd *SeeleBackend) GetAccountIndexDB() database.Database
func (*SeeleBackend) GetBlockTotalDifficulty ¶
GetBlockTotalDifficulty return total difficulty
func (*SeeleBackend) GetIndexAccountDB ¶
func (sd *SeeleBackend) GetIndexAccountDB() database.Database
func (*SeeleBackend) GetNetVersion ¶
func (sd *SeeleBackend) GetNetVersion() string
GetNetVersion net version
func (*SeeleBackend) GetNetWorkID ¶
func (sd *SeeleBackend) GetNetWorkID() string
GetNetWorkID net id
func (*SeeleBackend) GetP2pServer ¶
func (sd *SeeleBackend) GetP2pServer() *p2p.Server
GetP2pServer p2p server
func (*SeeleBackend) GetReceiptByTxHash ¶
GetReceiptByTxHash get receipt by transaction hash
func (*SeeleBackend) GetTransaction ¶
func (sd *SeeleBackend) GetTransaction(pool api.PoolCore, bcStore store.BlockchainStore, txHash common.Hash) (*types.Transaction, *api.BlockIndex, error)
GetTransaction return tx
func (*SeeleBackend) ProtocolBackend ¶
func (sd *SeeleBackend) ProtocolBackend() api.Protocol
ProtocolBackend return protocol
func (*SeeleBackend) TxPoolBackend ¶
func (sd *SeeleBackend) TxPoolBackend() api.Pool
TxPoolBackend tx pool
type SeeleProtocol ¶
SeeleProtocol service implementation of seele
func NewSeeleProtocol ¶
func NewSeeleProtocol(seele *SeeleService, log *log.SeeleLog, engine consensus.Engine) (s *SeeleProtocol, err error)
NewSeeleProtocol create SeeleProtocol
func (*SeeleProtocol) Downloader ¶
func (s *SeeleProtocol) Downloader() *downloader.Downloader
Downloader return a pointer of the downloader
func (*SeeleProtocol) GetProtocolVersion ¶
func (p *SeeleProtocol) GetProtocolVersion() (uint, error)
func (*SeeleProtocol) SendDifferentShardTx ¶
func (p *SeeleProtocol) SendDifferentShardTx(tx *types.Transaction, shard uint)
SendDifferentShardTx send tx to different shards
func (*SeeleProtocol) Start ¶
func (sp *SeeleProtocol) Start()
func (*SeeleProtocol) Stop ¶
func (sp *SeeleProtocol) Stop()
Stop stops protocol, called when seeleService quits.
type SeeleService ¶
type SeeleService struct {
// contains filtered or unexported fields
}
SeeleService implements full node service.
func NewSeeleService ¶
func NewSeeleService(ctx context.Context, conf *node.Config, log *log.SeeleLog, engine consensus.Engine, verifier types.DebtVerifier, startHeight int) (s *SeeleService, err error)
NewSeeleService create SeeleService
func (*SeeleService) APIs ¶
func (s *SeeleService) APIs() (apis []rpc.API)
APIs implements node.Service, returning the collection of RPC services the seele package offers. must to make sure that the order of the download api is 5; we get the download api by 5
func (*SeeleService) AccountIndexDB ¶
func (s *SeeleService) AccountIndexDB() database.Database
AccountIndexDB return account index db
func (*SeeleService) AccountStateDB ¶
func (s *SeeleService) AccountStateDB() database.Database
AccountStateDB return account state db
func (*SeeleService) BlockChain ¶
func (s *SeeleService) BlockChain() *core.Blockchain
BlockChain get blockchain
func (*SeeleService) Downloader ¶
func (s *SeeleService) Downloader() *downloader.Downloader
Downloader get downloader
func (*SeeleService) GenesisInfo ¶
func (s *SeeleService) GenesisInfo() core.GenesisInfo
Genesis Genesis information
func (*SeeleService) GetAccountIndexDB ¶
func (s *SeeleService) GetAccountIndexDB() database.Database
func (*SeeleService) GetIndexAccountDB ¶
func (s *SeeleService) GetIndexAccountDB() database.Database
func (*SeeleService) IndexAccountDB ¶
func (s *SeeleService) IndexAccountDB() database.Database
IndexAccountDB return index account db
func (*SeeleService) MonitorChainHeaderChange ¶
func (s *SeeleService) MonitorChainHeaderChange()
MonitorChainHeaderChange monitor and handle chain header event
func (*SeeleService) P2PServer ¶
func (s *SeeleService) P2PServer() *p2p.Server
P2PServer get p2pServer
func (*SeeleService) Protocols ¶
func (s *SeeleService) Protocols() (protos []p2p.Protocol)
Protocols implements node.Service, returning all the currently configured network protocols to start.
func (*SeeleService) Start ¶
func (s *SeeleService) Start(srvr *p2p.Server) error
Start implements node.Service, starting goroutines needed by SeeleService.
func (*SeeleService) Stop ¶
func (s *SeeleService) Stop() error
Stop implements node.Service, terminating all internal goroutines.
type ServiceContext ¶
type ServiceContext struct {
DataDir string
}
ServiceContext is a collection of service configuration inherited from node
type TransactionPoolAPI ¶
type TransactionPoolAPI struct {
// contains filtered or unexported fields
}
TransactionPoolAPI provides an API to access transaction pool information.
func NewTransactionPoolAPI ¶
func NewTransactionPoolAPI(s *SeeleService) *TransactionPoolAPI
NewTransactionPoolAPI creates a new PrivateTransactionPoolAPI object for transaction pool rpc service.
func (*TransactionPoolAPI) GetDebtByHash ¶
func (api *TransactionPoolAPI) GetDebtByHash(debtHash string) (map[string]interface{}, error)
GetDebtByHash return the debt info by debt hash