Browse Source

Everything using PoC servers.

cl-refactor
Gav Wood 11 years ago
parent
commit
5633006e2f
  1. 2
      alethzero/MainWin.cpp
  2. 21
      eth/main.cpp
  3. 1
      third/MainWin.cpp

2
alethzero/MainWin.cpp

@ -97,10 +97,10 @@ Main::Main(QWidget *parent) :
// ui->log->addItem(QString::fromStdString(s)); // ui->log->addItem(QString::fromStdString(s));
}; };
m_servers.append(QString::fromStdString(Host::pocHost() + ":30303"));
#if ETH_DEBUG #if ETH_DEBUG
m_servers.append("localhost:30303"); m_servers.append("localhost:30303");
#endif #endif
m_servers.append(QString::fromStdString(Host::pocHost() + ":30303"));
cerr << "State root: " << BlockChain::genesis().stateRoot << endl; cerr << "State root: " << BlockChain::genesis().stateRoot << endl;
cerr << "Block Hash: " << sha3(BlockChain::createGenesisBlock()) << endl; cerr << "Block Hash: " << sha3(BlockChain::createGenesisBlock()) << endl;

21
eth/main.cpp

@ -99,6 +99,7 @@ void help()
<< "Usage eth [OPTIONS] <remote-host>" << endl << "Usage eth [OPTIONS] <remote-host>" << endl
<< "Options:" << endl << "Options:" << endl
<< " -a,--address <addr> Set the coinbase (mining payout) address to addr (default: auto)." << endl << " -a,--address <addr> Set the coinbase (mining payout) address to addr (default: auto)." << endl
<< " -b,--bootstrap Connect to the default Ethereum peerserver." << endl
<< " -c,--client-name <name> Add a name to your client's version string (default: blank)." << endl << " -c,--client-name <name> Add a name to your client's version string (default: blank)." << endl
<< " -d,--db-path <path> Load database from path (default: ~/.ethereum " << endl << " -d,--db-path <path> Load database from path (default: ~/.ethereum " << endl
<< " <APPDATA>/Etherum or Library/Application Support/Ethereum)." << endl << " <APPDATA>/Etherum or Library/Application Support/Ethereum)." << endl
@ -134,17 +135,8 @@ string credits(bool _interactive = false)
if (_interactive) if (_interactive)
{ {
string vs = toString(dev::Version);
vs = vs.substr(vs.find_first_of('.') + 1)[0];
int pocnumber = stoi(vs);
string m_servers;
if (pocnumber == 4)
m_servers = "54.72.31.55";
else
m_servers = "54.72.69.180";
cout << "Type 'netstart 30303' to start networking" << endl; cout << "Type 'netstart 30303' to start networking" << endl;
cout << "Type 'connect " << m_servers << " 30303' to connect" << endl; cout << "Type 'connect " << Host::pocHost() << " 30303' to connect" << endl;
cout << "Type 'exit' to quit" << endl << endl; cout << "Type 'exit' to quit" << endl << endl;
} }
return cout.str(); return cout.str();
@ -188,6 +180,7 @@ int main(int argc, char** argv)
int jsonrpc = 8080; int jsonrpc = 8080;
#endif #endif
string publicIP; string publicIP;
bool bootstrap = false;
bool upnp = true; bool upnp = true;
bool useLocal = false; bool useLocal = false;
bool forceMining = false; bool forceMining = false;
@ -264,6 +257,8 @@ int main(int argc, char** argv)
return -1; return -1;
} }
} }
else if (arg == "-b" || arg == "--bootstrap")
bootstrap = true;
else if (arg == "-f" || arg == "--force-mining") else if (arg == "-f" || arg == "--force-mining")
forceMining = true; forceMining = true;
else if (arg == "-i" || arg == "--interactive") else if (arg == "-i" || arg == "--interactive")
@ -317,7 +312,11 @@ int main(int argc, char** argv)
cout << "Address: " << endl << toHex(us.address().asArray()) << endl; cout << "Address: " << endl << toHex(us.address().asArray()) << endl;
web3.startNetwork(); web3.startNetwork();
web3.connect(remoteHost, remotePort);
if (bootstrap)
web3.connect(Host::pocHost());
if (remoteHost.size())
web3.connect(remoteHost, remotePort);
#if ETH_JSONRPC #if ETH_JSONRPC
auto_ptr<EthStubServer> jsonrpcServer; auto_ptr<EthStubServer> jsonrpcServer;

1
third/MainWin.cpp

@ -100,6 +100,7 @@ Main::Main(QWidget *parent) :
connect(ui->ourAccounts->model(), SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), SLOT(ourAccountsRowsMoved())); connect(ui->ourAccounts->model(), SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), SLOT(ourAccountsRowsMoved()));
m_web3.reset(new WebThreeDirect("Third", getDataDir() + "/Third", false, {"eth", "shh"})); m_web3.reset(new WebThreeDirect("Third", getDataDir() + "/Third", false, {"eth", "shh"}));
m_web3->connect(Host::pocHost());
connect(ui->webView, &QWebView::loadStarted, [this]() connect(ui->webView, &QWebView::loadStarted, [this]()
{ {

Loading…
Cancel
Save