/ BLOCKCHAIN, ETHEREUM

Starting with Ethereum - Setup

Many people know about Bitcoin, because of its recent rise (and soon crash?). However, Bitcoin is just a currency, albeit a crypto one. As such, it’s of very limited interest to me. But it’s based on the concept of blockchain and that seems to be much more interesting. While there are a lot of resources available on the Web regarding blockchain, they mainly focus on the concept of blockchain, or how it works internally, not so much on how you can as a developer use it.

This is the first post in what I hope will be a serie which aims at correcting that. The blockchain implementation I’ll be using will be Ethereum because it’s an already established technology, with a mature ecosystem around it.

This post will describe how to setup the whole tooling around Ethereum, and lay the foundations of the posts to come.

The Wallet

The wallet is the first step when you want to start working with Ethereum. It’s called a wallet because it does hold the Ethereum currency - called ether. It also holds other custom assets - called tokens.

Ethereum provides such a wallet, just download it from the home page. This software also allows to deploy and run smart contracts.

For Mac users, there’s also a Homebrew recipe. To install, type:

brew cask install ethereum-wallet

Once installed, launch the application. A network needs to be chosen: choose "Rinkeby" which is a test network. At this point, the blockchain is copied locally. Wait…​

The Ethereum blockchain being copied

Then, an account needs to be created. Choose a password.

Wallet with an account configured

Get funds

Whatever your stance regarding it, money is at the foundation of the world. In Ethereum, this is no different. On the production network, you’d need to buy ethers from a broker. On "Rinkeby" which is a playground network, one can just ask for ethers.

Go on https://faucet.rinkeby.io and follow instructions to receive ethers. You basically have to post your wallet public key on a social network - to prevent abuse. The rate by which one can ask for ethers is also limited, to prevent abuse.

Requesting ethers for the Rinkeby network

Funds should be available soon after the post has been published on the social network of your choice. Check your account, you should be richer.

The rate limit is:

  • 3 ethers every 8 hour
  • 7.5 ethers per day
  • or 18.75 ethers every 3 days

Astute readers might notice that it’s better to ask for less, but then more often (3 ether * 8 hours * 3 times * 3 days = 72 ethers).

The balance can also be checked on etherscan.io. Just replace the last segment of the URL path with your account public key.

Export/import accounts

Chances are you will have multiple computers, or you will change computer, or even change software. As such, it’s very important to be able to export/import accounts.

Exporting

Within the Ethereum wallet, go to File  Backup  Accounts. On OSX, this translates to ~/Library/Ethereum/rinkeby/keystore. There should be one keystore file, starting with UTC, which name matches the public key (the one posted on social media previously). Its content is in JSON format.

Importing

Another available wallet for Ethereum is Metamask, available as a dedicated browser or a Chrome extension.

  1. Install the Chrome extension - it can be uninstalled just afterwards
  2. Locate the extension in the browser bar
  3. Locate the Account button - it’s the second rightmost one
  4. Choose Import Account
  5. In Select Type, choose JSON File
  6. Point to the above file
  7. Type your account password

At this point, MetaMask should also display your account and its balance. Notice it’s the same account public key and the same balance.

Account imported in MetaMask
Nicolas Fränkel

Nicolas Fränkel

Nicolas Fränkel is a Software Architect with 15 years experience consulting for many different customers, in a wide range of contexts (such as telecoms, banking, insurances, large retail and public sector). Usually working on Java/Java EE and Spring technologies, but with narrower interests like Software Quality, Build Processes and Rich Internet Applications. Currently working for an eCommerce solution vendor leader. Also double as a teacher in universities and higher education schools, a trainer and triples as a book author.

Read More