all: remove version field from rpc.API

pull/25096/head
lightclient@protonmail.com 2 years ago
parent 119f955686
commit 0c6f81f888
No known key found for this signature in database
GPG Key ID: 75C916AFEE20183E
  1. 2
      cmd/clef/main.go
  2. 1
      consensus/clique/clique.go
  3. 2
      consensus/ethash/ethash.go
  4. 7
      eth/backend.go
  5. 1
      eth/catalyst/api.go
  6. 1
      eth/tracers/api.go
  7. 7
      internal/ethapi/backend.go
  8. 1
      les/catalyst/api.go
  9. 6
      les/client.go
  10. 3
      les/server.go
  11. 3
      node/api.go
  12. 3
      node/utils_test.go
  13. 1
      p2p/simulations/adapters/exec.go
  14. 2
      rpc/types.go

@ -648,7 +648,7 @@ func signer(c *cli.Context) error {
{ {
Namespace: "account", Namespace: "account",
Service: api, Service: api,
Version: "1.0"}, },
} }
if c.GlobalBool(utils.HTTPEnabledFlag.Name) { if c.GlobalBool(utils.HTTPEnabledFlag.Name) {
vhosts := utils.SplitAndTrim(c.GlobalString(utils.HTTPVirtualHostsFlag.Name)) vhosts := utils.SplitAndTrim(c.GlobalString(utils.HTTPVirtualHostsFlag.Name))

@ -697,7 +697,6 @@ func (c *Clique) Close() error {
func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API { func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API {
return []rpc.API{{ return []rpc.API{{
Namespace: "clique", Namespace: "clique",
Version: "1.0",
Service: &API{chain: chain, clique: c}, Service: &API{chain: chain, clique: c},
}} }}
} }

@ -678,12 +678,10 @@ func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: &API{ethash}, Service: &API{ethash},
}, },
{ {
Namespace: "ethash", Namespace: "ethash",
Version: "1.0",
Service: &API{ethash}, Service: &API{ethash},
}, },
} }

@ -308,31 +308,24 @@ func (s *Ethereum) APIs() []rpc.API {
return append(apis, []rpc.API{ return append(apis, []rpc.API{
{ {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: NewEthereumAPI(s), Service: NewEthereumAPI(s),
}, { }, {
Namespace: "miner", Namespace: "miner",
Version: "1.0",
Service: NewMinerAPI(s), Service: NewMinerAPI(s),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux), Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: filters.NewFilterAPI(s.APIBackend, false, 5*time.Minute), Service: filters.NewFilterAPI(s.APIBackend, false, 5*time.Minute),
}, { }, {
Namespace: "admin", Namespace: "admin",
Version: "1.0",
Service: NewAdminAPI(s), Service: NewAdminAPI(s),
}, { }, {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
Service: NewDebugAPI(s), Service: NewDebugAPI(s),
}, { }, {
Namespace: "net", Namespace: "net",
Version: "1.0",
Service: s.netRPCService, Service: s.netRPCService,
}, },
}...) }...)

@ -42,7 +42,6 @@ func Register(stack *node.Node, backend *eth.Ethereum) error {
stack.RegisterAPIs([]rpc.API{ stack.RegisterAPIs([]rpc.API{
{ {
Namespace: "engine", Namespace: "engine",
Version: "1.0",
Service: NewConsensusAPI(backend), Service: NewConsensusAPI(backend),
Authenticated: true, Authenticated: true,
}, },

@ -918,7 +918,6 @@ func APIs(backend Backend) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
Service: NewAPI(backend), Service: NewAPI(backend),
}, },
} }

@ -101,31 +101,24 @@ func GetAPIs(apiBackend Backend) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: NewEthereumAPI(apiBackend), Service: NewEthereumAPI(apiBackend),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: NewBlockChainAPI(apiBackend), Service: NewBlockChainAPI(apiBackend),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: NewTransactionAPI(apiBackend, nonceLock), Service: NewTransactionAPI(apiBackend, nonceLock),
}, { }, {
Namespace: "txpool", Namespace: "txpool",
Version: "1.0",
Service: NewTxPoolAPI(apiBackend), Service: NewTxPoolAPI(apiBackend),
}, { }, {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
Service: NewDebugAPI(apiBackend), Service: NewDebugAPI(apiBackend),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: NewEthereumAccountAPI(apiBackend.AccountManager()), Service: NewEthereumAccountAPI(apiBackend.AccountManager()),
}, { }, {
Namespace: "personal", Namespace: "personal",
Version: "1.0",
Service: NewPersonalAccountAPI(apiBackend, nonceLock), Service: NewPersonalAccountAPI(apiBackend, nonceLock),
}, },
} }

