{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package eth\n\nPackage eth implements the Ethereum protocol.\n\n## Constants\n\n```go\nconst AccountRangeMaxResults = 256\n```\nAccountRangeMaxResults is the maximum number of results to be returned per call\n\n## Types\n\n```go\ntype BadBlockArgs struct {\n\tHash  common.Hash            `json:\"hash\"`\n\tBlock map[string]interface{} `json:\"block\"`\n\tRLP   string                 `json:\"rlp\"`\n}\n```\nBadBlockArgs represents the entries in the list returned when bad blocks are queried.\n\n```go\ntype Config = ethconfig.Config\n```\nConfig contains the configuration options of the ETH protocol. Deprecated: use ethconfig.Config instead.\n\n```go\ntype EthAPIBackend struct {\n\t// contains filtered or unexported fields\n}\n```\nEthAPIBackend implements ethapi.Backend for full nodes\n\n```go\nfunc (b *EthAPIBackend) AccountManager() *accounts.Manager\n```\n\n```go\nfunc (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\n\n```go\nfunc (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)\n```\n\n```go\nfunc (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)\n```\n\n```go\nfunc (b *EthAPIBackend) BloomStatus() (uint64, uint64)\n```\n\n```go\nfunc (b *EthAPIBackend) ChainConfig() *params.ChainConfig\n```\nChainConfig returns the active chain configuration.\n\n```go\nfunc (b *EthAPIBackend) ChainDb() ethdb.Database\n```\n\n```go\nfunc (b *EthAPIBackend) CurrentBlock() *types.Block\n```\n\n```go\nfunc (b *EthAPIBackend) CurrentHeader() *types.Header\n```\n\n```go\nfunc (b *EthAPIBackend) Engine() consensus.Engine\n```\n\n```go\nfunc (b *EthAPIBackend) EventMux() *event.TypeMux\n```\n\n```go\nfunc (b *EthAPIBackend) ExtRPCEnabled() bool\n```\n\n```go\nfunc (b *EthAPIBackend) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (firstBlock *big.Int, reward [][]*big.Int, baseFee []*big.Int, gasUsedRatio []float64, err error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction\n```\n\n```go\nfunc (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)\n```\n\n```go\nfunc (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int\n```\n\n```go\nfunc (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error)\n```\n\n```go\nfunc (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)\n```\n\n```go\nfunc (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)\n```\n\n```go\nfunc (b *EthAPIBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)\n```\n\n```go\nfunc (b *EthAPIBackend) Miner() *miner.Miner\n```\n\n```go\nfunc (b *EthAPIBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts)\n```\n\n```go\nfunc (b *EthAPIBackend) RPCEVMTimeout() time.Duration\n```\n\n```go\nfunc (b *EthAPIBackend) RPCGasCap() uint64\n```\n\n```go\nfunc (b *EthAPIBackend) RPCTxFeeCap() float64\n```\n\n```go\nfunc (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error\n```\n\n```go\nfunc (b *EthAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)\n```\n\n```go\nfunc (b *EthAPIBackend) SetHead(number uint64)\n```\n\n```go\nfunc (b *EthAPIBackend) StartMining(threads int) error\n```\n\n```go\nfunc (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)\n```\n\n```go\nfunc (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)\n```\n\n```go\nfunc (b *EthAPIBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, checkLive, preferDisk bool) (*state.StateDB, error)\n```\n\n```go\nfunc (b *EthAPIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, error)\n```\n\n```go\nfunc (b *EthAPIBackend) Stats() (pending int, queued int)\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeChainEvent(ch chan\u003c- core.ChainEvent) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeChainHeadEvent(ch chan\u003c- core.ChainHeadEvent) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeChainSideEvent(ch chan\u003c- core.ChainSideEvent) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeLogsEvent(ch chan\u003c- []*types.Log) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan\u003c- core.NewTxsEvent) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribePendingLogsEvent(ch chan\u003c- []*types.Log) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan\u003c- core.RemovedLogsEvent) event.Subscription\n```\n\n```go\nfunc (b *EthAPIBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error)\n```\n\n```go\nfunc (b *EthAPIBackend) SyncProgress() ethereum.SyncProgress\n```\n\n```go\nfunc (b *EthAPIBackend) TxPool() *core.TxPool\n```\n\n```go\nfunc (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)\n```\n\n```go\nfunc (b *EthAPIBackend) TxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions)\n```\n\n```go\nfunc (b *EthAPIBackend) UnprotectedAllowed() bool\n```\n\n```go\ntype Ethereum struct {\n\tAPIBackend *EthAPIBackend\n\t// contains filtered or unexported fields\n}\n```\nEthereum implements the Ethereum full node service.\n\n```go\nfunc New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error)\n```\nNew creates a new Ethereum object (including the initialisation of the common Ethereum object)\n\n```go\nfunc (s *Ethereum) APIs() []rpc.API\n```\nAPIs return the collection of RPC services the ethereum package offers. NOTE, some of these services probably need to be moved to somewhere else.\n\n```go\nfunc (s *Ethereum) AccountManager() *accounts.Manager\n```\n\n```go\nfunc (s *Ethereum) ArchiveMode() bool\n```\n\n```go\nfunc (s *Ethereum) BlockChain() *core.BlockChain\n```\n\n```go\nfunc (s *Ethereum) BloomIndexer() *core.ChainIndexer\n```\n\n```go\nfunc (s *Ethereum) ChainDb() ethdb.Database\n```\n\n```go\nfunc (s *Ethereum) Downloader() *downloader.Downloader\n```\n\n```go\nfunc (s *Ethereum) Engine() consensus.Engine\n```\n\n```go\nfunc (s *Ethereum) Etherbase() (eb common.Address, err error)\n```\n\n```go\nfunc (s *Ethereum) EventMux() *event.TypeMux\n```\n\n```go\nfunc (s *Ethereum) IsListening() bool\n```\n\n```go\nfunc (s *Ethereum) IsMining() bool\n```\n\n```go\nfunc (s *Ethereum) Merger() *consensus.Merger\n```\n\n```go\nfunc (s *Ethereum) Miner() *miner.Miner\n```\n\n```go\nfunc (s *Ethereum) Protocols() []p2p.Protocol\n```\nProtocols returns all the currently configured network protocols to start.\n\n```go\nfunc (s *Ethereum) ResetWithGenesisBlock(gb *types.Block)\n```\n\n```go\nfunc (s *Ethereum) SetEtherbase(etherbase common.Address)\n```\nSetEtherbase sets the mining reward address.\n\n```go\nfunc (s *Ethereum) SetSynced()\n```\n\n```go\nfunc (s *Ethereum) Start() error\n```\nStart implements node.Lifecycle, starting all internal goroutines needed by the Ethereum protocol implementation.\n\n```go\nfunc (s *Ethereum) StartMining(threads int) error\n```\nStartMining starts the miner with the given number of CPU threads. If mining is already running, this method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.\n\n```go\nfunc (eth *Ethereum) StateAtBlock(block *types.Block, reexec uint64, base *state.StateDB, checkLive bool, preferDisk bool) (statedb *state.StateDB, err error)\n```\nStateAtBlock retrieves the state database associated with a certain block. If no state is locally available for the given block, a number of blocks are attempted to be reexecuted to generate the desired state. The optional base layer statedb can be passed then it's regarded as the statedb of the parent block. Parameters:\n\n  - block: The block for which we want the state (== state at the stateRoot of the parent)\n  - reexec: The maximum number of blocks to reprocess trying to obtain the desired state\n  - base: If the caller is tracing multiple blocks, the caller can provide the parent state continuously from the callsite.\n  - checklive: if true, then the live 'blockchain' state database is used. If the caller want to perform Commit or other 'save-to-disk' changes, this should be set to false to avoid storing trash persistently\n  - preferDisk: this arg can be used by the caller to signal that even though the 'base' is provided, it would be preferrable to start from a fresh state, if we have it on disk.\n\n```go\nfunc (s *Ethereum) Stop() error\n```\nStop implements node.Lifecycle, terminating all internal goroutines used by the Ethereum protocol.\n\n```go\nfunc (s *Ethereum) StopMining()\n```\nStopMining terminates the miner, both at the consensus engine level as well as at the block creation level.\n\n```go\nfunc (s *Ethereum) SyncMode() downloader.SyncMode\n```\n\n```go\nfunc (s *Ethereum) Synced() bool\n```\n\n```go\nfunc (s *Ethereum) TxPool() *core.TxPool\n```\n\n```go\ntype PrivateAdminAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateAdminAPI is the collection of Ethereum full node-related APIs exposed over the private admin endpoint.\n\n```go\nfunc NewPrivateAdminAPI(eth *Ethereum) *PrivateAdminAPI\n```\nNewPrivateAdminAPI creates a new API definition for the full node private admin methods of the Ethereum service.\n\n```go\nfunc (api *PrivateAdminAPI) ExportChain(file string, first *uint64, last *uint64) (bool, error)\n```\nExportChain exports the current blockchain into a local file, or a range of blocks if first and last are non-nil\n\n```go\nfunc (api *PrivateAdminAPI) ImportChain(file string) (bool, error)\n```\nImportChain imports a blockchain from a local file.\n\n```go\ntype PrivateDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateDebugAPI is the collection of Ethereum full node APIs exposed over the private debugging endpoint.\n\n```go\nfunc NewPrivateDebugAPI(eth *Ethereum) *PrivateDebugAPI\n```\nNewPrivateDebugAPI creates a new API definition for the full node-related private debug methods of the Ethereum service.\n\n```go\nfunc (api *PrivateDebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error)\n```\nGetAccessibleState returns the first number where the node has accessible state on disk. Note this being the post-state of that block and the pre-state of the next block. The (from, to) parameters are the sequence of blocks to search, which can go either forwards or backwards\n\n```go\nfunc (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)\n```\nGetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network and returns them as a JSON list of block-hashes\n\n```go\nfunc (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error)\n```\nGetModifiedAccountsByHash returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.\n\nWith one parameter, returns the list of accounts modified in the specified block.\n\n```go\nfunc (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error)\n```\nGetModifiedAccountsByNumber returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.\n\nWith one parameter, returns the list of accounts modified in the specified block.\n\n```go\nfunc (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)\n```\nPreimage is a debug API function that returns the preimage for a sha3 hash, if known.\n\n```go\nfunc (api *PrivateDebugAPI) StorageRangeAt(blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error)\n```\nStorageRangeAt returns the storage at the given block height and transaction index.\n\n```go\ntype PrivateMinerAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateMinerAPI provides private RPC methods to control the miner. These methods can be abused by external users and must be considered insecure for use by untrusted users.\n\n```go\nfunc NewPrivateMinerAPI(e *Ethereum) *PrivateMinerAPI\n```\nNewPrivateMinerAPI create a new RPC service which controls the miner of this node.\n\n```go\nfunc (api *PrivateMinerAPI) SetEtherbase(etherbase common.Address) bool\n```\nSetEtherbase sets the etherbase of the miner\n\n```go\nfunc (api *PrivateMinerAPI) SetExtra(extra string) (bool, error)\n```\nSetExtra sets the extra data string that is included when this miner mines a block.\n\n```go\nfunc (api *PrivateMinerAPI) SetGasLimit(gasLimit hexutil.Uint64) bool\n```\nSetGasLimit sets the gaslimit to target towards during mining.\n\n```go\nfunc (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool\n```\nSetGasPrice sets the minimum accepted gas price for the miner.\n\n```go\nfunc (api *PrivateMinerAPI) SetRecommitInterval(interval int)\n```\nSetRecommitInterval updates the interval for miner sealing work recommitting.\n\n```go\nfunc (api *PrivateMinerAPI) Start(threads *int) error\n```\nStart starts the miner with the given number of threads. If threads is nil, the number of workers started is equal to the number of logical CPUs that are usable by this process. If mining is already running, this method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.\n\n```go\nfunc (api *PrivateMinerAPI) Stop()\n```\nStop terminates the miner, both at the consensus engine level as well as at the block creation level.\n\n```go\ntype PublicDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicDebugAPI is the collection of Ethereum full node APIs exposed over the public debugging endpoint.\n\n```go\nfunc NewPublicDebugAPI(eth *Ethereum) *PublicDebugAPI\n```\nNewPublicDebugAPI creates a new API definition for the full node- related public debug methods of the Ethereum service.\n\n```go\nfunc (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, start []byte, maxResults int, nocode, nostorage, incompletes bool) (state.IteratorDump, error)\n```\nAccountRange enumerates all accounts in the given block and start point in paging request\n\n```go\nfunc (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error)\n```\nDumpBlock retrieves the entire state of the database at a given block.\n\n```go\ntype PublicEthereumAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicEthereumAPI provides an API to access Ethereum full node-related information.\n\n```go\nfunc NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI\n```\nNewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.\n\n```go\nfunc (api *PublicEthereumAPI) Coinbase() (common.Address, error)\n```\nCoinbase is the address that mining rewards will be send to (alias for Etherbase)\n\n```go\nfunc (api *PublicEthereumAPI) Etherbase() (common.Address, error)\n```\nEtherbase is the address that mining rewards will be send to\n\n```go\nfunc (api *PublicEthereumAPI) Hashrate() hexutil.Uint64\n```\nHashrate returns the POW hashrate\n\n```go\ntype PublicMinerAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicMinerAPI provides an API to control the miner. It offers only methods that operate on data that pose no security risk when it is publicly accessible.\n\n```go\nfunc NewPublicMinerAPI(e *Ethereum) *PublicMinerAPI\n```\nNewPublicMinerAPI create a new PublicMinerAPI instance.\n\n```go\nfunc (api *PublicMinerAPI) Mining() bool\n```\nMining returns an indication if this node is currently mining.\n\n```go\ntype StorageRangeResult struct {\n\tStorage storageMap   `json:\"storage\"`\n\tNextKey *common.Hash `json:\"nextKey\"` // nil if Storage includes the last key in the trie.\n}\n```\nStorageRangeResult is the result of a debug\\_storageRangeAt API call.\n\n","path":"github.com/Evolution404/simcore/eth","name":"eth","synopsis":"Package eth implements the Ethereum protocol.","isRedistributable":true}
