Deploy Smart Contracts on Ropsten Testnet through Ethereum Remix

Moses Sam Paul
Mar 16, 2018 · 4 min read

Step-by-step guide to deploy your smart contract from the local blockchain — Ganache to Ropsten Test Net using the browser based IDE — Remix

Image for post

Context:

If you have read this tutorial you would know that the we used a local blockchain network called Ganache and used the truffle framework to deploy the smart contracts within a local test environment. This tutorial is the next step in understanding the different ets environments available to us. This post will guide you to deploy the same on ethereum remix IDE (IDE — Integrated Development Environment) on the Ropsten test net.


Things we would be using

Code

Metamask

Remix

Ropsten Test Network

You don’t have to pay real ether to interact with the ethereum blockchain but you can get a feel of the real flow from an end-user’s perspective.


All right, let’s begin.

Stage 1: Setup the Environment

Copy the election.sol (smart contract) and paste it into the remix IDE.

Image for post

To deploy the contract, we need an account and with some ether on the Rospten test net.

  • Meta mask!
  • Select Rospten Test net
Image for post
  • Create an Account
Image for post
  • Copy Account Address
Image for post
see, we have 0 ether
  • Request Free ether from here or here. Paste the copied account address in text box and click on send me 1 test ether.
Image for post
  • Ogle at your free ether :P
Image for post

So now, we have the contract pasted in remix IDE, we have connected meta mask to the ropsten testnet with an account that has some ether.


Stage 2: Deploy the contract

  • click on Run. Select Injected Web 3 Ropsten under environment and the account in Metamask is shown here under Account with balance ether as well.
Image for post
  • Change the name of the contract to anything you like
Image for post
  • Click on create -> confirm transaction
Image for post
Image for post
  • Click on Metamask extension!
Image for post
  • Click on the contract deployment — it should open up the etherscan page to look at our transaction details.
Image for post
  • HODL
Image for post
congrats, you have successfully created a smart contract!

Stage 3: Interact with the contract

Image for post
  • Pull / Access data from contract — free — shaded “blue”

If you add 1 (candidate ID) near the candidates field ..you should get the details of candidate ID 1. And 2 would give you the second candidate details.

Image for post
Image for post
remember pulling data is free on ethereum blockchain
  • Vote / add data to the chain!

Now that we know who is whom. Let’s try and Vote.

Image for post
notice the 1 next to vote
Image for post
IDE shows my transaction is pending
Image for post
after few seconds, the Metamask extension shows me the transaction details. If I click on it..it should take me to ether scan.

Transaction successful!

Image for post

If i copy my address from metamask and paste it into etherscan I can see all the transactions within etherscan

Image for post

The Green INs are the ethers that have come to me from the faucets.

The Orange OUTs are my spends. I have created the contract thrice and wrote on it once.

If I click on the first line item the vote transaction, this is what we see in etherscan.

Image for post

As you can see, the function vote was called.


That’s it guys, this is the easiest way to deploy your smart contract from a local blockchain environment (Ganache) to the Ropsten test net using the Ethereum Remix IDE.


Have you guys checked out my ten chapter learning guide on Hyperledger?


Image for post

The Startup

Medium's largest active publication, followed by +684K people. Follow to join our community.

Sign up for Top Stories

By The Startup

A newsletter that delivers The Startup's most popular stories to your inbox once a month. Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Moses Sam Paul

Written by

Bachelor: Information Technology; Master: Public Policy; Now: Growing www.heptagon.in; Building #SkillsChain; Curating @OpenHouse332

The Startup

Medium's largest active publication, followed by +684K people. Follow to join our community.

Moses Sam Paul

Written by

Bachelor: Information Technology; Master: Public Policy; Now: Growing www.heptagon.in; Building #SkillsChain; Curating @OpenHouse332

The Startup

Medium's largest active publication, followed by +684K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

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