2019-07-15 14:13:59 +00:00
|
|
|
// Package rpc contains RPC handler methods and utilities to start
|
|
|
|
// Ethermint's Web3-compatibly JSON-RPC server.
|
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/context"
|
2019-09-18 18:45:21 +00:00
|
|
|
emintcrypto "github.com/cosmos/ethermint/crypto"
|
2019-07-15 14:13:59 +00:00
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
// GetRPCAPIs returns the list of all APIs
|
2019-09-18 18:45:21 +00:00
|
|
|
func GetRPCAPIs(cliCtx context.CLIContext, key emintcrypto.PrivKeySecp256k1) []rpc.API {
|
2019-09-20 13:30:20 +00:00
|
|
|
nonceLock := new(AddrLocker)
|
2019-07-15 14:13:59 +00:00
|
|
|
return []rpc.API{
|
|
|
|
{
|
|
|
|
Namespace: "web3",
|
|
|
|
Version: "1.0",
|
|
|
|
Service: NewPublicWeb3API(),
|
2019-09-18 18:45:21 +00:00
|
|
|
Public: true,
|
2019-07-15 14:13:59 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
Namespace: "eth",
|
|
|
|
Version: "1.0",
|
2019-09-20 13:30:20 +00:00
|
|
|
Service: NewPublicEthAPI(cliCtx, nonceLock, key),
|
2019-09-18 18:45:21 +00:00
|
|
|
Public: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Namespace: "personal",
|
|
|
|
Version: "1.0",
|
2019-09-20 13:30:20 +00:00
|
|
|
Service: NewPersonalEthAPI(cliCtx, nonceLock),
|
2019-09-18 18:45:21 +00:00
|
|
|
Public: false,
|
2019-07-15 14:13:59 +00:00
|
|
|
},
|
2019-10-08 03:32:28 +00:00
|
|
|
{
|
|
|
|
Namespace: "eth",
|
|
|
|
Version: "1.0",
|
|
|
|
Service: NewPublicFilterAPI(cliCtx),
|
|
|
|
Public: true,
|
|
|
|
},
|
2019-10-15 01:20:35 +00:00
|
|
|
{
|
|
|
|
Namespace: "net",
|
|
|
|
Version: "1.0",
|
|
|
|
Service: NewPublicNetAPI(cliCtx),
|
|
|
|
Public: true,
|
|
|
|
},
|
2019-07-15 14:13:59 +00:00
|
|
|
}
|
|
|
|
}
|