Skip to content

Using Ethereum CLI Client

Gav Wood edited this page Jan 31, 2014 · 4 revisions

Ethereum (++) is the C++ proof-of-concept Ethereum command-line client. There is also a proof-of-concept Ethereum Qt-based client; you might want to see Using-AlephZero.

Ethereum (++) can be executed by typing eth. It has several command-line switches to customise its behaviour, but in general it will attempt to connect to another peer or seed-node (they're the same thing, really), then become a functioning node in the network, collect transactions, blocks and peers and mining new blocks.

Usage

/path/to/eth [options] [remote-host]

-l <port> Specify the port on which to listen for incoming connections (default: 30303).

-u <ip> Specify the public IP address of this host (i.e. the address that is visible to its peers). Defaults to the node's internet address; if you're setting up a LAN test net, you'll want to set this to the LAN IP (e.g. 192.168.0.10 or something similar).

-r <ip> Specify the remote host's IP address on which to connect (required if you want to connect). Note this can also be done without the -r switch.

-p <port> Specify the remote host's port on which to connect (default: 30303).

-a <hex address> Specify the coinbase address for this node. If it mines a block, it's this address that gets the reward!

-s <hex secret> Specify the secret key for this node (the address defaults to this).

-d <path> Specify the database path for this node. Two nodes cannot use the same database. Defaults to $(HOME)/.ethereum.

-m on | off Specify whether the node should mine or not (default: on).

-v 0-9 Specify the verbosity level of the node. 0 is quiet (default: 4).

-x <quantity> Specify how many peers this node should ideally be connected to (default: 5).

-o full | peer Specify whether this node should be a full node or just a peer server (default: full).

Starting a Peer Server

/path/to/eth -m off -o peer -u 65.78.90.42 -x 256

This starts the node as a peer-server with internet-visible IP 65.78.90.42, able to accept up to 256 peers and share connection information between them. As more than 256 peers get connected, the older peers (that have had a chance to gather peer information of their own) will get disconnected to make way for the newer crowd.

/path/to/eth -u 192.168.0.5 -p 30301 192.168.0.10

This starts a full node on the local client (whose IP is 192.168.0.5) and attempts to connect the LAN peer 192.168.0.10 on port 30301.

cd /tmp
mkdir client1
/path/to/eth -d client1 -u 127.0.0.1 -l 30303 &
mkdir client2
/path/to/eth -d client2 -u 127.0.0.1 -p 30300 127.0.0.1

This creates two full clients on the same host, possible because the databases are stored in different paths, and connects them together. One listens on the local host on port 30303, and the other on 30300.

Clone this wiki locally