The Wayback Machine - https://web.archive.org/web/20200919085104/https://github.com/palashgdev/HelloEthereum
Skip to content
master
Go to file
Code
This branch is 8 commits behind shubhamoy:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Hello Ethereum

It is the simplest implementation of Smart Contract to get a quick hands-on with the intricacies of ethereum development.

  • Build and interact with a smart contract
  • Test the smart contract
  • Visualise everything using Ganache

How to begin?

  1. Install truffle $> npm install -g truffle
  2. Download ganache from (https://truffleframework.com/ganache)
  3. Run Ganache
  4. Clone this repo $> git clone https://github.com/shubhamoy/HelloEthereum
  5. $> truffle migrate --network ganache
  6. After completion of the above command, switch to Ganache and it should show the contract creation and contract calls.

Interact with the Smart Contract

  1. Open Truffle Console and connect it to Ganache $> truffle console --network ganache
  2. Create instance of the smart contract truffle(ganache)> Election.deployed().then((instance) => { app=instance })
  3. Get the vote count truffle(ganache)> app.count()
  4. Call the upvote method truffle(ganache)> app.upvote({from: web3.eth.accounts[1]})
  5. Call the upvote method truffle(ganache)> app.upvote({from: web3.eth.accounts[2]})
  6. Finally, check the vote count value truffle(ganache)> app.count()

Testing the Smart Contract

  1. Test Cases ./test/Election_Test.js
  2. Test the contract $>truffle test --network ganache

Troubleshoot

  1. If you are unable to connect to Ganache, then after running Ganache check for the host and port. In case, it isn't running on http://localhost:7545 then update the truffle.js file with the new host and port details.
  2. For any other problem, please raise an issue.

Contact

me[at]shubhamoy[dot]com

About

A quick hands-on experience with Ethereum Smart Contract Development

Topics

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.