Fabcoin Core  0.16.2
P2P Digital Currency
AdminEth.h
Go to the documentation of this file.
1 #pragma once
2 #include "AdminEthFace.h"
3 
4 namespace dev
5 {
6 
7 namespace eth
8 {
9 class Client;
10 class TrivialGasPricer;
11 class KeyManager;
12 }
13 
14 namespace rpc
15 {
16 
17 class SessionManager;
18 
19 class AdminEth: public AdminEthFace
20 {
21 public:
23 
24  virtual RPCModules implementedModules() const override
25  {
26  return RPCModules{RPCModule{"admin", "1.0"}, RPCModule{"miner", "1.0"}};
27  }
28 
29  virtual bool admin_eth_setMining(bool _on, std::string const& _session) override;
30  virtual Json::Value admin_eth_blockQueueStatus(std::string const& _session) override;
31  virtual bool admin_eth_setAskPrice(std::string const& _wei, std::string const& _session) override;
32  virtual bool admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) override;
33  virtual Json::Value admin_eth_findBlock(std::string const& _blockHash, std::string const& _session) override;
34  virtual std::string admin_eth_blockQueueFirstUnknown(std::string const& _session) override;
35  virtual bool admin_eth_blockQueueRetryUnknown(std::string const& _session) override;
36  virtual Json::Value admin_eth_allAccounts(std::string const& _session) override;
37  virtual Json::Value admin_eth_newAccount(const Json::Value& _info, std::string const& _session) override;
38  virtual bool admin_eth_setMiningBenefactor(std::string const& _uuidOrAddress, std::string const& _session) override;
39  virtual Json::Value admin_eth_inspect(std::string const& _address, std::string const& _session) override;
40  virtual Json::Value admin_eth_reprocess(std::string const& _blockNumberOrHash, std::string const& _session) override;
41  virtual Json::Value admin_eth_vmTrace(std::string const& _blockNumberOrHash, int _txIndex, std::string const& _session) override;
42  virtual Json::Value admin_eth_getReceiptByHashAndIndex(std::string const& _blockNumberOrHash, int _txIndex, std::string const& _session) override;
43  virtual bool miner_start(int _threads) override;
44  virtual bool miner_stop() override;
45  virtual bool miner_setEtherbase(std::string const& _uuidOrAddress) override;
46  virtual bool miner_setExtra(std::string const& _extraData) override;
47  virtual bool miner_setGasPrice(std::string const& _gasPrice) override;
48  virtual std::string miner_hashrate() override;
49 
50  virtual void setMiningBenefactorChanger(std::function<void(Address const&)> const& _f) { m_setMiningBenefactor = _f; }
51 private:
56  std::function<void(Address const&)> m_setMiningBenefactor;
57 
58  h256 blockHash(std::string const& _blockNumberOrHash) const;
59 };
60 
61 }
62 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
std::vector< RPCModule > RPCModules
Definition: ModularServer.h:50
#define function(a, b, c, d, k, s)
eth::TrivialGasPricer & m_gp
Definition: AdminEth.h:53
eth::KeyManager & m_keyManager
Definition: AdminEth.h:54
Config::Value_type Value
High-level manager of password-encrypted keys for Ethereum.
Definition: KeyManager.h:72
virtual void setMiningBenefactorChanger(std::function< void(Address const &)> const &_f)
Definition: AdminEth.h:50
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
Definition: FixedHash.h:47
Main API hub for interfacing with Ethereum.
Definition: Client.h:75
virtual RPCModules implementedModules() const override
Definition: AdminEth.h:24
eth::Client & m_eth
Definition: AdminEth.h:52
std::function< void(Address const &)> m_setMiningBenefactor
Definition: AdminEth.h:56
SessionManager & m_sm
Definition: AdminEth.h:55