Marek Kotewicz
10 years ago
5 changed files with 139 additions and 80 deletions
@ -0,0 +1,36 @@ |
|||||
|
/*
|
||||
|
This file is part of cpp-ethereum. |
||||
|
|
||||
|
cpp-ethereum is free software: you can redistribute it and/or modify |
||||
|
it under the terms of the GNU General Public License as published by |
||||
|
the Free Software Foundation, either version 3 of the License, or |
||||
|
(at your option) any later version. |
||||
|
|
||||
|
cpp-ethereum is distributed in the hope that it will be useful, |
||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
GNU General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU General Public License |
||||
|
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
/** @file JSLocalConsole.cpp
|
||||
|
* @author Marek Kotewicz <marek@ethdev.com> |
||||
|
* @date 2015 |
||||
|
* Ethereum client. |
||||
|
*/ |
||||
|
|
||||
|
#include <iostream> |
||||
|
#include <libweb3jsonrpc/WebThreeStubServer.h> |
||||
|
#include "JSLocalConsole.h" |
||||
|
#include "JSV8Connector.h" |
||||
|
|
||||
|
using namespace std; |
||||
|
using namespace dev; |
||||
|
using namespace dev::eth; |
||||
|
|
||||
|
JSLocalConsole::JSLocalConsole(WebThreeDirect& _web3, shared_ptr<AccountHolder> const& _accounts) |
||||
|
{ |
||||
|
m_jsonrpcConnector.reset(new JSV8Connector(m_engine)); |
||||
|
// m_jsonrpcServer.reset(new WebThreeStubServer(*m_jsonrpcConnector.get(), _web3, _accounts, vector<KeyPair>()));
|
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
/*
|
||||
|
This file is part of cpp-ethereum. |
||||
|
|
||||
|
cpp-ethereum is free software: you can redistribute it and/or modify |
||||
|
it under the terms of the GNU General Public License as published by |
||||
|
the Free Software Foundation, either version 3 of the License, or |
||||
|
(at your option) any later version. |
||||
|
|
||||
|
cpp-ethereum is distributed in the hope that it will be useful, |
||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
GNU General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU General Public License |
||||
|
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
/** @file JSLocalConsole.h
|
||||
|
* @author Marek Kotewicz <marek@ethdev.com> |
||||
|
* @date 2015 |
||||
|
* Ethereum client. |
||||
|
*/ |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <libjsengine/JSV8Engine.h> |
||||
|
#include <libjsengine/JSV8Printer.h> |
||||
|
#include "JSConsole.h" |
||||
|
|
||||
|
class WebThreeStubServer; |
||||
|
namespace jsonrpc { class AbstractServerConnector; } |
||||
|
|
||||
|
namespace dev |
||||
|
{ |
||||
|
namespace eth |
||||
|
{ |
||||
|
|
||||
|
class AccountHolder; |
||||
|
|
||||
|
class JSLocalConsole: public JSConsole<JSV8Engine, JSV8Printer> |
||||
|
{ |
||||
|
public: |
||||
|
JSLocalConsole(WebThreeDirect& _web3, std::shared_ptr<AccountHolder> const& _accounts); |
||||
|
virtual ~JSLocalConsole() {}; |
||||
|
|
||||
|
private: |
||||
|
std::unique_ptr<WebThreeStubServer> m_jsonrpcServer; |
||||
|
std::unique_ptr<jsonrpc::AbstractServerConnector> m_jsonrpcConnector; |
||||
|
}; |
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue