Nodes

Last updated 23 days ago

A blockchain node is a machine running an implementation of the blockchain.

Overview

Running an Ethereum Classic node allows a user to be part of the Ethereum Classic network enabling a user or AI to:

  • Create and sign transactions

  • Manage accounts

  • Read information from the network

  • Mine ETC

  • and more...

Running an Ethereum Classic node downloads and syncs the entire blockchain to a machine. This implementation is known as a Full Node or Local Node. Since running a full node can be process intensive for some machines, users may utilize a third party implementation known as a Light Node or Remote Node.

Interactions performed on the blockchain are done through a node. Many app wallet users don't realize that their wallets submit transactions through a third party node being the wallet app provider or other party.

Why Run Your Own Node

  1. Control YOUR transactions: Utilizing your own node to perform activity on the Ethereum Classic network ensures you are in control of your activity. Using a third party node can be ideal for some users, but trust third parties at your own risk.

  2. Take Part in the ETC Network: More independent nodes ensures the security and resilience of the network, as well as increased performance such as, reduced latency.

  3. Developers! Developers! Developers!: Developers can use nodes to deploy and interact with Smart Contracts for their DApps.

How To Setup an ETC Node

Go Ethereum, commonly known as Geth or Classic Geth, is the command line interface for running an Ethereum Classic node.

Ethereum ETH and Ethereum Classic ETC both have a Geth implementation. Classic Geth simply emphasizes that we're using Ethereum Classic's Geth implementation.

Dependencies

MacOS

Dependencies

Install Homebrew package manager.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Check installation of Homebrew.

$ brew -v

Install Go programming language by downloading a binary distribution at the Go Lang. website.

Check installation of Go Lang.

$ go version

Install a C compilar (X Code).

$ xcode-select --install

Install Classic Geth

MacOS

Installing Classic Geth

Install Classic Geth using Homebrew package manager.

$ brew install ethereumproject/classic/geth

Check installation of Classic Geth

$ geth version

Update Geth (if applicable)

The Ethereum Classic protocol is always being improved and maintained by the love of the Ethereum Classic developer community. Sometimes bugs are discovered, improvements are made, features are added, etc... Upgrade geth to the latest release by running

$ brew upgrade geth

Initialize Classic Geth

Running a node downloads and syncs the Ethereum Classic blockchain. When a node is not running, it will download and sync blocks to the current state of the chain.

MacOs

Initialize Classic Geth by running geth , however consider reading on before running geth.

--fast Increase performance to sync at the cost of downloading only block state data.

--cache=VALUE Further increase performance by adjusting memory (megabytes) allowance of the database. Default is 1024 MB.

$ geth --fast --cache=1024

Running Classic Geth downloads and syncs the entire Ethereum Classic blockchain. Geth will return sync status such as:

2018-07-25 22:51:36 Sync #151305 of #6031258 36529b08 638/ 517/12 blk/txs/mgas sec 8/25 peers

When Geth has synced to the current block height, it will continue to import newest blocks.

Commands and Flags

To view commands and flags run

$ geth -h or $ geth -help or $ geth -help

Basic Usage

Default Data Directory

$HOME/Library/EthereumClassic/

File Structure

By default, geth stores node and blockchain data in parent directory depending on OS:

MacOS
Linux
Windows

$HOME/Library/EthereumClassic/

$HOME/.ethereum-classic/

$HOME/AppData/Roaming/EthereumClassic/

$ cd Library/EthereumClassic/mainnet/
$ ls
chaindata indexes log nodekey
dapp keystore mlogs nodes

You can specify the parent directory with --data-dir=$HOME/id/rather/put/it/here. This method is particularly useful if your system does not have sufficient storage to have a full implementation of the ETC blockchain.

External Storage (optional)

Running a Full Node will download and sync an implementation of the ETC blockchain which would require ~96.6 GB of mass storage and more as the blockchain grows. However, as mentioned, changing the parent directory of the node's data to an external mass storage may be desirable to some users, especially if the default machine doesn't have sufficient storage.

MacOS

Assume a user has an external storage device. E.g.: A USB hard drive named HD EXTERNAL. The user wants to use HD EXTERNAL to store the parent directory of their node.

Using geth available commands and flags, the user can specify the external storage device to store the blockchain data --data-dir=<PATH>, however this may not work alone when using an external storage device. Geth creates a geth.ipc when geth is running. This file is generated by default in /Users/$HOME/Library/EthereumClassic/geth.ipc and can be specified using --ipcpath=<PATH>.

$ geth --data-dir=/Volumes/HD EXTERNAL/ --ipcpath=/Users/$HOME/Library/EthereumClassic/geth.ipc

Now geth will download and sync using the external storage device HD EXTERNAL.

Within the parent directory, EthereumClassic/, geth uses a sub directory for each network run on the node. The defaults are:

  • /mainnet: for mainnet or main Ethereum Classic network

  • /morden: for the morden testnet

You can specify a subdirectory with --chain=mycustomnet.

Migrating: If you have existing data created prior to the 3.4 Release, geth will attempt to migrate your existing standard ETC data to this structure. To learn more about managing this migration please read our 3.4 release notes on our Releases page.

Run a Full Node by initializing geth.

$ geth

For faster download and sync

$ geth --fast --cache=<VALYE IN MEGABYTES DEFAULT 1024>

If your machine has more memory available, don't be shy to increase --cache=VALUE. This significantly increases download and sync of the blockchain.

Create and Manage Accounts

Geth is able to create, import, update, unlock, and otherwise manage your private (encrypted) key files. Key files are in JSON format and, by default, stored in the respective chain folder's /keystore directory; you can specify a custom location with the --keystore flag.

$ geth account new

This command will create a new account and prompt you to enter a passphrase to protect your account.

Other account subcommands include:

SUBCOMMANDS:
list print account addresses
new create a new account
update update an existing account
import import a private key into a new account

Learn more at the Accounts Wiki Page. If you're interested in using geth to manage a lot (~100,000+) of accounts, please visit the Indexing Accounts Wiki page.

Interact with the Javascript console

$ geth console

This command will start up Geth's built-in interactive JavaScript console, through which you can invoke all official web3methods as well as Geth's own management APIs. This too is optional and if you leave it out you can always attach to an already running Geth instance with geth attach.

Learn more at the Javascript Console Wiki page.

And so much more!

For a comprehensive list of command line options, please consult our CLI Wiki page.