![]() |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Main API hub for interfacing with Ethereum. More...
#include <Interface.h>
Public Member Functions | |
| Interface () | |
| Constructor. More... | |
| virtual | ~Interface () |
| Destructor. More... | |
| virtual h256 | submitTransaction (TransactionSkeleton const &_t, Secret const &_secret)=0 |
| void | submitTransaction (Secret const &_secret, u256 const &_value, Address const &_dest, bytes const &_data=bytes(), u256 const &_gas=1000000, u256 const &_gasPrice=DefaultGasPrice, u256 const &_nonce=Invalid256) |
| Submits the given message-call transaction. More... | |
| virtual h256 | importTransaction (Transaction const &_t)=0 |
| Imports the given transaction into the transaction queue. More... | |
| virtual void | flushTransactions ()=0 |
| Blocks until all pending transactions have been processed. More... | |
| virtual ExecutionResult | call (Address const &_from, u256 _value, Address _dest, bytes const &_data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff=FudgeFactor::Strict)=0 |
| Makes the given call. Nothing is recorded into the state. More... | |
| ExecutionResult | call (Address const &_from, u256 _value, Address _dest, bytes const &_data=bytes(), u256 _gas=1000000, u256 _gasPrice=DefaultGasPrice, FudgeFactor _ff=FudgeFactor::Strict) |
| ExecutionResult | call (Secret const &_secret, u256 _value, Address _dest, bytes const &_data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff=FudgeFactor::Strict) |
| ExecutionResult | call (Secret const &_secret, u256 _value, Address _dest, bytes const &_data, u256 _gas, u256 _gasPrice, FudgeFactor _ff=FudgeFactor::Strict) |
| virtual ImportResult | injectBlock (bytes const &_block)=0 |
| Injects the RLP-encoded block given by the _rlp into the block queue directly. More... | |
| virtual std::pair< u256, ExecutionResult > | estimateGas (Address const &_from, u256 _value, Address _dest, bytes const &_data, int64_t _maxGas, u256 _gasPrice, BlockNumber _blockNumber, GasEstimationCallback const &_callback=GasEstimationCallback())=0 |
| int | getDefault () const |
| void | setDefault (BlockNumber _block) |
| u256 | balanceAt (Address _a) const |
| u256 | countAt (Address _a) const |
| u256 | stateAt (Address _a, u256 _l) const |
| bytes | codeAt (Address _a) const |
| h256 | codeHashAt (Address _a) const |
| std::map< h256, std::pair< u256, u256 > > | storageAt (Address _a) const |
| virtual u256 | balanceAt (Address _a, BlockNumber _block) const =0 |
| virtual u256 | countAt (Address _a, BlockNumber _block) const =0 |
| virtual u256 | stateAt (Address _a, u256 _l, BlockNumber _block) const =0 |
| virtual h256 | stateRootAt (Address _a, BlockNumber _block) const =0 |
| virtual bytes | codeAt (Address _a, BlockNumber _block) const =0 |
| virtual h256 | codeHashAt (Address _a, BlockNumber _block) const =0 |
| virtual std::map< h256, std::pair< u256, u256 > > | storageAt (Address _a, BlockNumber _block) const =0 |
| virtual LocalisedLogEntries | logs (unsigned _watchId) const =0 |
| virtual LocalisedLogEntries | logs (LogFilter const &_filter) const =0 |
| virtual unsigned | installWatch (LogFilter const &_filter, Reaping _r=Reaping::Automatic)=0 |
| Install, uninstall and query watches. More... | |
| virtual unsigned | installWatch (h256 _filterId, Reaping _r=Reaping::Automatic)=0 |
| virtual bool | uninstallWatch (unsigned _watchId)=0 |
| LocalisedLogEntries | peekWatchSafe (unsigned _watchId) const |
| LocalisedLogEntries | checkWatchSafe (unsigned _watchId) |
| virtual LocalisedLogEntries | peekWatch (unsigned _watchId) const =0 |
| virtual LocalisedLogEntries | checkWatch (unsigned _watchId)=0 |
| virtual bool | isKnownTransaction (h256 const &_transactionHash) const =0 |
| virtual bool | isKnownTransaction (h256 const &_blockHash, unsigned _i) const =0 |
| virtual Transaction | transaction (h256 _transactionHash) const =0 |
| virtual LocalisedTransaction | localisedTransaction (h256 const &_transactionHash) const =0 |
| virtual TransactionReceipt | transactionReceipt (h256 const &_transactionHash) const =0 |
| virtual LocalisedTransactionReceipt | localisedTransactionReceipt (h256 const &_transactionHash) const =0 |
| virtual std::pair< h256, unsigned > | transactionLocation (h256 const &_transactionHash) const =0 |
| virtual h256 | hashFromNumber (BlockNumber _number) const =0 |
| virtual BlockNumber | numberFromHash (h256 _blockHash) const =0 |
| virtual int | compareBlockHashes (h256 _h1, h256 _h2) const =0 |
| virtual bool | isKnown (BlockNumber _block) const =0 |
| virtual bool | isKnown (h256 const &_hash) const =0 |
| virtual BlockHeader | blockInfo (h256 _hash) const =0 |
| virtual BlockDetails | blockDetails (h256 _hash) const =0 |
| virtual Transaction | transaction (h256 _blockHash, unsigned _i) const =0 |
| virtual LocalisedTransaction | localisedTransaction (h256 const &_blockHash, unsigned _i) const =0 |
| virtual BlockHeader | uncle (h256 _blockHash, unsigned _i) const =0 |
| virtual UncleHashes | uncleHashes (h256 _blockHash) const =0 |
| virtual unsigned | transactionCount (h256 _blockHash) const =0 |
| virtual unsigned | transactionCount (BlockNumber _block) const =0 |
| virtual unsigned | uncleCount (h256 _blockHash) const =0 |
| virtual Transactions | transactions (h256 _blockHash) const =0 |
| virtual Transactions | transactions (BlockNumber _block) const =0 |
| virtual TransactionHashes | transactionHashes (h256 _blockHash) const =0 |
| virtual BlockHeader | pendingInfo () const |
| virtual BlockDetails | pendingDetails () const |
| virtual EVMSchedule | evmSchedule () const |
| BlockHeader | blockInfo (BlockNumber _block) const |
| BlockDetails | blockDetails (BlockNumber _block) const |
| Transaction | transaction (BlockNumber _block, unsigned _i) const |
| TransactionHashes | transactionHashes (BlockNumber _block) const |
| BlockHeader | uncle (BlockNumber _block, unsigned _i) const |
| UncleHashes | uncleHashes (BlockNumber _block) const |
| unsigned | uncleCount (BlockNumber _block) const |
| virtual unsigned | number () const =0 |
| virtual Transactions | pending () const =0 |
| virtual h256s | pendingHashes () const =0 |
| virtual Addresses | addresses () const |
| virtual Addresses | addresses (BlockNumber _block) const =0 |
| virtual u256 | gasLimitRemaining () const =0 |
| Get the remaining gas limit in this block. More... | |
| virtual u256 | gasBidPrice () const =0 |
| virtual SyncStatus | syncStatus () const =0 |
| Get some information on the block queue. More... | |
| virtual TransactionSkeleton | populateTransactionWithDefaults (TransactionSkeleton const &_t) const =0 |
| Populate the uninitialized fields in the supplied transaction with default values. More... | |
| virtual void | setAuthor (Address const &_us)=0 |
| Set the block author address. More... | |
| virtual Address | author () const =0 |
| Get the block author address. More... | |
| virtual void | startSealing ()=0 |
| virtual void | stopSealing ()=0 |
| virtual bool | wouldSeal () const =0 |
| Would we like to be sealing now? More... | |
| virtual bool | isSyncing () const |
| Are we updating the chain (syncing or importing a new block)? More... | |
| virtual bool | isMajorSyncing () const |
| Are we syncing the chain? More... | |
| virtual u256 | networkId () const |
| Gets the network id. More... | |
| virtual void | setNetworkId (u256 const &) |
| Sets the network id. More... | |
| virtual int | chainId () const |
| Gets the chain id. More... | |
| virtual SealEngineFace * | sealEngine () const |
| Get the seal engine. More... | |
| virtual std::tuple< h256, h256, h256 > | getWork ()=0 |
Protected Attributes | |
| int | m_default = PendingBlock |
Main API hub for interfacing with Ethereum.
Definition at line 67 of file Interface.h.
|
inline |
Constructor.
Definition at line 71 of file Interface.h.
|
inlinevirtual |
Destructor.
Definition at line 74 of file Interface.h.
|
inlinevirtual |
Get a list of all active addresses. NOTE: This only works when compiled with ETH_FATDB; otherwise will throw InterfaceNotSupported.
Definition at line 192 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Get the block author address.
Implemented in dev::eth::Client, and dev::eth::ClientBase.
Definition at line 110 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
| BlockDetails Interface::blockDetails | ( | BlockNumber | _block | ) | const |
Definition at line 47 of file Interface.cpp.
|
pure virtual |
Implemented in dev::eth::ClientBase.
| BlockHeader Interface::blockInfo | ( | BlockNumber | _block | ) | const |
Definition at line 40 of file Interface.cpp.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Makes the given call. Nothing is recorded into the state.
Implemented in dev::eth::Client.
|
inline |
Definition at line 93 of file Interface.h.
|
inline |
Definition at line 94 of file Interface.h.
|
inline |
Definition at line 95 of file Interface.h.
|
inlinevirtual |
Gets the chain id.
Reimplemented in dev::eth::ClientBase.
Definition at line 233 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 135 of file Interface.h.
Definition at line 113 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
Definition at line 114 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
Implemented in dev::eth::ClientBase.
Definition at line 111 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Estimate gas usage for call/create.
| _maxGas | An upper bound value for estimation, if not provided default value of c_maxGasEstimate will be used. |
| _callback | Optional callback function for progress reporting |
Implemented in dev::eth::ClientBase.
|
inlinevirtual |
Reimplemented in dev::eth::ClientBase.
Definition at line 170 of file Interface.h.
|
pure virtual |
Blocks until all pending transactions have been processed.
Implemented in dev::eth::Client.
|
pure virtual |
Implemented in dev::eth::ClientBase, and dev::eth::Client.
|
pure virtual |
Get the remaining gas limit in this block.
Implemented in dev::eth::ClientBase, and dev::eth::Client.
|
inline |
Definition at line 107 of file Interface.h.
Implemented in dev::eth::Client.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Imports the given transaction into the transaction queue.
Implemented in dev::eth::Client.
|
pure virtual |
Injects the RLP-encoded block given by the _rlp into the block queue directly.
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Install, uninstall and query watches.
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inlinevirtual |
Are we syncing the chain?
Reimplemented in dev::eth::Client.
Definition at line 225 of file Interface.h.
|
inlinevirtual |
Are we updating the chain (syncing or importing a new block)?
Reimplemented in dev::eth::Client.
Definition at line 223 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inlinevirtual |
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 134 of file Interface.h.
|
pure virtual |
Get a map containing each of the pending transactions (transactions from accounts managed by this node which have not yet made it into a mined block) @TODO: Remove in favour of transactions().
Implemented in dev::eth::Client.
|
inlinevirtual |
Reimplemented in dev::eth::ClientBase.
Definition at line 168 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inlinevirtual |
Reimplemented in dev::eth::ClientBase.
Definition at line 167 of file Interface.h.
|
pure virtual |
Populate the uninitialized fields in the supplied transaction with default values.
Implemented in dev::eth::Client.
|
inlinevirtual |
Get the seal engine.
Get POW depending on sealengine it's using
Reimplemented in dev::eth::Client.
Definition at line 236 of file Interface.h.
|
pure virtual |
Set the block author address.
Implemented in dev::eth::Client.
|
inline |
Definition at line 108 of file Interface.h.
|
inlinevirtual |
|
pure virtual |
Start sealing. NOT thread-safe - call it & stopSealing only from a single thread
Implemented in dev::eth::Client, and dev::eth::ClientBase.
Definition at line 112 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Stop sealing. NOT thread-safe
Implemented in dev::eth::Client, and dev::eth::ClientBase.
Definition at line 115 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
| void Interface::submitTransaction | ( | Secret const & | _secret, |
| u256 const & | _value, | ||
| Address const & | _dest, | ||
| bytes const & | _data = bytes(), |
||
| u256 const & | _gas = 1000000, |
||
| u256 const & | _gasPrice = DefaultGasPrice, |
||
| u256 const & | _nonce = Invalid256 |
||
| ) |
Submits the given message-call transaction.
Definition at line 27 of file Interface.cpp.
|
pure virtual |
|
pure virtual |
Get some information on the block queue.
Implemented in dev::eth::ClientBase, and dev::eth::Client.
|
inline |
Definition at line 174 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 175 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 176 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 178 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
inline |
Definition at line 177 of file Interface.h.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Implemented in dev::eth::ClientBase.
|
pure virtual |
Would we like to be sealing now?
Implemented in dev::eth::Client, and dev::eth::ClientBase.
|
protected |
Definition at line 242 of file Interface.h.