parent
955314d1db
commit
e993a583d2
@ -0,0 +1,26 @@ |
|||||||
|
package rpc |
||||||
|
|
||||||
|
import ( |
||||||
|
"context" |
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/rpc" |
||||||
|
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" |
||||||
|
) |
||||||
|
|
||||||
|
// PublicWeb3Service offers web3 related RPC methods
|
||||||
|
type PublicWeb3Service struct{} |
||||||
|
|
||||||
|
// NewPublicWeb3API creates a new web3 API instance.
|
||||||
|
func NewPublicWeb3API() rpc.API { |
||||||
|
return rpc.API{ |
||||||
|
Namespace: web3Namespace, |
||||||
|
Version: APIVersion, |
||||||
|
Service: &PublicWeb3Service{}, |
||||||
|
Public: true, |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// ClientVersion - returns the current client version of the running node
|
||||||
|
func (s *PublicWeb3Service) ClientVersion(ctx context.Context) interface{} { |
||||||
|
return nodeconfig.GetVersion() |
||||||
|
} |
Loading…
Reference in new issue