erigon-pulse/cmd/rpcdaemon/commands/net_api.go

28 lines
519 B
Go
Raw Normal View History

2020-08-17 15:27:29 +00:00
package commands
import (
"context"
"github.com/ledgerwatch/turbo-geth/common/hexutil"
2020-08-17 15:27:29 +00:00
"github.com/ledgerwatch/turbo-geth/ethdb"
)
type NetAPI interface {
Version(ctx context.Context) (string, error)
2020-08-17 15:27:29 +00:00
}
type NetAPIImpl struct {
ethBackend ethdb.Backend
}
// NwtNetAPIImpl returns NetAPIImplImpl instance
func NewNetAPIImpl(eth ethdb.Backend) *NetAPIImpl {
return &NetAPIImpl{
ethBackend: eth,
}
}
func (api *NetAPIImpl) PeerCount(_ context.Context) (hexutil.Uint, error) {
return hexutil.Uint(25), nil
}