For good amount of time we have heard about Bitcoin (BTC), Ethereum (ETH), LiteCoin(LTC), ZCash(zec), etc list goes on. Technology behind this cryptocurrency is blcokchain. I guess most you you might have heard of this decentralized, public ledger. As a technology enthusiast i am very much attracted to this piece of technology. Today i'm writing how to do Etherum setup on your own Local machine.
Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.
Pre - requisite
Node.JS > 8.x — To run NPM based packages [latest stable version is recommended ]
Python > 2.6 < 3.0 — To build the truffle framework as python version 3+ is not supported at the time of writing this article.Install Ethereum
- Install on windows
https://github.com/ethereum/go-ethereum/wiki/Installation-instructions-for-Windows - Install on mac
https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Mac - Install on Linux machine
https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Ubuntu
- Install on windows
Install Ethereum Wallet (Mist)
To store, accept and send ether, you need a wallet. Download the latest release of mist wallet @ given link:
https://github.com/ethereum/mist/releasesChoose Ethereum-Wallet for your system
after you launch you will see this screen:
Once the node is fully synced, you’ll be asked to choose the network.
Connect to test net and create new account
- Open mist wallet menu → develop → select test net
- Menu → new account → provide pass phrase
Note — Post account creation you will notice the hash code of account
choose password for your mist wallet:
Note: Protect your account with a strong password. Put in the strong password and remember it. Seriously! You cannot EVER change the password of this account once it’s created. So, remember the password.
finally mist installation is over and your wallet is here:
Test Ethers
You either pre-generate or mine your own ether on a private test net. It is more cost effective way of trying out Ethereum and you can avoid having to mine or find Morden test ether.Create a Json file (CustomGenesis.json)
{ “nonce”: “0x0000000000000042”, “timestamp”: “0x0”, “parentHash”: “0x0000000000000000000000000000000000000000000000000000000000000000”, “extraData”: “0x0”, “gasLimit”: “0x8000000”, “difficulty”: “0x400”, “mixhash”: “0x0000000000000000000000000000000000000000000000000000000000000000”, “coinbase”: “0x3333333333333333333333333333333333333333”, “alloc”: { “YOUR_PUBLIC_ADDRESS” : 3000000 } }
Initialize the geth with json file form terminal
geth init CustomGenesis.json
Smart Contract — Deploy
A smart contract is a computerized transaction protocol that executes the terms of a contract.
Let’s try to deploy a smart contract.
Go to Mist wallet → select an account (left panel) → click on contract → new contract → in text area copy and paste below code. → select contract name as Hello world → click on deploy`
pragma solidity ^0.4.16;
contract MyWallet {
uint public balance;
function MyWallet() public {
balance = 100;
}
function deposit(uint amt) public {
balance += amt;
}
function getBalance() public view returns(uint) {
return balance;
}
} `
Note — Please note your Ethereum should be working on local machine with test net. Start mining before deploys the code. (From mist wallet → develop → start mining)
7 Execute smart Contract
After successful deploy click on contact. Select a method to execute. Select deposit the amount to account. You will see there is a new transaction created for this and check balance.
We have successfully set up Ethereum on your local machine.
Congratulations @jayshah007! You received a personal award!
Click here to view your Board
Do not miss the last post from @steemitboard:
Congratulations @jayshah007! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!