mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
This reverts commit 00415eee76
.
This commit is contained in:
parent
00415eee76
commit
5b4445ecea
@ -79,9 +79,9 @@ The following table shows the current implementation status of turbo-geth's RPC
|
||||
| web3_clientVersion | Yes | |
|
||||
| web3_sha3 | Yes | |
|
||||
| | | |
|
||||
| net_listening | HC | (remote only hard coded returns true) |
|
||||
| net_listening | HC | (hard coded returns true) |
|
||||
| net_peerCount | HC | (hard coded 25 - work continues on Sentry) |
|
||||
| net_version | Yes | remote only |
|
||||
| net_version | Yes | |
|
||||
| | | |
|
||||
| eth_blockNumber | Yes | |
|
||||
| eth_chainID | Yes | |
|
||||
@ -119,10 +119,10 @@ The following table shows the current implementation status of turbo-geth's RPC
|
||||
| eth_getFilterChanges | - | |
|
||||
| eth_getFilterLogs | - | |
|
||||
| eth_uninstallFilter | - | |
|
||||
| eth_getLogs | Yes | remote only |
|
||||
| eth_getLogs | Yes | |
|
||||
| | | |
|
||||
| eth_accounts | - | |
|
||||
| eth_sendRawTransaction | Yes | remote only |
|
||||
| eth_sendRawTransaction | Yes | |
|
||||
| eth_sendTransaction | - | |
|
||||
| eth_sign | - | |
|
||||
| eth_signTransaction | - | |
|
||||
|
@ -2,16 +2,11 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/ledgerwatch/turbo-geth/common"
|
||||
)
|
||||
|
||||
// Coinbase is the address that mining rewards will be sent to
|
||||
// Etherbase is the address that mining rewards will be send to
|
||||
func (api *APIImpl) Coinbase(_ context.Context) (common.Address, error) {
|
||||
if api.ethBackend == nil {
|
||||
// We're running in --chaindata mode or otherwise cannot get the backend
|
||||
return common.Address{}, fmt.Errorf(NotAvailableChainData, "eth_coinbase")
|
||||
}
|
||||
return api.ethBackend.Etherbase()
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ func (api *PrivateDebugAPIImpl) AccountRange(ctx context.Context, blockNrOrHash
|
||||
|
||||
blockNumber, _, err = stages.GetStageProgress(api.dbReader, stages.Execution)
|
||||
if err != nil {
|
||||
return state.IteratorDump{}, fmt.Errorf("last block has not found: %w", err)
|
||||
return state.IteratorDump{}, fmt.Errorf("las block has not found: %w", err)
|
||||
}
|
||||
} else {
|
||||
blockNumber = uint64(number)
|
||||
|
@ -1,7 +0,0 @@
|
||||
package commands
|
||||
|
||||
// NotImplemented is the URI prefix for smartcard wallets.
|
||||
const NotImplemented = "the function %s is currently not implemented"
|
||||
|
||||
// NotAvailableChainData x
|
||||
const NotAvailableChainData = "the function %s is not available, please use --private.api.addr option instead of --chaindata option"
|
@ -259,11 +259,6 @@ func (f *Filter) Logs(ctx context.Context, api *APIImpl) ([]*types.Log, error) {
|
||||
end = latest
|
||||
}
|
||||
|
||||
if api.ethBackend == nil {
|
||||
// We're running in --chaindata mode or otherwise cannot get the backend
|
||||
return nil, fmt.Errorf(NotAvailableChainData, "eth_getLogs")
|
||||
}
|
||||
|
||||
// Gather all indexed logs, and finish with non indexed ones
|
||||
var logs []*types.Log
|
||||
size, sections, _ := api.ethBackend.BloomStatus()
|
||||
|
@ -2,7 +2,6 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/ledgerwatch/turbo-geth/common/hexutil"
|
||||
@ -10,26 +9,24 @@ import (
|
||||
"github.com/ledgerwatch/turbo-geth/ethdb"
|
||||
)
|
||||
|
||||
// NetAPI the interface for the net_ RPC commands
|
||||
type NetAPI interface {
|
||||
Listening(_ context.Context) (bool, error)
|
||||
Version(_ context.Context) (string, error)
|
||||
PeerCount(_ context.Context) (hexutil.Uint, error)
|
||||
}
|
||||
|
||||
// NetAPIImpl data structure to store things needed for net_ commands
|
||||
type NetAPIImpl struct {
|
||||
ethBackend ethdb.Backend
|
||||
}
|
||||
|
||||
// NewNetAPIImpl returns NetAPIImplImpl instance
|
||||
// NewtNetAPIImpl returns NetAPIImplImpl instance
|
||||
func NewNetAPIImpl(eth ethdb.Backend) *NetAPIImpl {
|
||||
return &NetAPIImpl{
|
||||
ethBackend: eth,
|
||||
}
|
||||
}
|
||||
|
||||
// Listening implements RPC call for net_listening
|
||||
// Listen implements RPC call for net_listening
|
||||
// TODO(tjayrush) remove hard coded value
|
||||
func (api *NetAPIImpl) Listening(_ context.Context) (bool, error) {
|
||||
return true, nil
|
||||
@ -37,16 +34,10 @@ func (api *NetAPIImpl) Listening(_ context.Context) (bool, error) {
|
||||
|
||||
// Version implements RPC call for net_version
|
||||
func (api *NetAPIImpl) Version(_ context.Context) (string, error) {
|
||||
if api.ethBackend == nil {
|
||||
// We're running in --chaindata mode or otherwise cannot get the backend
|
||||
return "", fmt.Errorf(NotAvailableChainData, "net_version")
|
||||
}
|
||||
|
||||
res, err := api.ethBackend.NetVersion()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strconv.FormatUint(res, 10), nil
|
||||
}
|
||||
|
||||
|
@ -2,18 +2,12 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/ledgerwatch/turbo-geth/common"
|
||||
"github.com/ledgerwatch/turbo-geth/common/hexutil"
|
||||
)
|
||||
|
||||
// SendRawTransaction send a raw transaction
|
||||
func (api *APIImpl) SendRawTransaction(_ context.Context, encodedTx hexutil.Bytes) (common.Hash, error) {
|
||||
if api.ethBackend == nil {
|
||||
// We're running in --chaindata mode or otherwise cannot get the backend
|
||||
return common.Hash{}, fmt.Errorf(NotAvailableChainData, "eth_sendRawTransaction")
|
||||
}
|
||||
res, err := api.ethBackend.AddLocal(encodedTx)
|
||||
return common.BytesToHash(res), err
|
||||
}
|
||||
|
@ -21,29 +21,29 @@ type CallParams []CallParam
|
||||
// Call Implements trace_call
|
||||
func (api *TraceAPIImpl) Call(ctx context.Context, call CallParam, blockNr rpc.BlockNumber) ([]interface{}, error) {
|
||||
var stub []interface{}
|
||||
return stub, fmt.Errorf(NotImplemented, "trace_call")
|
||||
return stub, fmt.Errorf("function trace_call not implemented")
|
||||
}
|
||||
|
||||
// CallMany Implements trace_call
|
||||
func (api *TraceAPIImpl) CallMany(ctx context.Context, calls CallParams) ([]interface{}, error) {
|
||||
var stub []interface{}
|
||||
return stub, fmt.Errorf(NotImplemented, "trace_callMany")
|
||||
return stub, fmt.Errorf("function trace_callMany not implemented")
|
||||
}
|
||||
|
||||
// RawTransaction Implements trace_rawtransaction
|
||||
func (api *TraceAPIImpl) RawTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error) {
|
||||
var stub []interface{}
|
||||
return stub, fmt.Errorf(NotImplemented, "trace_rawTransaction")
|
||||
return stub, fmt.Errorf("function trace_rawTransaction not implemented")
|
||||
}
|
||||
|
||||
// ReplayBlockTransactions Implements trace_replayBlockTransactions
|
||||
func (api *TraceAPIImpl) ReplayBlockTransactions(ctx context.Context, blockNr rpc.BlockNumber, traceTypes []string) ([]interface{}, error) {
|
||||
var stub []interface{}
|
||||
return stub, fmt.Errorf(NotImplemented, "trace_replayBlockTransactions")
|
||||
return stub, fmt.Errorf("function trace_replayBlockTransactions not implemented")
|
||||
}
|
||||
|
||||
// ReplayTransaction Implements trace_replaytransactions
|
||||
func (api *TraceAPIImpl) ReplayTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error) {
|
||||
var stub []interface{}
|
||||
return stub, fmt.Errorf(NotImplemented, "trace_replayTransaction")
|
||||
return stub, fmt.Errorf("function trace_replayTransaction not implemented")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user