@ -35,7 +35,6 @@ func Register(stack *node.Node, backend *les.LightEthereum) error {
stack.RegisterAPIs([]rpc.API{ stack.RegisterAPIs([]rpc.API{
{ {
Namespace: "engine", Namespace: "engine",
Version: "1.0",
Service: NewConsensusAPI(backend), Service: NewConsensusAPI(backend),
Authenticated: true, Authenticated: true,
}, },

@ -294,27 +294,21 @@ func (s *LightEthereum) APIs() []rpc.API {
return append(apis, []rpc.API{ return append(apis, []rpc.API{
{ {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: &LightDummyAPI{}, Service: &LightDummyAPI{},
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux), Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux),
}, { }, {
Namespace: "eth", Namespace: "eth",
Version: "1.0",
Service: filters.NewFilterAPI(s.ApiBackend, true, 5*time.Minute), Service: filters.NewFilterAPI(s.ApiBackend, true, 5*time.Minute),
}, { }, {
Namespace: "net", Namespace: "net",
Version: "1.0",
Service: s.netRPCService, Service: s.netRPCService,
}, { }, {
Namespace: "les", Namespace: "les",
Version: "1.0",
Service: NewLightAPI(&s.lesCommons), Service: NewLightAPI(&s.lesCommons),
}, { }, {
Namespace: "vflux", Namespace: "vflux",
Version: "1.0",
Service: s.serverPool.API(), Service: s.serverPool.API(),
}, },
}...) }...)

@ -159,17 +159,14 @@ func (s *LesServer) APIs() []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "les", Namespace: "les",
Version: "1.0",
Service: NewLightAPI(&s.lesCommons), Service: NewLightAPI(&s.lesCommons),
}, },
{ {
Namespace: "les", Namespace: "les",
Version: "1.0",
Service: NewLightServerAPI(s), Service: NewLightServerAPI(s),
}, },
{ {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
Service: NewDebugAPI(s), Service: NewDebugAPI(s),
}, },
} }

@ -35,15 +35,12 @@ func (n *Node) apis() []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "admin", Namespace: "admin",
Version: "1.0",
Service: &adminAPI{n}, Service: &adminAPI{n},
}, { }, {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
Service: debug.Handler, Service: debug.Handler,
}, { }, {
Namespace: "web3", Namespace: "web3",
Version: "1.0",
Service: &web3API{n}, Service: &web3API{n},
}, },
} }

@ -95,15 +95,12 @@ func (f *FullService) APIs() []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: "admin", Namespace: "admin",
Version: "1.0",
}, },
{ {
Namespace: "debug", Namespace: "debug",
Version: "1.0",
}, },
{ {
Namespace: "net", Namespace: "net",
Version: "1.0",
}, },
} }
} }

@ -501,7 +501,6 @@ func startExecNodeStack() (*node.Node, error) {
// Add the snapshot API. // Add the snapshot API.
stack.RegisterAPIs([]rpc.API{{ stack.RegisterAPIs([]rpc.API{{
Namespace: "simulation", Namespace: "simulation",
Version: "1.0",
Service: SnapshotAPI{services}, Service: SnapshotAPI{services},
}}) }})

@ -31,7 +31,7 @@ import (
// API describes the set of methods offered over the RPC interface // API describes the set of methods offered over the RPC interface
type API struct { type API struct {
Namespace string // namespace under which the rpc methods of Service are exposed Namespace string // namespace under which the rpc methods of Service are exposed
Version string // api version for DApp's Version string // deprecated - this field is no longer used, but retained for compatibility
Service interface{} // receiver instance which holds the methods Service interface{} // receiver instance which holds the methods
Public bool // deprecated - this field is no longer used, but retained for compatibility Public bool // deprecated - this field is no longer used, but retained for compatibility
Authenticated bool // whether the api should only be available behind authentication. Authenticated bool // whether the api should only be available behind authentication.

Loading…
Cancel
Save