-
Notifications
You must be signed in to change notification settings - Fork 21.4k
all: Remove concept of public/private API definitions #25053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8b7baca
internal/ethapi: rename PublicEthereumAPI to EthereumAPI
lightclient a9f9a2f
eth: rename PublicEthereumAPI to EthereumAPI
lightclient d40399b
internal/ethapi: rename PublicTxPoolAPI to TxPoolAPI
lightclient 899db59
internal/ethapi: rename PublicAccountAPI to EthereumAccountAPI
lightclient f74f8b5
internal/ethapi: rename PrivateAccountAPI to PersonalAccountAPI
lightclient 7aa2e2c
internal/ethapi: rename PublicBlockChainAPI to BlockChainAPI
lightclient 9af7f6d
internal/ethapi: rename PublicTransactionPoolAPI to TransactionAPI
lightclient 0273b2b
internal/ethapi: rename PublicDebugAPI to DebugAPI
lightclient 5438d2b
internal/ethapi: move PrivateDebugAPI methods to DebugAPI
lightclient 5453a42
internal/ethapi: rename PublicNetAPI to NetAPI
lightclient 2a54c74
les: rename PrivateLightServerAPI to LightServerAPI
lightclient 0505b75
les: rename PrivateLightAPI to LightAPI
lightclient 1bb4e33
les: rename PrivateDebugAPI to DebugAPI
lightclient 4838391
les: rename PublicDownloaderAPI to DownloaderAPI
lightclient d410bc1
eth,les: rename PublicFilterAPI to FilterAPI
lightclient b8bc2f9
eth: rename PublicMinerAPI to MinerAPI
lightclient 7d58223
eth: rename PublicDownloaderAPI to DownloaderAPI
lightclient adb16f1
eth: move PrivateMinerAPI methods to MinerAPI
lightclient b164625
eth: rename PrivateAdminAPI to AdminAPI
lightclient c6e7d12
eth: rename PublicDebugAPI to DebugAPI
lightclient d062dbf
eth: move PrivateDebugAPI methods to DebugAPI
lightclient 105c887
node: rename publicAdminAPI to adminAPI
lightclient 784aa64
node: move privateAdminAPI methods to adminAPI
lightclient 52b782d
node: rename publicWeb3API to web3API
lightclient 0030c7e
eth,internal/ethapi: sync comments with previous renamings
lightclient File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ type Ethereum struct { | |
etherbase common.Address | ||
|
||
networkID uint64 | ||
netRPCService *ethapi.PublicNetAPI | ||
netRPCService *ethapi.NetAPI | ||
|
||
p2pServer *p2p.Server | ||
|
||
|
@@ -266,7 +266,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { | |
} | ||
|
||
// Start the RPC service | ||
eth.netRPCService = ethapi.NewPublicNetAPI(eth.p2pServer, config.NetworkId) | ||
eth.netRPCService = ethapi.NewNetAPI(eth.p2pServer, config.NetworkId) | ||
|
||
// Register the backend on the node | ||
stack.RegisterAPIs(eth.APIs()) | ||
|
@@ -309,41 +309,32 @@ func (s *Ethereum) APIs() []rpc.API { | |
{ | ||
Namespace: "eth", | ||
Version: "1.0", | ||
Service: NewPublicEthereumAPI(s), | ||
Service: NewEthereumAPI(s), | ||
Public: true, | ||
}, { | ||
Namespace: "eth", | ||
Namespace: "miner", | ||
|
||
Version: "1.0", | ||
Service: NewPublicMinerAPI(s), | ||
Service: NewMinerAPI(s), | ||
Public: true, | ||
}, { | ||
Namespace: "eth", | ||
Version: "1.0", | ||
Service: downloader.NewPublicDownloaderAPI(s.handler.downloader, s.eventMux), | ||
Service: downloader.NewDownloaderAPI(s.handler.downloader, s.eventMux), | ||
Public: true, | ||
}, { | ||
Namespace: "miner", | ||
Version: "1.0", | ||
Service: NewPrivateMinerAPI(s), | ||
Public: false, | ||
}, { | ||
Namespace: "eth", | ||
Version: "1.0", | ||
Service: filters.NewPublicFilterAPI(s.APIBackend, false, 5*time.Minute), | ||
Service: filters.NewFilterAPI(s.APIBackend, false, 5*time.Minute), | ||
Public: true, | ||
}, { | ||
Namespace: "admin", | ||
Version: "1.0", | ||
Service: NewPrivateAdminAPI(s), | ||
Service: NewAdminAPI(s), | ||
}, { | ||
Namespace: "debug", | ||
Version: "1.0", | ||
Service: NewPublicDebugAPI(s), | ||
Service: NewDebugAPI(s), | ||
Public: true, | ||
}, { | ||
Namespace: "debug", | ||
Version: "1.0", | ||
Service: NewPrivateDebugAPI(s), | ||
}, { | ||
Namespace: "net", | ||
Version: "1.0", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be on the
MinerAPI
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's currently defined here as part of
PublicMinerAPI
, however, this api is actually exposed under theeth
namespace.This PR takes all the
PrivateMinerAPI
methods and puts them under the nameMinerAPI
and exposed them underminer
namespace. If I added this method toMinerAPI
it would no longer be exposed undereth
, so I think this is the simplest solution.