seele

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2019 License: LGPL-3.0 Imports: 37 Imported by: 25

Documentation

Index

Constants

View Source
const (
	// BlockChainDir blockchain data directory based on config.DataRoot
	BlockChainDir = "/db/blockchain"

	// AccountStateDir account state info directory based on config.DataRoot
	AccountStateDir = "/db/accountState"

	// 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"
)
View Source
const (
	// DiscHandShakeErr peer handshake error
	DiscHandShakeErr = "disconnect because got handshake error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DebtInfo

type DebtInfo struct {
	// contains filtered or unexported fields
}

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) Has

func (m *DebtManager) Has(hash common.Hash) bool

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) 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

type SeeleBackend

type SeeleBackend struct {
	// contains filtered or unexported fields
}

func NewSeeleBackend

func NewSeeleBackend(s *SeeleService) *SeeleBackend

NewSeeleBackend backend

func (*SeeleBackend) ChainBackend

func (sd *SeeleBackend) ChainBackend() api.Chain

ChainBackend block chain db

func (*SeeleBackend) GetBlock

func (sd *SeeleBackend) GetBlock(hash common.Hash, height int64) (*types.Block, error)

GetBlock returns the requested block by hash or height

func (*SeeleBackend) GetBlockTotalDifficulty

func (sd *SeeleBackend) GetBlockTotalDifficulty(hash common.Hash) (*big.Int, error)

GetBlockTotalDifficulty return total difficulty

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

func (sd *SeeleBackend) GetReceiptByTxHash(hash common.Hash) (*types.Receipt, error)

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) IsSyncing

func (sd *SeeleBackend) IsSyncing() bool

IsSyncing check status

func (*SeeleBackend) Log

func (sd *SeeleBackend) Log() *log.SeeleLog

Log return log pointer

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

type SeeleProtocol struct {
	p2p.Protocol
	// contains filtered or unexported fields
}

SeeleProtocol service implementation of seele

func NewSeeleProtocol

func NewSeeleProtocol(seele *SeeleService, log *log.SeeleLog) (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) FindPeers

func (sp *SeeleProtocol) FindPeers(targets map[common.Address]bool) map[common.Address]consensus.Peer

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) 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) DebtPool

func (s *SeeleService) DebtPool() *core.DebtPool

DebtPool debt pool

func (*SeeleService) Downloader

func (s *SeeleService) Downloader() *downloader.Downloader

Downloader get downloader

func (*SeeleService) Miner

func (s *SeeleService) Miner() *miner.Miner

Miner get miner

func (*SeeleService) MonitorChainHeaderChange

func (s *SeeleService) MonitorChainHeaderChange()

MonitorChainHeaderChange monitor and handle chain header event

func (*SeeleService) NetVersion

func (s *SeeleService) NetVersion() string

NetVersion net version

func (*SeeleService) NetWorkID

func (s *SeeleService) NetWorkID() string

NetWorkID net id

func (*SeeleService) P2PServer added in v1.0.4

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.

func (*SeeleService) TxPool

func (s *SeeleService) TxPool() *core.TransactionPool

TxPool tx pool

type ServiceContext

type ServiceContext struct {
	DataDir string
}

ServiceContext is a collection of service configuration inherited from node

type TpsInfo

type TpsInfo struct {
	StartHeight uint64
	EndHeight   uint64
	Count       uint64
	Duration    uint64
}

TpsInfo tps detail info

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL