From afa5971d0624cba9bb926f9d02d68b1e69997d0c Mon Sep 17 00:00:00 2001 From: caktux Date: Thu, 26 Mar 2015 04:14:59 -0400 Subject: [PATCH] add missing commands to neth --- neth/main.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/neth/main.cpp b/neth/main.cpp index 7af96eb08..aa10c8a6f 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -127,6 +127,10 @@ void interactiveHelp() << " send Execute a given transaction with current secret." << endl << " contract Create a new contract with current secret." << endl << " inspect Dumps a contract to /.evm." << endl + << " verbosity () Gets or sets verbosity level." << endl + << " setblockfees Set the block fee profit in the reference unit e.g. ยข (Default: 15)" << endl + << " setetherprice

Resets the ether price." << endl + << " setpriority

Resets the transaction priority." << endl << " reset Resets ncurses windows" << endl << " exit Exits the application." << endl; } @@ -711,6 +715,42 @@ int main(int argc, char** argv) iss >> enable; c->setForceMining(isTrue(enable)); } + else if (c && cmd == "setblockfees") + { + iss >> blockFees; + gasPricer->setRefBlockFees(u256(blockFees * 1000)); + cout << "Block fees: " << blockFees << endl; + } + else if (c && cmd == "setetherprice") + { + iss >> etherPrice; + gasPricer->setRefPrice(u256(double(ether / 1000) / etherPrice)); + cout << "ether Price: " << etherPrice << endl; + } + else if (c && cmd == "setpriority") + { + string m; + iss >> m; + boost::to_lower(m); + if (m == "lowest") + priority = TransactionPriority::Lowest; + else if (m == "low") + priority = TransactionPriority::Low; + else if (m == "medium" || m == "mid" || m == "default" || m == "normal") + priority = TransactionPriority::Medium; + else if (m == "high") + priority = TransactionPriority::High; + else if (m == "highest") + priority = TransactionPriority::Highest; + else + try { + priority = (TransactionPriority)(max(0, min(100, stoi(m))) * 8 / 100); + } + catch (...) { + cerr << "Unknown priority: " << m << endl; + } + cout << "Priority: " << (int)priority << "/8" << endl; + } else if (cmd == "verbosity") { if (iss.peek() != -1) @@ -815,6 +855,8 @@ int main(int argc, char** argv) stringstream ssp; ssp << fields[2]; ssp >> gasPrice; + if (!gasPrice) + gasPrice = gasPricer->bid(priority); string sechex = fields[4]; string sdata = fields[5]; cnote << "Data:";