|
|
@ -6,6 +6,7 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil" |
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil" |
|
|
|
"github.com/harmony-one/harmony/api/proto" |
|
|
|
"github.com/harmony-one/harmony/api/proto" |
|
|
|
|
|
|
|
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// PublicHarmonyAPI provides an API to access Harmony related information.
|
|
|
|
// PublicHarmonyAPI provides an API to access Harmony related information.
|
|
|
@ -41,3 +42,18 @@ func (s *PublicHarmonyAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { |
|
|
|
// TODO(ricl): add SuggestPrice API
|
|
|
|
// TODO(ricl): add SuggestPrice API
|
|
|
|
return (*hexutil.Big)(big.NewInt(1)), nil |
|
|
|
return (*hexutil.Big)(big.NewInt(1)), nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type NodeMetadata struct { |
|
|
|
|
|
|
|
BLSPublicKey string `json:"blskey"` |
|
|
|
|
|
|
|
Version string `json:"version"` |
|
|
|
|
|
|
|
NetworkType string `json:"network"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (s *PublicHarmonyAPI) GetNodeMetadata() NodeMetadata { |
|
|
|
|
|
|
|
cfg := nodeconfig.GetDefaultConfig() |
|
|
|
|
|
|
|
return NodeMetadata{ |
|
|
|
|
|
|
|
cfg.ConsensusPubKey.SerializeToHexStr(), |
|
|
|
|
|
|
|
nodeconfig.GetVersion(), |
|
|
|
|
|
|
|
string(cfg.GetNetworkType()), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|