How to deploy a smart contract on ethereum testnet?

This is a step by step tutorial for people who want to learn how to deploy a contract to ethereum testnet. More and more people are interested on smart contract development on ethereum nowadays. When I started to learn solidity, the first thing I wanted to do is to deploy a contract and see what a smart contract can do on the blockchain. Therefore I decided to write a blog to share my experience about how I deployed contracts on ethereum testnet.

1. Write a contract. In this case, we are using the simplest contract from solidity official document.

pragma solidity ^0.4.0;

contract SimpleStorage {
uint storedData;

function set(uint x) {
storedData = x;

function get() constant returns (uint) {
return storedData;

2. The testnet I’m using here is Roptsen. You can get some free ether for deploying contracts at this faucet website:

3. Using a wallet to deploy the contract. I’m using Parity for myself. There are many other options on the market. Should be very similar. For starting parity to connect with Ropsten testnet, you can use following command:

$ parity — chain ropsten — bootnodes “enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@,enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@”

open your browser at localhost:8080, you can see parity web UI:

4. Open the contract tab, click deploy button, you can fill the form to submit your contract to the testnet.

5. To complete the form, you need to get the abi / solc combined ouput for the contract. You can save the contract in a storage.sol file. Using the following command to compile this file to get the output (you might to need to install solc first):

$ solc --combined-json abi,bin storage.sol

the output is:


6. After you complete the form for deploying the contract, you can submit the deployment request to deploy it to the testnet.

7. Now you can see the deployed contract on the testnet blockchian:

Deploying smart contracts is fun. It is even more fun to interact with them on the blockchain. I usually learn more and faster when my hands get dirty. If you have any other questions, please leave your questions in the comments. Thanks!

Click more to read about smart contracts
Like what you read? Give Bleev.In a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.