gething started - ethereum & using the geth golang client

44 %
56 %
Information about gething started - ethereum & using the geth golang client

Published on December 23, 2016

Author: SathishVJ


1. gething started geth= golang + blockchain + ethereum sathishvj

2. Talk Set: Utils and Projects in Go ● Identify interesting tools and projects in Go ○ As opposed to focusing only on the language ● Highlight big/awesome projects and inform dev audience it was written in Go ● Encourage open source contribution in Go ● Promote daily use tools written in Go ● SFO searches Go; BLR searches JSP ○ Courtesy: stackoverflow research data ● For orgs shifting to Go, make available a wider developer pool

3. Blockchain Intro quick highlights of blockchain, ethereum

4. Blockchain A blockchain is a distributed database that maintains a continuously growing list of records called blocks secured from tampering and revision. Each block contains a timestamp and a link to a previous block. 4See my more elaborate talk at GDG DevFest:

5. Transactions & Blocks 5

6. Bitcoin A distributed, decentralized, digital cryptocurrency that relies on Blockchain technology. 6

7. Ethereum A blockchain-based distributed computing platform, featuring smart contract functionality. It provides a decentralized virtual machine that can execute peer-to-peer contracts using a cryptocurrency called ether. 7

8. Blockchain : Bitcoin : Ethereum Core Tech Gen 1: Special Purpose Apps Next Gen: Platform for Apps 8

9. Ethereum Clients What all are available?

10. Ethereum Clients ● Multiple clients based on Ethereum Yellow Paper ● In Go, Rust, C++, Python, JavaScript, etc. ● The Go based Ethereum client is called geth ● Got a dedicated website recently ○ ● Can also be used a library ○ In Mobiles ○

11. Geth Usage ● Largest ethereum client is the go client, geth ● Most versions used are up to date, > 1.5.3

12. Miners in India ● About 100 nodes ● Mostly using geth

13. Ethereum & DApps Architecture Components - Current and Future

14. Ethereum, Swarm, Whisper ● Contracts: decentralized logic ● Swarm: decentralized storage ● Whisper: decentralized messaging

15. Tech Components ● DApp: Distributed Application ● Solidity: a language to write contracts on ethereum ● web3: a library to interact with ethereum blockchain (web3.eth). Contains other objects like (web3.shh for Whisper) ● Import web3.js in your browser to interact with the blockchain ● General term web3 ○ No one definition ○ Multiple meanings in books and magazines ○ Here, it signifies an always “on”, distributed web, capable of massive scale

16. PoW to PoS, Casper & Tendermint ● Strategies to arrive at consensus in a distributed network ● Proof of Work expends too much energy. ● PoW is skewed towards those who can spend more money. ● Proof of Stake puts a certain number of coins to give one a chance to mine. ○ More egalitarian. Greater security with more participating nodes. ● Casper: scenarios where little to no assumptions should be made on the altruism of users or validators, e.g. public blockchains. ● Tendermint: scenarios where participants have existing trust or where chance of attack is less, e.g. consortium or private/hybrid blockchains

17. Using Geth Demo & Cmds to use the geth client

18. Project Links ● Github: ● Releases: ● Downloads: ● Main site: ● Install command line tools:

19. Installing Geth ● Bundled as a part of GUI tools like Mist/Ethereum-Wallet ● Installable from source ● Install with package manager ○ Homebrew, apt-get ● From standalone pre-built bundle

20. From Pre-built Bundle ● My Demo Setup: Google Compute Engine, small VM, Ubuntu, attached and mounted disk of 100GB ● wget -1.5.5-ff07d548.tar.gz ○ Check for latest version at ● tar -xvf geth-alltools-linux-amd64-1.5.5-ff07d548.tar.gz ● cd geth-alltools-linux-amd64-1.5.5-ff07d548 ● ./geth ○ This default command will start an ethereum client node ○ Mining is not automatic/default ● Add geth to PATH if you want

21. Ethereum Account ● Your unique id on the Ethereum platform ○ A number like 0x2f2c... ● Online services can provide you an ethereum account (like email) ○,,, etc. ● You can also setup your own account ● For convenience, use the GUIs Mist/Ethereum-Wallet ○ Electron based, cross platform Dapp browser/Wallet ● Or use cmd line ● geth account list ○ Account #0: {...key...} /home/ethmine/.ethereum/keystore/UTC--2016-12-16T19-26-20.479741815Z--[key]

22. New Ethereum Account with Geth ● geth account new Your new account is locked with a password. Please give a password. Do not forget this password. Passphrase: Repeat Passphrase: Address: {2fcb....} ● geth account list ● Any number of accounts can be created.

