From 5633006e2fe2e623f690275208f2abc5eda4a067 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 20 Sep 2014 08:15:41 -0500 Subject: [PATCH] Everything using PoC servers. --- alethzero/MainWin.cpp | 2 +- eth/main.cpp | 21 ++++++++++----------- third/MainWin.cpp | 1 + 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index f940a2961..8d8d4b854 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -97,10 +97,10 @@ Main::Main(QWidget *parent) : // ui->log->addItem(QString::fromStdString(s)); }; - m_servers.append(QString::fromStdString(Host::pocHost() + ":30303")); #if ETH_DEBUG m_servers.append("localhost:30303"); #endif + m_servers.append(QString::fromStdString(Host::pocHost() + ":30303")); cerr << "State root: " << BlockChain::genesis().stateRoot << endl; cerr << "Block Hash: " << sha3(BlockChain::createGenesisBlock()) << endl; diff --git a/eth/main.cpp b/eth/main.cpp index 215350c09..58b3b6d05 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -99,6 +99,7 @@ void help() << "Usage eth [OPTIONS] " << endl << "Options:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl + << " -b,--bootstrap Connect to the default Ethereum peerserver." << endl << " -c,--client-name Add a name to your client's version string (default: blank)." << endl << " -d,--db-path Load database from path (default: ~/.ethereum " << endl << " /Etherum or Library/Application Support/Ethereum)." << endl @@ -134,17 +135,8 @@ string credits(bool _interactive = false) 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 'connect " << m_servers << " 30303' to connect" << endl; + cout << "Type 'connect " << Host::pocHost() << " 30303' to connect" << endl; cout << "Type 'exit' to quit" << endl << endl; } return cout.str(); @@ -188,6 +180,7 @@ int main(int argc, char** argv) int jsonrpc = 8080; #endif string publicIP; + bool bootstrap = false; bool upnp = true; bool useLocal = false; bool forceMining = false; @@ -264,6 +257,8 @@ int main(int argc, char** argv) return -1; } } + else if (arg == "-b" || arg == "--bootstrap") + bootstrap = true; else if (arg == "-f" || arg == "--force-mining") forceMining = true; else if (arg == "-i" || arg == "--interactive") @@ -317,7 +312,11 @@ int main(int argc, char** argv) cout << "Address: " << endl << toHex(us.address().asArray()) << endl; web3.startNetwork(); - web3.connect(remoteHost, remotePort); + + if (bootstrap) + web3.connect(Host::pocHost()); + if (remoteHost.size()) + web3.connect(remoteHost, remotePort); #if ETH_JSONRPC auto_ptr jsonrpcServer; diff --git a/third/MainWin.cpp b/third/MainWin.cpp index 5e147bbda..be8420426 100644 --- a/third/MainWin.cpp +++ b/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())); m_web3.reset(new WebThreeDirect("Third", getDataDir() + "/Third", false, {"eth", "shh"})); + m_web3->connect(Host::pocHost()); connect(ui->webView, &QWebView::loadStarted, [this]() {