Documentation ¶
Index ¶
- func CreateDB(ctx *node.ServiceContext, config *Config, name string) (fdb.Database, error)
- type APIBackend
- func (b *APIBackend) APIs() []rpc.API
- func (b *APIBackend) AddBadNode(url string) error
- func (b *APIBackend) AddPeer(url string) error
- func (b *APIBackend) AddTrustedPeer(url string) error
- func (b *APIBackend) BadNodes() []string
- func (b *APIBackend) BadNodesCount() int
- func (b *APIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) *types.Block
- func (b *APIBackend) ChainConfig() *params.ChainConfig
- func (b *APIBackend) ChainDb() fdb.Database
- func (b *APIBackend) CurrentBlock() *types.Block
- func (b *APIBackend) Engine() consensus.IEngine
- func (b *APIBackend) ForkStatus(statedb *state.StateDB) (*blockchain.ForkConfig, blockchain.ForkInfo, error)
- func (b *APIBackend) GetAccountManager() (*accountmanager.AccountManager, error)
- func (b *APIBackend) GetBadBlocks(ctx context.Context) ([]*types.Block, error)
- func (b *APIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (b *APIBackend) GetBlockDetailLog(ctx context.Context, blockNr rpc.BlockNumber) *types.BlockAndResult
- func (b *APIBackend) GetDetailTxByFilter(ctx context.Context, filterFn func(common.Name) bool, ...) []*types.DetailTx
- func (b *APIBackend) GetDetailTxsLog(ctx context.Context, hash common.Hash) ([]*types.DetailTx, error)
- func (b *APIBackend) GetEVM(ctx context.Context, account *accountmanager.AccountManager, ...) (*vm.EVM, func() error, error)
- func (b *APIBackend) GetFeeManager() (*feemanager.FeeManager, error)
- func (b *APIBackend) GetFeeManagerByTime(time uint64) (*feemanager.FeeManager, error)
- func (b *APIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error)
- func (b *APIBackend) GetReceipts(ctx context.Context, hash common.Hash) ([]*types.Receipt, error)
- func (b *APIBackend) GetTd(blockHash common.Hash) *big.Int
- func (b *APIBackend) GetTxsByFilter(ctx context.Context, filterFn func(common.Name) bool, ...) *types.AccountTxs
- func (b *APIBackend) HeaderByHash(ctx context.Context, hash common.Hash) *types.Header
- func (b *APIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) *types.Header
- func (b *APIBackend) PeerCount() int
- func (b *APIBackend) Peers() []string
- func (b *APIBackend) RemoveBadNode(url string) error
- func (b *APIBackend) RemovePeer(url string) error
- func (b *APIBackend) RemoveTrustedPeer(url string) error
- func (b *APIBackend) SeedNodes() []string
- func (b *APIBackend) SelfNode() string
- func (b *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
- func (b *APIBackend) SetGasPrice(gasPrice *big.Int) bool
- func (b *APIBackend) SetStatePruning(enable bool) (bool, uint64)
- func (b *APIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
- func (b *APIBackend) SuggestPrice(ctx context.Context) (*big.Int, error)
- func (b *APIBackend) TxPool() *txpool.TxPool
- type Config
- type MinerConfig
- type SETService
- func (fs *SETService) APIs() []rpc.API
- func (s *SETService) BlockChain() *blockchain.BlockChain
- func (s *SETService) ChainDb() fdb.Database
- func (s *SETService) Engine() consensus.IEngine
- func (fs *SETService) GasPrice() *big.Int
- func (s *SETService) Protocols() []p2p.Protocol
- func (fs *SETService) SetGasPrice(gasPrice *big.Int) bool
- func (fs *SETService) Start() error
- func (fs *SETService) Stop() error
- func (s *SETService) TxPool() *txpool.TxPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIBackend ¶
type APIBackend struct {
// contains filtered or unexported fields
}
APIBackend implements setservice api.Backend for full nodes
func (*APIBackend) AddBadNode ¶
func (b *APIBackend) AddBadNode(url string) error
AddBadNode add a bad Node and would cause the node disconnected
func (*APIBackend) AddTrustedPeer ¶
func (b *APIBackend) AddTrustedPeer(url string) error
AddTrustedPeer allows a remote node to always connect, even if slots are full
func (*APIBackend) BadNodes ¶
func (b *APIBackend) BadNodes() []string
BadNodes returns all bad nodes.
func (*APIBackend) BadNodesCount ¶
func (b *APIBackend) BadNodesCount() int
BadNodesCount returns the number of bad nodes.
func (*APIBackend) BlockByNumber ¶
func (b *APIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) *types.Block
func (*APIBackend) ChainConfig ¶
func (b *APIBackend) ChainConfig() *params.ChainConfig
ChainConfig returns the active chain configuration.
func (*APIBackend) ChainDb ¶
func (b *APIBackend) ChainDb() fdb.Database
func (*APIBackend) CurrentBlock ¶
func (b *APIBackend) CurrentBlock() *types.Block
func (*APIBackend) Engine ¶
func (b *APIBackend) Engine() consensus.IEngine
func (*APIBackend) ForkStatus ¶
func (b *APIBackend) ForkStatus(statedb *state.StateDB) (*blockchain.ForkConfig, blockchain.ForkInfo, error)
func (*APIBackend) GetAccountManager ¶
func (b *APIBackend) GetAccountManager() (*accountmanager.AccountManager, error)
func (*APIBackend) GetBadBlocks ¶
func (*APIBackend) GetBlockDetailLog ¶
func (b *APIBackend) GetBlockDetailLog(ctx context.Context, blockNr rpc.BlockNumber) *types.BlockAndResult
func (*APIBackend) GetDetailTxByFilter ¶
func (*APIBackend) GetDetailTxsLog ¶
func (*APIBackend) GetFeeManager ¶
func (b *APIBackend) GetFeeManager() (*feemanager.FeeManager, error)
GetFeeManager get fee manager
func (*APIBackend) GetFeeManagerByTime ¶
func (b *APIBackend) GetFeeManagerByTime(time uint64) (*feemanager.FeeManager, error)
GetFeeManagerByTime get fee manager
func (*APIBackend) GetReceipts ¶
func (*APIBackend) GetTxsByFilter ¶
func (b *APIBackend) GetTxsByFilter(ctx context.Context, filterFn func(common.Name) bool, blockNr, lookforwardNum uint64) *types.AccountTxs
func (*APIBackend) HeaderByHash ¶
func (*APIBackend) HeaderByNumber ¶
func (b *APIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) *types.Header
func (*APIBackend) PeerCount ¶
func (b *APIBackend) PeerCount() int
PeerCount returns the number of connected peers.
func (*APIBackend) RemoveBadNode ¶
func (b *APIBackend) RemoveBadNode(url string) error
RemoveBadNode add a bad Node and would cause the node disconnected
func (*APIBackend) RemovePeer ¶
func (b *APIBackend) RemovePeer(url string) error
RemovePeer remove a P2P peer
func (*APIBackend) RemoveTrustedPeer ¶
func (b *APIBackend) RemoveTrustedPeer(url string) error
RemoveTrustedPeer removes a remote node from the trusted peer set, but it does not disconnect it automatically.
func (*APIBackend) SeedNodes ¶
func (b *APIBackend) SeedNodes() []string
SeedNodes returns all seed nodes.
func (*APIBackend) SelfNode ¶
func (b *APIBackend) SelfNode() string
SelfNode returns the local node's endpoint information.
func (*APIBackend) SendTx ¶
func (b *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
func (*APIBackend) SetGasPrice ¶
func (b *APIBackend) SetGasPrice(gasPrice *big.Int) bool
func (*APIBackend) SetStatePruning ¶
func (b *APIBackend) SetStatePruning(enable bool) (bool, uint64)
SetStatePruning set state pruning
func (*APIBackend) StateAndHeaderByNumber ¶
func (b *APIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
func (*APIBackend) SuggestPrice ¶
func (*APIBackend) TxPool ¶
func (b *APIBackend) TxPool() *txpool.TxPool
type Config ¶
type Config struct { // The genesis block, which is inserted if the database is empty. // If nil, the main net block is used. Genesis *blockchain.Genesis `toml:",omitempty"` // Database options DatabaseHandles int DatabaseCache int `mapstructure:"databasecache"` // Transaction pool options TxPool *txpool.Config `mapstructure:"txpool"` // Gas Price Oracle options GasPrice gasprice.Config `mapstructure:"gpo"` // miner Miner *MinerConfig `mapstructure:"miner"` MetricsConf *metrics.Config `mapstructure:"metrics"` StatePruning bool `mapstructure:"statepruning"` ContractLogFlag bool `mapstructure:"contractlog"` BadHashes []string `mapstructure:"badhashes"` StartNumber uint64 `mapstructure:"startnumber"` }
Config setservice config
type MinerConfig ¶
type MinerConfig struct { Start bool `mapstructure:"start"` Delay uint64 `mapstructure:"delay"` Name string `mapstructure:"name"` PrivateKeys []string `mapstructure:"private"` ExtraData string `mapstructure:"extra"` }
MinerConfig miner config
type SETService ¶
type SETService struct { APIBackend *APIBackend // contains filtered or unexported fields }
SETService implements the set service.
func New ¶
func New(ctx *node.ServiceContext, config *Config) (*SETService, error)
New creates a new setservice object (including the initialisation of the common setservice object)
func (*SETService) APIs ¶
func (fs *SETService) APIs() []rpc.API
APIs return the collection of RPC services the setservice package offers.
func (*SETService) BlockChain ¶
func (s *SETService) BlockChain() *blockchain.BlockChain
func (*SETService) ChainDb ¶
func (s *SETService) ChainDb() fdb.Database
func (*SETService) Engine ¶
func (s *SETService) Engine() consensus.IEngine
func (*SETService) GasPrice ¶
func (fs *SETService) GasPrice() *big.Int
func (*SETService) Protocols ¶
func (s *SETService) Protocols() []p2p.Protocol
func (*SETService) SetGasPrice ¶
func (fs *SETService) SetGasPrice(gasPrice *big.Int) bool
func (*SETService) Start ¶
func (fs *SETService) Start() error
Start implements node.Service, starting all internal goroutines.
func (*SETService) Stop ¶
func (fs *SETService) Stop() error
Stop implements node.Service, terminating all internal goroutine
func (*SETService) TxPool ¶
func (s *SETService) TxPool() *txpool.TxPool