23. Backup Keystore and Password ● When you run your own node, backup your keystore and password ○ Imagine if you ran your own email server ● There is no way you can get to your account otherwise ● Locations on OSs ○ Windows: C:Usersusername%appdata%RoamingEthereumkeystore ○ Linux: ~/.ethereum/keystore ○ Mac: ~/Library/Ethereum/keystore ● Backup entire keystore folder … ● Or individual files that look like UTC--2016-12-03T18-26-12.919550734Z--key

24. Starting a Node ● You will need about 50GB of space as of now ● geth --datadir mydatadir --keystore ~/.ethereum ○ Datadir contains the blockchain data ○ I wanted the datadir to be on a different mount point ● A full sync in the beginning takes quite some time (a few days on a 1v-cpu, 1GB machine) ... ● Speed it up on first sync by using the --fast option ○ This finished in many minutes ○ Cannot mine with just the fast sync

25. Exporting and Importing Chaindata ● Export & import existing blockchain data from existing sync-d node ● To export to binary format ○ geth export <filename> ● To import from binary format ○ geth export <filename>

26. Attaching UI to Node ● When UI starts, it checks for a running node ● If it exists, UI attaches to node ● If not, UI starts a node ○ Default is geth ○ Can configure others ● If you want to have a particular client … ○ Start the ethereum client on cmd line ○ Then start Mist or Ethereum-Wallet UI 1 2

27. Dir Structure $ find mydatadir -maxdepth 2 mydatadir mydatadir/geth mydatadir/geth/chaindata mydatadir/geth/nodes mydatadir/geth/LOCK mydatadir/geth/nodekey mydatadir/geth.ipc $ find ~/.ethereum/ -maxdepth 2 .ethereum/ .ethereum/history .ethereum/keystore .ethereum/keystore/UTC--2016-12-16T1 9-26-20.479741815Z--[your key]

28. Mining ● Run your ethereum node as a miner with --mine option ● To be a miner, you need at least one account, the ‘etherbase’ account

29. Coinbase/Etherbase Account ● If you mine a block, you get a reward of ETHs ● This is added to your ‘etherbase’ account ○ In bitcoin it is ‘coinbase’. Not to be confused with a company of the same name ● By default it is account ‘0’ ○ … as listed in geth account list ● But you can specify another one ● --mine option without etherbase set will error out

30. geth console ● An interactive javascript console where you can do ‘web3’ programming ● Start with ○ geth console ● Exit with Ctrl+D or with >exit ● Attach to another running geth instance with ○ geth attach ● Then you can use console functions on one terminal while, say, sync logs show on the other ● If running in a specific dir, ○ geth attach mydatadir/geth.ipc

31. Console commands ● miner.start() ● miner.stop() ● admin.datadir ● net.peerCount ● admin.peers ● web3.fromWei(eth.getBalance(eth.coinbase), "ether") ● personal.newAccount("password") ● personal.listAccounts

32. Thank you Questions

33. References ● Ethereum fundraiser infogram, with ether supply: ●

34. Investing in Ethereum Can we invest in it like Bitcoin or the Share Market?

35. Cryptocurrency Investments ● Extremely volatile in general ● Some gigantic wins; many large losses ● Ether is the token/currency (ETH) ○ <1$ -> ~20$ -> 7.5$ ○ Was $1B+ Market cap, but lower now ● Very strong technology ● Very good, responsive, knowledgeable, open team ● Very positive sentiment ● Many new, popular projects on Ethereum platform ● Long term investors using current lows to enter

36. Price and Market Cap

37. Ether Supply ● of-ether The issuance model is not fixed yet. It is an ongoing discussion whether or not the costs for the consensus needs to be financed by inflation that basically taxes every coin holder or if transaction fees are sufficient. Please note that the costs for secure consensus are much lower with Casper compared to current proof of work. More details here For this reason it is guaranteed, that the current issuance amount will not be increased and might even drop to 0. Another ongoing discussion is whether or not issues of new coins should be used to fund ongoing development. A prerequisites for this would be a DAO with a widely accepted mechanism to control spending of funds effectively. But also in this case the newly issued coins would not increase. 60 million + 12 million + 18million = ~90million 60 million - is the Pre-sale. 12 million - is the dev fund, 0.2coins per 1 coin sold in the crowdsale. ~18 million - 1 million coins mined per month for 18 months prior to going from POW to POS. inflation After a while, 15,626,576 ether won't represent much of the total ether available, making the system dis-inflationary (i.e., inflation perpetually trending towards 0 but never reaching it).

Add a comment