mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
feat: expose additional ethapi servers (#245)
## Why this should be merged Required for SAE to support more of the required APIs. I left out the account and personal APIs, as we really shouldn't be managing any keys on the node. ## How this works Follows the same style that already existed. Additionally, copied the upstream description for the types. ## How this was tested Only local testing (although the prior functions were also not tested)
This commit is contained in:
parent
1ec8741af9
commit
749b6cefda
1 changed files with 25 additions and 3 deletions
|
|
@ -26,13 +26,25 @@ type (
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// BlockChainAPI exposes RPC methods for querying chain data.
|
// EthereumAPI provides an API to access Ethereum related information.
|
||||||
|
EthereumAPI = ethapi.EthereumAPI
|
||||||
|
// BlockChainAPI provides an API to access Ethereum blockchain data.
|
||||||
BlockChainAPI = ethapi.BlockChainAPI
|
BlockChainAPI = ethapi.BlockChainAPI
|
||||||
// TransactionAPI exposes RPC methods for querying and creating
|
// TransactionAPI exposes methods for reading and creating transaction data.
|
||||||
// transactions.
|
|
||||||
TransactionAPI = ethapi.TransactionAPI
|
TransactionAPI = ethapi.TransactionAPI
|
||||||
|
// TxPoolAPI offers and API for the transaction pool. It only operates on
|
||||||
|
// data that is non-confidential.
|
||||||
|
TxPoolAPI = ethapi.TxPoolAPI
|
||||||
|
// DebugAPI is the collection of Ethereum APIs exposed over the debugging
|
||||||
|
// namespace.
|
||||||
|
DebugAPI = ethapi.DebugAPI
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NewEthereumAPI is identical to [ethapi.NewEthereumAPI].
|
||||||
|
func NewEthereumAPI(b Backend) *EthereumAPI {
|
||||||
|
return ethapi.NewEthereumAPI(b)
|
||||||
|
}
|
||||||
|
|
||||||
// NewBlockChainAPI is identical to [ethapi.NewBlockChainAPI].
|
// NewBlockChainAPI is identical to [ethapi.NewBlockChainAPI].
|
||||||
func NewBlockChainAPI(b Backend) *BlockChainAPI {
|
func NewBlockChainAPI(b Backend) *BlockChainAPI {
|
||||||
return ethapi.NewBlockChainAPI(b)
|
return ethapi.NewBlockChainAPI(b)
|
||||||
|
|
@ -42,3 +54,13 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI {
|
||||||
func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI {
|
func NewTransactionAPI(b Backend, nonceLock *AddrLocker) *TransactionAPI {
|
||||||
return ethapi.NewTransactionAPI(b, nonceLock)
|
return ethapi.NewTransactionAPI(b, nonceLock)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewTxPoolAPI is identical to [ethapi.NewTxPoolAPI].
|
||||||
|
func NewTxPoolAPI(b Backend) *TxPoolAPI {
|
||||||
|
return ethapi.NewTxPoolAPI(b)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDebugAPI is identical to [ethapi.NewDebugAPI].
|
||||||
|
func NewDebugAPI(b Backend) *DebugAPI {
|
||||||
|
return ethapi.NewDebugAPI(b)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue