Running an Ethereum Node
While the TestRPC is great for beginners, to truly understand the Ethereum blockchain, you should run your own node. Only through your own node can you examine the blocks and access all the functionalities the blockchain offers. In this section, I will discuss how to run a node on the Ethereum public network. It requires a significant amount of computing resources, such as a 24/7 available server and Internet connection, as well as at least a few hundred gigabytes of disk space to store the blockchain data. If you are on a development team (e.g., in a company), it is sufficient to run a single node for all the team members to access. To get started, download the official Ethereum client software GETH to your computer.
https://geth.ethereum.org/downloads/
The official GETH program is written in the GO programming language. It is simply a compiled binary executable program that you can run from the command line.
$ geth version Geth Version: 1.7.1-stable
If you start GETH with all the default options, you will be connected to the public Ethereum blockchain. To start the node in noninteractive node and keep it running in the background after the current user logs out, use NOHUP.
$ nohup geth &
It will take hours and many gigabytes of RAM and disk space to download and sync the entire blockchain history. So, it is probably a good idea to start GETH on the official Ethereum test network. That will cut down on the initial startup time and resources significantly, but still you need to prepare to wait for several hours even to sync the testnet.
$ geth --testnet --fast
As I mentioned earlier in this section, you need only one running Ethereum node for the entire development team. The GETH client on the running Ethereum node manages its own keystore on the machine’s local file system. All the accounts created through this node will have their private keys stored in this file, and each private key will be protected by a passphrase. The keystore file is located in the following directories. You can copy the keystore file to another node and access the accounts from the new node. You can also extract the private key from the keystore and sign your transactions to access the account from any node on the Ethereum blockchain network.
Linux: ~/.ethereum/keystore
Mac: /Library/Ethereum/keystore
Windows: %APPDATA%/Ethereum
Companies like INFURA (https://infura.io/) provide public Ethereum nodes on the Internet. This saves you the trouble and significant resources required by running a node. However, the public nodes cannot store private keys for security reasons. Specifically, you have to use signed transactions to access accounts.