mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-08 13:03:47 +00:00
More cleanup
This commit is contained in:
parent
71bb7157d0
commit
bbdd7efcff
2 changed files with 4 additions and 7 deletions
|
|
@ -71,17 +71,15 @@ type backend interface {
|
||||||
GetTd(ctx context.Context, hash common.Hash) *big.Int
|
GetTd(ctx context.Context, hash common.Hash) *big.Int
|
||||||
Stats() (pending int, queued int)
|
Stats() (pending int, queued int)
|
||||||
SyncProgress() ethereum.SyncProgress
|
SyncProgress() ethereum.SyncProgress
|
||||||
}
|
|
||||||
|
|
||||||
type extendedBackend interface {
|
// Bor
|
||||||
backend
|
|
||||||
SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription
|
SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription
|
||||||
}
|
}
|
||||||
|
|
||||||
// fullNodeBackend encompasses the functionality necessary for a full node
|
// fullNodeBackend encompasses the functionality necessary for a full node
|
||||||
// reporting to ethstats
|
// reporting to ethstats
|
||||||
type fullNodeBackend interface {
|
type fullNodeBackend interface {
|
||||||
extendedBackend
|
backend
|
||||||
Miner() *miner.Miner
|
Miner() *miner.Miner
|
||||||
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
|
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
|
||||||
CurrentBlock() *types.Block
|
CurrentBlock() *types.Block
|
||||||
|
|
@ -92,7 +90,7 @@ type fullNodeBackend interface {
|
||||||
// chain statistics up to a monitoring server.
|
// chain statistics up to a monitoring server.
|
||||||
type Service struct {
|
type Service struct {
|
||||||
server *p2p.Server // Peer-to-peer server to retrieve networking infos
|
server *p2p.Server // Peer-to-peer server to retrieve networking infos
|
||||||
backend extendedBackend
|
backend backend
|
||||||
engine consensus.Engine // Consensus engine to retrieve variadic block fields
|
engine consensus.Engine // Consensus engine to retrieve variadic block fields
|
||||||
|
|
||||||
node string // Name of the node to display on the monitoring page
|
node string // Name of the node to display on the monitoring page
|
||||||
|
|
@ -179,7 +177,7 @@ func parseEthstatsURL(url string) (parts []string, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a monitoring service ready for stats reporting.
|
// New returns a monitoring service ready for stats reporting.
|
||||||
func New(node *node.Node, backend extendedBackend, engine consensus.Engine, url string) error {
|
func New(node *node.Node, backend backend, engine consensus.Engine, url string) error {
|
||||||
parts, err := parseEthstatsURL(url)
|
parts, err := parseEthstatsURL(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ type Backend interface {
|
||||||
GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error)
|
GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error)
|
||||||
GetBorBlockTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)
|
GetBorBlockTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)
|
||||||
GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)
|
GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)
|
||||||
|
|
||||||
SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription
|
SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription
|
||||||
|
|
||||||
ChainConfig() *params.ChainConfig
|
ChainConfig() *params.ChainConfig
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue