2020-08-17 15:27:29 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-08-29 07:24:50 +00:00
|
|
|
"github.com/ledgerwatch/turbo-geth/common/hexutil"
|
2020-08-17 15:27:29 +00:00
|
|
|
|
|
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NetAPI interface {
|
2020-08-18 17:22:49 +00:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
2020-08-29 07:24:50 +00:00
|
|
|
|
|
|
|
func (api *NetAPIImpl) PeerCount(_ context.Context) (hexutil.Uint, error) {
|
|
|
|
return hexutil.Uint(25), nil
|
|
|
|
}
|