Ethereum  PoC-8
The C++ Implementation of Ethereum
Client.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
22 #pragma once
23 
24 #include "Block.h"
25 #include "BlockChain.h"
26 #include "BlockChainImporter.h"
27 #include "ClientBase.h"
28 #include "CommonNet.h"
29 #include "StateImporter.h"
30 #include "WarpCapability.h"
31 #include <libdevcore/Common.h>
32 #include <libdevcore/CommonIO.h>
33 #include <libdevcore/Guards.h>
34 #include <libdevcore/Worker.h>
35 #include <libethcore/SealEngine.h>
36 #include <libp2p/Common.h>
37 #include <array>
38 #include <atomic>
39 #include <condition_variable>
40 #include <list>
41 #include <mutex>
42 #include <queue>
43 #include <string>
44 #include <thread>
45 
46 #include <boost/filesystem/path.hpp>
47 
48 
49 namespace dev
50 {
51 namespace eth
52 {
53 
54 class Client;
55 class DownloadMan;
56 class EthereumCapability;
57 
59 {
60  Active = 0,
63 };
64 
66 {
67  unsigned ticks = 0;
68  std::chrono::system_clock::time_point since = std::chrono::system_clock::now();
69 };
70 
71 std::ostream& operator<<(std::ostream& _out, ActivityReport const& _r);
72 
76 class Client: public ClientBase, protected Worker
77 {
78 public:
79  Client(ChainParams const& _params, int _networkID, p2p::Host& _host,
80  std::shared_ptr<GasPricer> _gpForAdoption,
81  boost::filesystem::path const& _dbPath = boost::filesystem::path(),
82  boost::filesystem::path const& _snapshotPath = boost::filesystem::path(),
83  WithExisting _forceAction = WithExisting::Trust,
84  TransactionQueue::Limits const& _l = TransactionQueue::Limits{1024, 1024});
86  virtual ~Client();
87 
89  ChainParams const& chainParams() const { return bc().chainParams(); }
90 
92  void setGasPricer(std::shared_ptr<GasPricer> _gp) { m_gp = _gp; }
93  std::shared_ptr<GasPricer> gasPricer() const { return m_gp; }
94 
97  h256 submitTransaction(TransactionSkeleton const& _t, Secret const& _secret) override;
98 
100  h256 importTransaction(Transaction const& _t) override;
101 
103  ExecutionResult call(Address const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) override;
104 
106  void flushTransactions() override;
107 
109  Transactions pending() const override;
110 
112  ImportResult queueBlock(bytes const& _block, bool _isSafe = false);
113 
115  u256 gasLimitRemaining() const override { return m_postSeal.gasLimitRemaining(); }
117  u256 gasBidPrice() const override { return m_gp->bid(); }
118 
119  // [PRIVATE API - only relevant for base clients, not available in general]
121  dev::eth::Block block(h256 const& _blockHash, PopulationStatistics* o_stats) const;
122 
126  BlockChain const& blockChain() const { return bc(); }
130  SyncStatus syncStatus() const override;
134  BlockQueue const& blockQueue() const { return m_bq; }
136  OverlayDB const& stateDB() const { return m_stateDB; }
140 
142  std::tuple<ImportRoute, bool, unsigned> syncQueue(unsigned _max = 1);
143 
144  // Sealing stuff:
145  // Note: "mining"/"miner" is deprecated. Use "sealing"/"sealer".
146 
147  Address author() const override { ReadGuard l(x_preSeal); return m_preSeal.author(); }
148  void setAuthor(Address const& _us) override
149  {
151  m_preSeal.setAuthor(_us);
152  restartMining();
153  }
154 
156  strings sealers() const { return sealEngine()->sealers(); }
158  std::string sealer() const { return sealEngine()->sealer(); }
160  void setSealer(std::string const& _id) { sealEngine()->setSealer(_id); if (wouldSeal()) startSealing(); }
162  bytes sealOption(std::string const& _name) const { return sealEngine()->option(_name); }
164  bool setSealOption(std::string const& _name, bytes const& _value) { auto ret = sealEngine()->setOption(_name, _value); if (wouldSeal()) startSealing(); return ret; }
165 
167  void startSealing() override;
169  void stopSealing() override { m_wouldSeal = false; }
171  bool wouldSeal() const override { return m_wouldSeal; }
172 
174  bool isSyncing() const override;
176  bool isMajorSyncing() const override;
177 
179  u256 networkId() const override;
181  void setNetworkId(u256 const& _n) override;
182 
184  SealEngineFace* sealEngine() const override { return bc().sealEngine(); }
185 
186  // Debug stuff:
187 
188  DownloadMan const* downloadMan() const;
190  void clearPending();
195  void reopenChain(WithExisting _we);
201  void setExtraData(bytes const& _extraData) { m_extraData = _extraData; }
203  void rewind(unsigned _n);
205  void rescue() { bc().rescue(m_stateDB); }
206 
207  std::unique_ptr<StateImporterFace> createStateImporter() { return dev::eth::createStateImporter(m_stateDB); }
208  std::unique_ptr<BlockChainImporterFace> createBlockChainImporter() { return dev::eth::createBlockChainImporter(m_bc); }
209 
211  void executeInMainThread(std::function<void()> const& _function);
212 
213  Block block(h256 const& _block) const override;
214  using ClientBase::block;
215 
218 
220  Handler<bytes const&> setOnBlockSealed(std::function<void(bytes const&)> _handler)
221  {
222  return m_onBlockSealed.add(_handler);
223  }
226  std::function<void(h256s const&, h256s const&)> _handler)
227  {
228  return m_onChainChanged.add(_handler);
229  }
230 
231 
232 protected:
235  void init(p2p::Host& _extNet, boost::filesystem::path const& _dbPath,
236  boost::filesystem::path const& _snapshotPath, WithExisting _forceAction, u256 _networkId);
237 
239  BlockChain& bc() override { return m_bc; }
240  BlockChain const& bc() const override { return m_bc; }
241 
244  Block preSeal() const override { ReadGuard l(x_preSeal); return m_preSeal; }
245  Block postSeal() const override { ReadGuard l(x_postSeal); return m_postSeal; }
246  void prepareForTransaction() override;
247 
250  void appendFromNewPending(TransactionReceipt const& _receipt, h256Hash& io_changed, h256 _sha3);
251 
254  void appendFromBlock(h256 const& _blockHash, BlockPolarity _polarity, h256Hash& io_changed);
255 
258  void noteChanged(h256Hash const& _filters);
259 
261  virtual bool submitSealed(bytes const& _s);
262 
263 protected:
265  void startedWorking() override;
266 
268  void doWork(bool _doWait);
269  void doWork() override { doWork(true); }
270 
272  void doneWorking() override;
273 
275  void rejigSealing();
276 
278  void onDeadBlocks(h256s const& _blocks, h256Hash& io_changed);
279 
281  virtual void onNewBlocks(h256s const& _blocks, h256Hash& io_changed);
282 
284  void resyncStateFromChain();
286  void restartMining();
287 
289  void resetState();
290 
293  void onChainChanged(ImportRoute const& _ir);
294 
296  void syncBlockQueue();
297 
299  void syncTransactionQueue();
300 
303 
305  void onBlockQueueReady() { m_syncBlockQueue = true; m_signalled.notify_all(); }
306 
309  void onPostStateChanged();
310 
312  void checkWatchGarbage();
313 
315  void tick();
316 
319  void onBadBlock(Exception& _ex) const;
320 
322  void callQueuedFunctions();
323 
327 
328  std::shared_ptr<GasPricer> m_gp;
329 
338  bool remoteActive() const;
339  std::atomic<bool> m_remoteWorking = { false };
340  std::atomic<bool> m_needStateReset = { false };
341  std::chrono::system_clock::time_point m_lastGetWork;
342 
343  std::weak_ptr<EthereumCapability> m_host;
344  std::weak_ptr<WarpCapability> m_warpHost;
345 
346  std::condition_variable m_signalled;
348 
352 
353  std::atomic<bool> m_wouldSeal = { false };
354  bool m_wouldButShouldnot = false;
355 
356  mutable std::chrono::system_clock::time_point m_lastGarbageCollection;
358  mutable std::chrono::system_clock::time_point m_lastTick = std::chrono::system_clock::now();
360 
361  unsigned m_syncAmount = 50;
362 
364 
366  std::queue<std::function<void()>> m_functionQueue;
367 
368  std::atomic<bool> m_syncTransactionQueue = {false};
369  std::atomic<bool> m_syncBlockQueue = {false};
370 
372 
374 
377 
380 };
381 
382 }
383 }
void stopSealing() override
Stop sealing.
Definition: Client.h:169
void resetState()
Clear working state of transactions.
Definition: Client.cpp:539
Definition: Address.cpp:20
Address author() const
Get the author address for any transactions we do and rewards we get.
Definition: Block.h:109
BlockHeader m_sealingInfo
The header we&#39;re attempting to seal on (derived from m_postSeal).
Definition: Client.h:337
Super-duper signal mechanism. TODO: replace with somthing a bit heavier weight.
Definition: Common.h:152
Block m_working
The state of the client which we&#39;re sealing (i.e. it&#39;ll have all the rewards added), while we&#39;re actually working on it.
Definition: Client.h:336
void syncTransactionQueue()
Signal handler for when the block queue needs processing.
Definition: Client.cpp:409
Block preSeal() const override
Definition: Client.h:244
virtual std::string sealer() const
Definition: SealEngine.h:66
void setAuthor(Address const &_us) override
Set the block author address.
Definition: Client.h:148
OverlayDB const & stateDB() const
Get the state database.
Definition: Client.h:136
void rewind(unsigned _n)
Rewind to a prior head.
Definition: Client.cpp:849
A queue of Transactions, each stored as RLP. Maintains a transaction queue sorted by nonce diff and g...
SealEngineFace * sealEngine() const
Definition: BlockChain.h:308
bool remoteActive() const
Is there an active and valid remote worker?
Definition: Client.cpp:571
std::chrono::system_clock::time_point m_lastGarbageCollection
When did we last both doing GC on the watches?
Definition: Client.h:356
void onPostStateChanged()
Definition: Client.cpp:576
void swap(dev::eth::Watch &_a, dev::eth::Watch &_b)
Definition: Interface.h:279
Implements the blockchain database. All data this gives is disk-backed. .
Definition: BlockChain.h:104
DownloadMan const * downloadMan() const
BlockChain const & blockChain() const
Get the object representing the current canonical blockchain.
Definition: Client.h:126
void onTransactionQueueReady()
Magically called when m_tq needs syncing. Be nice and don&#39;t block.
Definition: Client.h:302
void doneWorking() override
Called when Worker is exiting.
Definition: Client.cpp:249
Block m_postSeal
The state of the client which we&#39;re sealing (i.e. it&#39;ll have all the rewards added).
Definition: Client.h:334
Encapsulation of a block header. Class to contain all of a block header&#39;s data. It is able to parse a...
Definition: BlockHeader.h:96
Handler m_tqReady
Definition: Client.h:349
std::ostream & operator<<(std::ostream &_out, BlockHeader const &_bi)
Definition: BlockHeader.h:217
h256 importTransaction(Transaction const &_t) override
Imports the given transaction into the transaction queue.
Definition: Client.cpp:880
TransactionQueue::Limits transactionQueueLimits() const
Definition: Client.h:139
bytes sealOption(std::string const &_name) const
Review option for the sealer.
Definition: Client.h:162
BlockQueueStatus status() const
Get some infomration on the current status.
Definition: BlockQueue.cpp:379
Block postSeal() const override
Definition: Client.h:245
virtual bool submitSealed(bytes const &_s)
Submit.
Definition: Client.cpp:830
void reopenChain(ChainParams const &_p, WithExisting _we=WithExisting::Trust)
Reloads the blockchain. Just for debug use.
Definition: Client.cpp:269
void setExtraData(bytes const &_extraData)
Set the extra data that goes into sealed blocks.
Definition: Client.h:201
bool isSyncing() const override
Are we updating the chain (syncing or importing a new block)?
Definition: Client.cpp:215
std::vector< Transaction > Transactions
Nice name for vector of Transaction.
Definition: Transaction.h:122
SharedMutex x_preSeal
Lock on m_preSeal.
Definition: Client.h:331
std::vector< std::string > strings
Definition: Common.h:143
std::unique_ptr< BlockChainImporterFace > createBlockChainImporter()
Definition: Client.h:208
virtual ~Client()
Destructor.
Definition: Client.cpp:90
BlockQueue const & blockQueue() const
Get the block queue.
Definition: Client.h:134
void startedWorking() override
Called when Worker is starting.
Definition: Client.cpp:232
void startWorking()
should be called after the constructor of the most derived class finishes.
Definition: Client.h:217
std::chrono::system_clock::time_point m_lastTick
When did we last tick()?
Definition: Client.h:358
bool m_wouldButShouldnot
True if the last time we called rejigSealing wouldSeal() was true but sealer&#39;s shouldSeal() was false...
Definition: Client.h:354
void noteChanged(h256Hash const &_filters)
Definition: Client.cpp:644
Description of the result of executing a transaction.
Definition: Transaction.h:70
Address author() const override
Get the block author address.
Definition: Client.h:147
unsigned BlockNumber
Definition: Common.h:83
h256 submitTransaction(TransactionSkeleton const &_t, Secret const &_secret) override
Definition: Client.cpp:872
BlockQueue m_bq
Maintains a list of incoming blocks not yet on the blockchain (to be imported).
Definition: Client.h:325
Logger m_loggerDetail
Definition: Client.h:379
ClientWorkState
Definition: Client.h:58
TransactionSkeleton populateTransactionWithDefaults(TransactionSkeleton const &_t) const override
Populate the uninitialized fields in the supplied transaction with default values.
Definition: Client.cpp:812
Handler m_bqReady
Definition: Client.h:351
void doWork() override
Called continuously following sleep for m_idleWaitMs.
Definition: Client.h:269
ImportResult
Definition: Common.h:115
dev::eth::Block postState() const
Get the object representing the current state of Ethereum.
Definition: Client.h:124
std::atomic< bool > m_remoteWorking
Has the remote worker recently been reset?
Definition: Client.h:339
WithExisting
Definition: Common.h:291
Signal< h256s const &, h256s const & > m_onChainChanged
Called when blockchain was changed.
Definition: Client.h:376
void rejigSealing()
Called when wouldSeal(), pendingTransactions() have changed.
Definition: Client.cpp:597
Mutex x_signalled
Definition: Client.h:347
bool isMajorSyncing() const override
Are we syncing the chain?
Definition: Client.cpp:222
Active model of a block within the block chain. Keeps track of all transactions, receipts and state f...
Definition: Block.h:68
std::shared_ptr< GasPricer > m_gp
The gas pricer.
Definition: Client.h:328
void onBlockQueueReady()
Magically called when m_bq needs syncing. Be nice and don&#39;t block.
Definition: Client.h:305
void appendFromNewPending(TransactionReceipt const &_receipt, h256Hash &io_changed, h256 _sha3)
Definition: Client.cpp:334
bool wouldSeal() const override
Are we sealing now?
Definition: Client.h:171
unsigned m_syncAmount
Number of blocks to sync in each go.
Definition: Client.h:361
void onBadBlock(Exception &_ex) const
Definition: Client.cpp:170
Base class for all exceptions.
Definition: Exceptions.h:38
Signal< bytes const & > m_onBlockSealed
Called if we have sealed a new block.
Definition: Client.h:373
SyncStatus syncStatus() const override
Get some information on the block syncing.
Definition: Client.cpp:802
u256 gasBidPrice() const override
Get the gas bid price.
Definition: Client.h:117
bool setSealOption(std::string const &_name, bytes const &_value)
Set option for the sealer.
Definition: Client.h:164
std::tuple< ImportRoute, bool, unsigned > syncQueue(unsigned _max=1)
Freeze worker thread and sync some of the block queue.
Definition: Client.cpp:164
bytes option(std::string const &_name) const
Definition: SealEngine.h:62
void flushTransactions() override
Blocks until all pending transactions have been processed.
Definition: Client.cpp:792
BlockChain & bc() override
InterfaceStub methods.
Definition: Client.h:239
void onDeadBlocks(h256s const &_blocks, h256Hash &io_changed)
Called on chain changes.
Definition: Client.cpp:457
std::shared_ptr< typename Signal< Args... >::HandlerAux > Handler
Definition: Common.h:200
BlockPolarity
Definition: Common.h:99
std::chrono::system_clock::time_point since
Definition: Client.h:68
void clearPending()
Clears pending transactions. Just for debug use.
Definition: Client.cpp:318
#define DEV_WRITE_GUARDED(MUTEX)
Definition: Guards.h:136
ActivityReport m_report
Definition: Client.h:363
u256 networkId() const override
Gets the network id.
Definition: Client.cpp:202
u256 gasLimitRemaining() const override
Get the remaining gas limit in this block.
Definition: Client.h:115
void resyncStateFromChain()
Called after processing blocks by onChainChanged(_ir)
Definition: Client.cpp:489
std::atomic< bool > m_syncBlockQueue
Definition: Client.h:369
void retryAllUnknown()
Force a retry of all the blocks with unknown parents.
Definition: BlockQueue.cpp:497
Logger createLogger(int _severity, std::string const &_channel)
Definition: Log.h:125
std::vector< byte > bytes
Definition: Common.h:72
strings sealers() const
Type of sealers available for this seal engine.
Definition: Client.h:156
Main API hub for interfacing with Ethereum.
Definition: Client.h:76
std::shared_ptr< HandlerAux > add(Callback const &_h)
Definition: Common.h:181
A queue of blocks. Sits between network or other I/O and the BlockChain. Sorts them ready for blockch...
Definition: BlockQueue.h:223
std::atomic< bool > m_needStateReset
Need reset working state to premin on next sync.
Definition: Client.h:340
boost::shared_lock< boost::shared_mutex > ReadGuard
Definition: Guards.h:44
Logger m_logger
Definition: Client.h:378
void killChain()
Kills the blockchain. Just for debug use.
Definition: Client.h:192
bytes m_extraData
Definition: Client.h:371
void startWorking()
Starts worker thread; causes startedWorking() to be called.
Definition: Worker.cpp:30
Encodes a transaction, ready to be exported to or freshly imported from RLP.
Definition: Transaction.h:85
TransactionQueue m_tq
Maintains a list of incoming transactions not yet in a block on the blockchain.
Definition: Client.h:326
std::string sealer() const
Current sealer in use.
Definition: Client.h:158
virtual void onNewBlocks(h256s const &_blocks, h256Hash &io_changed)
Called on chain changes.
Definition: Client.cpp:476
BlockChain const & bc() const override
Definition: Client.h:240
BlockQueueStatus blockQueueStatus() const
Get some information on the block queue.
Definition: Client.h:128
std::unique_ptr< StateImporterFace > createStateImporter()
Definition: Client.h:207
virtual void setSealer(std::string const &)
Definition: SealEngine.h:67
std::queue< std::function< void()> > m_functionQueue
Functions waiting to be executed in the main thread.
Definition: Client.h:366
void setAuthor(Address const &_id)
Definition: Block.h:113
std::chrono::system_clock::time_point m_lastGetWork
Is there an active and valid remote worker?
Definition: Client.h:341
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
Definition: Common.h:121
std::atomic< bool > m_wouldSeal
True if we /should/ be sealing.
Definition: Client.h:353
dev::eth::Block block(h256 const &_blockHash, PopulationStatistics *o_stats) const
Get the block.
Definition: Client.cpp:774
Transactions pending() const override
Retrieve pending transactions.
Definition: Client.cpp:797
Client(ChainParams const &_params, int _networkID, p2p::Host &_host, std::shared_ptr< GasPricer > _gpForAdoption, boost::filesystem::path const &_dbPath=boost::filesystem::path(), boost::filesystem::path const &_snapshotPath=boost::filesystem::path(), WithExisting _forceAction=WithExisting::Trust, TransactionQueue::Limits const &_l=TransactionQueue::Limits{1024, 1024})
Definition: Client.cpp:73
BlockChain m_bc
Maintains block database and owns the seal engine.
Definition: Client.h:324
void callQueuedFunctions()
Executes the pending functions in m_functionQueue.
Definition: Client.cpp:184
bool setOption(std::string const &_name, bytes const &_value)
Definition: SealEngine.h:63
void executeInMainThread(std::function< void()> const &_function)
Queues a function to be executed in the main thread (that owns the blockchain, etc).
Definition: Client.cpp:311
std::weak_ptr< WarpCapability > m_warpHost
Definition: Client.h:344
std::unique_ptr< BlockChainImporterFace > createBlockChainImporter(BlockChain &_blockChain)
SharedMutex x_functionQueue
Definition: Client.h:365
ChainParams const & chainParams() const
Definition: BlockChain.h:306
boost::shared_mutex SharedMutex
Definition: Guards.h:39
void retryUnknown()
Retries all blocks with unknown parents.
Definition: Client.h:197
Block m_preSeal
The present state of the client.
Definition: Client.h:332
void rescue()
Rescue the chain.
Definition: Client.h:205
void checkWatchGarbage()
Does garbage collection on watches.
Definition: Client.cpp:725
void syncBlockQueue()
Signal handler for when the block queue needs processing.
Definition: Client.cpp:384
u256 gasLimitRemaining() const
Get the remaining gas limit in this block.
Definition: Block.h:180
virtual strings sealers() const
Definition: SealEngine.h:65
void setSealer(std::string const &_id)
Change sealer.
Definition: Client.h:160
std::unordered_set< h256 > h256Hash
Definition: FixedHash.h:363
std::shared_ptr< GasPricer > gasPricer() const
Definition: Client.h:93
SealEngineFace * sealEngine() const override
Get the seal engine.
Definition: Client.h:184
virtual Block block(h256 const &_h) const =0
void appendFromBlock(h256 const &_blockHash, BlockPolarity _polarity, h256Hash &io_changed)
Definition: Client.cpp:353
std::mutex Mutex
Definition: Guards.h:37
ActivityReport activityReport()
Get a report of activity.
Definition: Client.h:199
std::atomic< bool > m_syncTransactionQueue
Definition: Client.h:368
void init(p2p::Host &_extNet, boost::filesystem::path const &_dbPath, boost::filesystem::path const &_snapshotPath, WithExisting _forceAction, u256 _networkId)
Definition: Client.cpp:97
void startSealing() override
Start sealing.
Definition: Client.cpp:583
SharedMutex x_working
Lock on m_working.
Definition: Client.h:335
OverlayDB m_stateDB
Acts as the central point for the state database, so multiple States can share it.
Definition: Client.h:330
std::vector< h256 > h256s
Definition: FixedHash.h:359
ExecutionResult call(Address const &_secret, u256 _value, Address _dest, bytes const &_data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff=FudgeFactor::Strict) override
Makes the given call. Nothing is recorded into the state.
Definition: Client.cpp:912
void rescue(OverlayDB const &_db)
Rescue the database.
SharedMutex x_postSeal
Lock on m_postSeal.
Definition: Client.h:333
std::condition_variable m_signalled
Definition: Client.h:346
void onChainChanged(ImportRoute const &_ir)
Definition: Client.cpp:554
void setGasPricer(std::shared_ptr< GasPricer > _gp)
Resets the gas pricer to some other object.
Definition: Client.h:92
void restartMining()
Update m_preSeal, m_working, m_postSeal blocks from the latest state of the chain.
Definition: Client.cpp:498
TransactionQueue::Status transactionQueueStatus() const
Get some information on the transaction queue.
Definition: Client.h:138
void setNetworkId(u256 const &_n) override
Sets the network id.
Definition: Client.cpp:209
std::weak_ptr< EthereumCapability > m_host
Definition: Client.h:343
Handler< h256s const &, h256s const & > setOnChainChanged(std::function< void(h256s const &, h256s const &)> _handler)
Change the function that is called when blockchain was changed.
Definition: Client.h:225
ChainParams const & chainParams() const
Get information on this chain.
Definition: Client.h:89
Handler< bytes const & > setOnBlockSealed(std::function< void(bytes const &)> _handler)
Change the function that is called when a new block is sealed.
Definition: Client.h:220
Handler< h256 const & > m_tqReplaced
Definition: Client.h:350
boost::log::sources::severity_channel_logger<> Logger
Definition: Log.h:124
void tick()
Ticks various system-level objects.
Definition: Client.cpp:712
std::unique_ptr< StateImporterFace > createStateImporter(OverlayDB &_stateDb)
ImportResult queueBlock(bytes const &_block, bool _isSafe=false)
Queues a block for import.
Definition: Client.cpp:157
void prepareForTransaction() override
Definition: Client.cpp:753