Browse Source

Merge pull request #124 from msimovic/peer-command

Interactive help now has command to list peers
cl-refactor
Gav Wood 11 years ago
parent
commit
1437ff5102
  1. 8
      eth/main.cpp

8
eth/main.cpp

@ -84,6 +84,7 @@ void interactiveHelp()
<< " secret Gives the current secret" << endl << " secret Gives the current secret" << endl
<< " block Gives the current block height." << endl << " block Gives the current block height." << endl
<< " balance Gives the current balance." << endl << " balance Gives the current balance." << endl
<< " peers List the peers that are connected" << endl
<< " transact <secret> <dest> <amount> Executes a given transaction." << endl << " transact <secret> <dest> <amount> Executes a given transaction." << endl
<< " send <dest> <amount> Executes a given transaction with current secret." << endl << " send <dest> <amount> Executes a given transaction with current secret." << endl
<< " inspect <contract> Dumps a contract to <APPDATA>/<contract>.evm." << endl << " inspect <contract> Dumps a contract to <APPDATA>/<contract>.evm." << endl
@ -269,6 +270,13 @@ int main(int argc, char** argv)
cout << "Current block # " << n << endl; cout << "Current block # " << n << endl;
cout << "===" << endl; cout << "===" << endl;
} }
else if (cmd == "peers")
{
for (auto it: c.peers())
cout << it.host << ":" << it.port << ", " << it.clientVersion << ", "
<< std::chrono::duration_cast<std::chrono::milliseconds>(it.lastPing).count() << "ms"
<< endl;
}
else if (cmd == "balance") else if (cmd == "balance")
{ {
u256 balance = c.state().balance(us.address()); u256 balance = c.state().balance(us.address());

Loading…
Cancel
Save