God bless Kovan (and Parity)

September 11, 2017

Learning a new technology is always a daunting task, specially when in its early stages. Ethereum is one of such technologies and, soon enough, after starting your journey you get a lot of new terminology/projects thrown at you: Solidity, MetaMask, Mist, Serpent, Rinkeby, Ropsten, Kovan, Parity, Truffle, Geth, etc, etc.

As you start wrapping your head around some of those new concepts it is common to focus on specific parts of the whole technology. In my case, I started developing small smart contracts on Remix, and then I started learning about Truffle with testrpc. But after a while you need to start deploying your contracts to real networks: enter the _testnet_s. Ethereum has two official test networks: Ropsten and Rinkeby. There’s a third one I always ignored until today: Kovan, one that comes from another piece of tech that I also had ignored: Parity.

It turns out it is actually great!

Compared to Ropsten or Rinkeby, transactions are confirmed within seconds. For one of the dApps I’m testing, I needed to execute around a dozen transactions, which on Ropsten takes between 50 seconds and 30 minutes (even with high gas prices, say 100 Gwei)! On Kovan, the longer it takes is about 30 seconds for most transactions.

Getting started

This is all you have to do to start a new node with Kovan:

# install parity
brew install parity --stable

# start a new node with Kovan
parity --chain kovan

This will also start the RPC server to interact with the node. For people used to Geth, it seems like it does not come with a built-in, command line JS console. But if that’s your thing, you can just install web3 and point it to the node:

# install web3
npm install web3

# start a new node session
node

# import web3
Web3 = require("web3")
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

# you can know use web3 as you would when running geth console

But it gets better. You don’t really need to do the above by hand. Parity comes with a web server that has a lot of tooling around Ethereum development: http://127.0.0.1:8180 It pretty much eats MetaMask in capabilities and offers you even more.

It comes with an account manager:

acct manager

A way to query contracts:

contracts UI

A transactions signer available to any dApp:

kovan signer

It also comes with a set of very useful applications, like a browser for dApps so no need to install Mist or MetaMask (so it runs on Firefox, for instance). A Javascript console with web3 already configured. Plus so much more!

Best discovery of the day. Period.

© 2017 | Powered by Hugo