Nathan Williams, far left, collaborates with his ArcTouch colleagues during a recent blockchain hackathon. The team built a blockchain proof-of-concept using Ethereum and Microsoft’s Azure.

How to Set Up a Private Ethereum Blockchain in 20 Minutes

Every year, ArcTouch brings together its employees for a three-day hackathon, where groups set out to prototype an idea using new and emerging technologies. This year, we had many blockchain hackathon projects — and we think this speaks to both the growing interest in blockchain by our staff and the potential for companies to benefit from it.

Step 1: Install Ethereum and geth

sudo apt-get install software-properties-common 
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

Step 2: Generate the authority account and transaction account

You’ll generate two accounts — the first of which will be the authority account, and the second will be a prefunded account that can be used to send transactions to the network:

geth --datadir .ethereum/ account new 
> Address: {6203bb870bfb79438b827de3d6b0070d4d2a5f7b}
geth --datadir .ethereum/ account new
> Address: {1808adc011f6e970943d3f28f4d285053d9140ac}

Step 3: Create the genesis block

Using puppeth, a CLI tool released with geth 1.6, create and export the definition for your genesis block:

puppeth
...
Please specify a network name to administer (no spaces, please)
> clique
...
What would you like to do? (default = stats)
1. Show network stats
2. Configure new genesis
3. Track new remote server
4. Deploy network components
> 2
Which consensus engine to use? (default = clique)
1. Ethash - proof-of-work
2. Clique - proof-of-authority
> 2
How many seconds should blocks take? (default = 15)
> 15
Which accounts are allowed to seal? (mandatory at least one)
> 0x6203bb870bfb79438b827de3d6b0070d4d2a5f7b
> 0x
Which accounts should be pre-funded? (advisable at least one)
> 0x1808adc011f6e970943d3f28f4d285053d9140ac
> 0x
Specify your chain/network ID if you want an explicit one (default = random)
> 42
INFO [02-15|18:24:03] Configured new genesis block
What would you like to do? (default = stats)
1. Show network stats
2. Manage existing genesis
3. Track new remote server
4. Deploy network components
> 2
1. Modify existing fork rules
2. Export genesis configuration
3. Remove genesis configuration
> 2
Which file to save the genesis into? (default = clique.json)
> genesis.json
INFO [02-15|18:24:22] Exported existing genesis block

Step 4: Start your private Ethereum instance

Initialize and start your authority geth instance:

geth --datadir .ethereum/ init genesis.json geth --nodiscover --networkid 42 --datadir .ethereum/ --unlock 0x6203bb870bfb79438b827de3d6b0070d4d2a5f7b --mine --rpc --rpcapi eth,net,web3 --rpcaddr

Result: A functional Ethereum blockchain

The above process takes about 20 minutes, and results in a fully functional, private PoA Ethereum blockchain in the cloud. This environment is ideal for decentralized application (DApp) proof-of-concept development, and provides fast and free transactions.

Wondering how blockchain can help your business?

BlockFirst blockchain development from ArcTouch helps companies transform their business processes through decentralized apps and ledger technology. We offer free consultations — just contact us.

We help companies forge meaningful connections with their customers and employees through lovable apps and digital products. Learn more at arctouch.com.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store