Skip to content

Instantly share code, notes, and snippets.

@abdulwahidgul24085
Forked from learner-long-life/Rinkeby.md
Last active June 8, 2018 23:46
Show Gist options
  • Save abdulwahidgul24085/610597c20f0974257c5e4a6bf7f00841 to your computer and use it in GitHub Desktop.
Save abdulwahidgul24085/610597c20f0974257c5e4a6bf7f00841 to your computer and use it in GitHub Desktop.
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well, and these are even faster. I'm using this for dapp development, so I want access to all state.

From the docs above:

A full node synchronizes the blockchain by downloading the full chain from the genesis block to the current head block,
but does not execute the transactions. Instead, it downloads all the transactions receipts along with the entire recent state.
As the node downloads the recent state directly, historical data can only be queried from that block onward.

Initial processing required to synchronize is more bandwidth intensive, but is light on the CPU and has significantly reduced
disk requirements. Mid range machines with HDD storage, decent CPUs and 4GB+ RAM should be enough.

Step 1: Download Geth

First, install the latest geth (1.7.3) to your machine.

For Ubuntu, you can follow the instructions on the official wiki.

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

If you're just upgrade geth from a previous version, you can just run

sudo apt install geth

If you're downloading this to your Mac, you'll need to download the packages manually to get the latest (1.7.3) release. https://geth.ethereum.org/downloads/

Extract it and copy the geth binary to somewhere in your path.

# ppham @ Pauls-Air-2 in ~/Downloads [21:46:25]
$ tar zxvf geth-darwin-amd64-1.7.3-4bb3c89d.tar.gz
x geth-darwin-amd64-1.7.3-4bb3c89d/
x geth-darwin-amd64-1.7.3-4bb3c89d/COPYING
x geth-darwin-amd64-1.7.3-4bb3c89d/geth

# ppham @ Pauls-Air-2 in ~/Downloads [21:46:39]
$ sudo mv geth-darwin-amd64-1.7.3-4bb3c89d/geth /usr/local/bin/geth

For older releases on Mac OSX, you can use Homebrew to install from scratch:

brew install ethereum

and again if you are upgrading just geth

brew install geth

Unknown whether Parity works as well. It will probably take some finagling to work with the Geth-style Genesis block.

Step 2: Run Geth in Rinkeby Mode

At this point, you should probably start a tmux or screen session, so if you get interrupted during syncing it will still keep going in the background.

To run a full node, start Geth with the Rinkeby switch:

geth --rinkeby

SECURITY WARNINGS: We've enabled RPC and also loaded the personal module to allow testing and participating in smart contracts. However, if you do these things on a mainnet node with your unlocked wallet exposed to the internet, you could get hacked and all your monies stolen. I'll write a separate gist about a secure way to participate in a mainnet contract with real ETH.

On a MacBook Air with a 10 MBps (standard home internet download speeds), I was able to sync all 187k blocks in < 7 minutes,

Step 3: Create an account

In a separate tmux pane or screen buffer or a separate terminal completely, create an account and save the password somewhere safe.

After that, attach the console with the appropriate data directory.

On Linux it would be:

geth --datadir=$HOME/.rinkeby attach ipc:$HOME/.rinkeby/geth.ipc console

On Ubuntu Linux it would be:

geth --datadir=$HOME/.ethereum/rinkeby attach ipc:$HOME/.ethereum/rinkeby/geth.ipc console

On Mac it would be:

geth --datadir=$HOME/.rinkeby attach ipc:$HOME/Library/Ethereum/rinkeby/geth.ipc console

and create an account (substituting a much better password than notmyrealpassword).

Welcome to the Geth JavaScript console!

instance: Geth/v1.6.1-stable-021c3c28/darwin-amd64/go1.8.1
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> eth.accounts
[]
> personal.newAccount("notmyrealpassword")
"0xb2e9fe08ca9a0323103883fe12c9609ed380f475"
> eth.coinbase
"0xb2e9fe08ca9a0323103883fe12c9609ed380f475"
> eth.getBalance(eth.coinbase)
0

You'll see a different address than 0xb2e9fe08ca9a0323103883fe12c9609ed380f475. That one's mine, provided for illustration. Save your password in a secret place, preferrably encrypted. I use Evernote encrypted text, but you can use any password manager like 1Password, LastPass, Dashlane, etc.

Leave that terminal open for now.

Step 4: Request ETH

Because Kovan and Rinkeby both use Proof-of-Authority (clique) to grant ETH, you'll need to request some to get started. However, unlike Kovan which requires you to bootstrap by requesting KETH from another human being, Rinkeby has a super-slick automated faucet, where you submit your address (copied from above) into one of three methods:

  • A public tweet on Twitter
  • A public Facebook post
  • A public Google+ link

Since I never use Google+ for social reasons with humans, I might as well use this for socializing with robots.

You can go to http://plus.google.com and post publicly on any discussion board. Here's mine.

Copy this URL:

https://plus.google.com/104143092173669955154/posts/bkAkrmtukQ5

Go to the Crypto Faucet section of https://rinkeby.io and paste it into the blank.

Choose an option from the dropdown which corresponds to how much Ether you need and how frequently (requesting more Ether will take longer between requests). I requested 3 ETH in 8 hours. Don't worry, you'll get your ETH in seconds, but you can't request again for another 8 hours. This is to prevent spammers from swamping the network by overpowering it with mining power and then out-spending everyone else.

This is the transaction where I received my 3 ETH: https://rinkeby.etherscan.io/address/0x54b7bc5bea3845198ff2936761087fc488504eed

Now, back in your geth console, wait for at most 15 seconds for the next block to be found, and verify your balance again

> eth.getBalance(eth.coinbase)
3000000000000000000

Woohoo! You're rich, in testnet wei :)

If you found this guide useful, follow us on Twitter at @InvisibleLearn or join us on Slack: http://invisible-slack.herokuapp.com/

You can also leave questions, comments, or feedbacks on this gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment