SlideShare a Scribd company logo
Installation
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
sudo apt-get install solc
Genesis
{
"nonce": ​"0xdeadbeefdeadbeef"​,
"timestamp": ​"0x00"​,
"parentHash": ​"0x0000000000000000000000000000000000000000000000000000000000000000"​,
"extraData": ​"0x686f727365"​,
"gasLimit": ​"0x08000000"​,
"difficulty": ​"0x0400"​,
"mixhash": ​"0x0000000000000000000000000000000000000000000000000000000000000000"​,
"coinbase": ​"0x3333333333333333333333333333333333333333"​,
"alloc": { },
"config": {
"homesteadBlock": ​0​,
"eip155Block": ​0​,
"eip158Block": ​0
}
}
Understanding Genesis
Create Node
geth --datadir ethdir/vijay init vijay.json
Open Geth without console
geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234
Open Geth with console
geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234 console
2>console.log
Node Info
admin.nodeInfo
List All Accounts
personal.listAccounts
eth.accounts
Check Block number
eth.blockNumber
Check block details
eth.getBlock()
Create an Account
personal.newAccount()
Start Mining
miner.start(1)
Stop Mining
miner.stop()
Unlock Account
personal.unlockAccount(eth.accounts[0])
Check Account Balance
eth.getBalance(eth.accounts[0])
Create More Accounts
Attach More Console to a Node
geth attach ipc:ethdir/vijay/geth.ipc
1. Check node info on both terminal
2. Check accounts and balances
Create More Nodes
1. Create More nodes with above commands
2. Check Node Info
3. Check accounts
4. Check block number
5. Node should be on same network
Add Peers
admin.addPeer("enode")
1. Check Node Info
2. Check Accounts
3. Check Block Number
Check Peers
admin.peers
1. Start Mining
2. Check block
3. Check miner of the block
4. Check block details
5. Check Account and balance
6. Stop mining
7. Create account on node 2
8. Repeat from 1-3
Check total Balance of the miner
eth.getBalance(eth.getBlock(eth.blockNumber).miner)
Transfer funds between them (without or without mining)
Check you have two account on node
Unlock Account before transferring funds
personal.sendTransaction({"from":eth.accounts[0], "to":eth.accounts[1], value:
web3.toWei(1.23,"ether")}, "vijay")
Will give you transaction hash
Check pending Transaction
eth.pendingTransactions
Check balance of both account
Smart Contract
ā— Open local solidity browser
ā— Create a contract in IDE
ā— Start full loaded node
geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234 --rpc
--rpcport 8545 --rpccorsdomain "*" console 2>console.log
ā— Connect to node using web3 provider
ā— Unlock your Account before deployment
Deploy Smart Contract
Create Contract with required parameter
Check block number
Check pending transaction
Start mining
Contract will be deployed will get an address of the account
DApps
Smart Contract on Geth Console
Greeter.solcĀ 
pragma solidity ^0.4.2;Ā 
contract mortal {Ā 
address owner;Ā 
function mortal() { owner = msg.sender; }Ā 
function kill() { if (msg.sender == owner) suicide(owner); }Ā 
}Ā 
contract greeter is mortal {Ā  Ā 
string greeting;Ā  Ā 
function greeter(string _greeting) public {Ā 
Ā  greeting = _greeting;Ā 
}Ā 
function newGreeting(string _greeting) public {Ā 
Ā  Modified(greeting, _greeting, greeting, _greeting);Ā 
Ā  greeting = _greeting;Ā 
}Ā  Ā 
function greet() constant returns (string) {Ā 
Ā  return greeting;Ā 
}Ā  Ā 
event Modified(Ā 
Ā  string indexed oldGreetingIdx, string indexed newGreetingIdx,Ā 
Ā  string oldGreeting, string newGreeting);Ā 
}Ā 
Ā 
Ā 
Compiling the Solidity use solcĀ 
Deploying it on geth console using below setupĀ 
Ā 
var contractInfo =Ā 
JSON.parse('{"contract_name":"Greeter","abi":[{"constant":false,"inputs":[],"name":
"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function
"},{"constant":false,"inputs":[{"name":"_greeting","type":"string"}],"name":"newGre
eting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function
"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string
"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":
"_greeting","type":"string"}],"payable":false,"stateMutability":"nonpayable","type"
:"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldGreetingIdx
","type":"string"},{"indexed":true,"name":"newGreetingIdx","type":"string"},{"index
ed":false,"name":"oldGreeting","type":"string"},{"indexed":false,"name":"newGreetin
g","type":"string"}],"name":"Modified","type":"event"}]}')Ā 
***********************************************************************Ā 
var mycontract = eth.contract(contractInfo.abi);Ā 
***********************************************************************Ā 
varĀ 
greeter=mycontract.new("vijay",{from:primaryAddress,data:"0x6060604052341561000f576
00080fd5b6040516106073803806106078339810160405280805160008054600160a060020a03191633
600160a060020a03161790559190910190506001818051610059929160200190610060565b50506100f
b565b828054600181600116156101000203166002900490600052602060002090601f01602090048101
9282601f106100a157805160ff19168380011785556100ce565b828001600101855582156100ce57918
2015b828111156100ce5782518255916020019190600101906100b3565b506100da9291506100de565b
5090565b6100f891905b808211156100da57600081556001016100e4565b90565b6104fd8061010a600
0396000f3006060604052600436106100565763ffffffff7c0100000000000000000000000000000000
00000000000000000000000060003504166341c0e1b5811461005b5780634ac0d66e14610070578063c
fae3217146100c1575b600080fd5b341561006657600080fd5b61006e61014b565b005b341561007b57
600080fd5b61006e60046024813581810190830135806020601f8201819004810201604051908101604
052818152929190602084018383808284375094965061018c95505050505050565b34156100cc576000
80fd5b6100d461037e565b6040516020808252819081018381815181526020019150805190602001908
0838360005b838110156101105780820151838201526020016100f8565b50505050905090810190601f
16801561013d5780820380516001836020036101000a031916815260200191505b50925050506040518
0910390f35b6000543373ffffffffffffffffffffffffffffffffffffffff9081169116141561018a57
60005473ffffffffffffffffffffffffffffffffffffffff16ff5b565b8060405180828051906020019
08083835b602083106101bc5780518252601f19909201916020918201910161019d565b600183602003
6101000a038019825116818451161790925250505091909101925060409150505180910390206001604
05180828054600181600116156101000203166002900480156102455780601f10610223576101008083
540402835291820191610245565b820191906000526020600020905b815481529060010190602001808
311610231575b505091505060405180910390207f047dcd1aa8b77b0b943642129c767533eeacd700c7
c1eab092b8ce05d2b2faf56001846040516040808252835460026000196101006001841615020190911
604908201819052819060208201906060830190869080156102f45780601f106102c957610100808354
0402835291602001916102f4565b820191906000526020600020905b815481529060010190602001808
3116102d757829003601f168201915b5050838103825284818151815260200191508051906020019080
838360005b8381101561032b578082015183820152602001610313565b50505050905090810190601f1
680156103585780820380516001836020036101000a031916815260200191505b509450505050506040
5180910390a3600181805161037a929160200190610427565b5050565b6103866104a5565b600180546
00181600116156101000203166002900480601f01602080910402602001604051908101604052809291
908181526020018280546001816001161561010002031660029004801561041c5780601f106103f1576
1010080835404028352916020019161041c565b820191906000526020600020905b8154815290600101
906020018083116103ff57829003601f168201915b505050505090505b90565b8280546001816001161
56101000203166002900490600052602060002090601f016020900481019282601f1061046857805160
ff1916838001178555610495565b82800160010185558215610495579182015b8281111561049557825
182559160200191906001019061047a565b506104a19291506104b7565b5090565b6020604051908101
6040526000815290565b61042491905b808211156104a157600081556001016104bd5600a165627a7a7
23058209ca1afae1366fec4a6ecbcaf13cd87569d07266c428915c3e44167b091a8bf420029", gas:Ā 
1000000});Ā 
Ā 
Ā 
******************************************Ā 
greeterĀ 
****************************************************************Ā 
Ā 
eth.getTransactionReceipt(greeter.transactionHash);Ā 
*******************************************************************Ā 
Ā 
var storageAddressĀ 
=eth.getTransactionReceipt(greeter.transactionHash).contractAddressĀ 
Ā 
Ā 
Ā 
********************************************************************Ā 
var storage = mycontract.at(storageAddress);Ā 
Ā 
Ā 
******************************************************************************Ā 

More Related Content

PPTX
Cryptography 101 for Java developers
Michel Schudel
Ā 
PPTX
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Svetlin Nakov
Ā 
PPTX
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Svetlin Nakov
Ā 
PPTX
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Svetlin Nakov
Ā 
PDF
SSL/TLS for Mortals (Devoxx FR 2018)
Maarten Mulders
Ā 
PPTX
Cryptography for Absolute Beginners (May 2019)
Svetlin Nakov
Ā 
PDF
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
MariaDB Corporation
Ā 
PDF
Reutov, yunusov, nagibin random numbers take ii
DefconRussia
Ā 
Cryptography 101 for Java developers
Michel Schudel
Ā 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Svetlin Nakov
Ā 
Blockchain Cryptography for Developers (Nakov @ BlockWorld 2018, San Jose)
Svetlin Nakov
Ā 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Svetlin Nakov
Ā 
SSL/TLS for Mortals (Devoxx FR 2018)
Maarten Mulders
Ā 
Cryptography for Absolute Beginners (May 2019)
Svetlin Nakov
Ā 
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
MariaDB Corporation
Ā 
Reutov, yunusov, nagibin random numbers take ii
DefconRussia
Ā 

What's hot (19)

PDF
Dodging WebCrypto API Landmines
Ernie Turner
Ā 
PDF
SSL/TLS for Mortals (GOTO Berlin)
Maarten Mulders
Ā 
PDF
Chrome恋悉MacBook恮TouchID恧WebAuthentication恙悋 ~Idance vol1~
5 6
Ā 
PDF
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Mathias Herberts
Ā 
PDF
"You shall not pass : anti-debug methodics"
ITCP Community
Ā 
PDF
SSL/TLS for Mortals (J-Fall)
Maarten Mulders
Ā 
PDF
SSH: Seguranca no Acesso Remoto
Tiago Cruz
Ā 
PPTX
MongoDB Days Silicon Valley: MongoDB and the Hadoop Connector
MongoDB
Ā 
PPTX
Mysql handle socket
Philip Zhong
Ā 
PDF
How to get rid of terraform plan diffs
Yukiya Hayashi
Ā 
PDF
Cisco ucs support
jamesyu_accelops
Ā 
PPTX
Cyber Security
amit bezalel
Ā 
PPTX
Compare mysql5.1.50 mysql5.5.8
Philip Zhong
Ā 
PDF
Ghost Vulnerability CVE-2015-0235
Rajivarnan (Rajiv)
Ā 
PPT
9 password security
drewz lin
Ā 
PPTX
Mysql5.1 character set testing
Philip Zhong
Ā 
ODP
Getting started with RDO Havana
Dan Radez
Ā 
PDF
iCloud keychain
Alexey Troshichev
Ā 
Dodging WebCrypto API Landmines
Ernie Turner
Ā 
SSL/TLS for Mortals (GOTO Berlin)
Maarten Mulders
Ā 
Chrome恋悉MacBook恮TouchID恧WebAuthentication恙悋 ~Idance vol1~
5 6
Ā 
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Mathias Herberts
Ā 
"You shall not pass : anti-debug methodics"
ITCP Community
Ā 
SSL/TLS for Mortals (J-Fall)
Maarten Mulders
Ā 
SSH: Seguranca no Acesso Remoto
Tiago Cruz
Ā 
MongoDB Days Silicon Valley: MongoDB and the Hadoop Connector
MongoDB
Ā 
Mysql handle socket
Philip Zhong
Ā 
How to get rid of terraform plan diffs
Yukiya Hayashi
Ā 
Cisco ucs support
jamesyu_accelops
Ā 
Cyber Security
amit bezalel
Ā 
Compare mysql5.1.50 mysql5.5.8
Philip Zhong
Ā 
Ghost Vulnerability CVE-2015-0235
Rajivarnan (Rajiv)
Ā 
9 password security
drewz lin
Ā 
Mysql5.1 character set testing
Philip Zhong
Ā 
Getting started with RDO Havana
Dan Radez
Ā 
iCloud keychain
Alexey Troshichev
Ā 
Ad

Similar to Geth important commands (20)

PPTX
Introduction to Ethereum
Arnold Pham
Ā 
PPTX
The Ethereum Geth Client
Arnold Pham
Ā 
PPTX
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Tomoaki Sato
Ā 
PDF
Build your own private blockchain based on ethereum
Mehran Pourvahab
Ā 
PDF
Blockchain Workshop - Software Freedom Day 2017
Zied GUESMI
Ā 
PDF
Javascript toolset for Ethereum Smart Contract development
BugSense
Ā 
PDF
The JavaScript toolset for development on Ethereum
GreeceJS
Ā 
PDF
Developing Blockchain Applications
malikmayank
Ā 
PDF
gething started - ethereum & using the geth golang client
Sathish VJ
Ā 
PPTX
The Blockchain and JavaScript
Portia Burton
Ā 
PPTX
Ethereum dapps20180120
Hu Kenneth
Ā 
PDF
Use Geth to Access a Deployed Contract
KC Tam
Ā 
PPTX
Ethereum
Brian Yap
Ā 
PDF
Blockchain Coding Dojo - BlockchainHub Graz
BlockchainHub Graz
Ā 
PDF
DevEx in Ethereum - a look at the developer stack
All Things Open
Ā 
PPTX
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
I.I.S. G. Vallauri - Fossano
Ā 
PDF
web3j Overview
Conor Svensson
Ā 
PPTX
The Foundation of Smart Contract Development on Ethereum
NAtional Institute of TEchnology Rourkela , Galgotias University
Ā 
PDF
Building Apps with Ethereum Smart Contract
Vaideeswaran Sethuraman
Ā 
Introduction to Ethereum
Arnold Pham
Ā 
The Ethereum Geth Client
Arnold Pham
Ā 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Tomoaki Sato
Ā 
Build your own private blockchain based on ethereum
Mehran Pourvahab
Ā 
Blockchain Workshop - Software Freedom Day 2017
Zied GUESMI
Ā 
Javascript toolset for Ethereum Smart Contract development
BugSense
Ā 
The JavaScript toolset for development on Ethereum
GreeceJS
Ā 
Developing Blockchain Applications
malikmayank
Ā 
gething started - ethereum & using the geth golang client
Sathish VJ
Ā 
The Blockchain and JavaScript
Portia Burton
Ā 
Ethereum dapps20180120
Hu Kenneth
Ā 
Use Geth to Access a Deployed Contract
KC Tam
Ā 
Ethereum
Brian Yap
Ā 
Blockchain Coding Dojo - BlockchainHub Graz
BlockchainHub Graz
Ā 
DevEx in Ethereum - a look at the developer stack
All Things Open
Ā 
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
I.I.S. G. Vallauri - Fossano
Ā 
web3j Overview
Conor Svensson
Ā 
The Foundation of Smart Contract Development on Ethereum
NAtional Institute of TEchnology Rourkela , Galgotias University
Ā 
Building Apps with Ethereum Smart Contract
Vaideeswaran Sethuraman
Ā 
Ad

More from NexThoughts Technologies (20)

PDF
Alexa skill
NexThoughts Technologies
Ā 
PDF
Docker & kubernetes
NexThoughts Technologies
Ā 
PDF
Apache commons
NexThoughts Technologies
Ā 
PDF
HazelCast
NexThoughts Technologies
Ā 
PPTX
MySQL Pro
NexThoughts Technologies
Ā 
PDF
Microservice Architecture using Spring Boot with React & Redux
NexThoughts Technologies
Ā 
PDF
Solid Principles
NexThoughts Technologies
Ā 
PDF
Arango DB
NexThoughts Technologies
Ā 
PDF
Introduction to TypeScript
NexThoughts Technologies
Ā 
PDF
Smart Contract samples
NexThoughts Technologies
Ā 
PDF
My Doc of geth
NexThoughts Technologies
Ā 
PDF
Ethereum genesis
NexThoughts Technologies
Ā 
PPTX
Springboot Microservices
NexThoughts Technologies
Ā 
PDF
An Introduction to Redux
NexThoughts Technologies
Ā 
PPTX
Google authentication
NexThoughts Technologies
Ā 
ODP
Java 9 Features
NexThoughts Technologies
Ā 
PPTX
Postgresql
NexThoughts Technologies
Ā 
Docker & kubernetes
NexThoughts Technologies
Ā 
Apache commons
NexThoughts Technologies
Ā 
Microservice Architecture using Spring Boot with React & Redux
NexThoughts Technologies
Ā 
Solid Principles
NexThoughts Technologies
Ā 
Introduction to TypeScript
NexThoughts Technologies
Ā 
Smart Contract samples
NexThoughts Technologies
Ā 
My Doc of geth
NexThoughts Technologies
Ā 
Ethereum genesis
NexThoughts Technologies
Ā 
Springboot Microservices
NexThoughts Technologies
Ā 
An Introduction to Redux
NexThoughts Technologies
Ā 
Google authentication
NexThoughts Technologies
Ā 
Java 9 Features
NexThoughts Technologies
Ā 

Recently uploaded (20)

PDF
Doc9.....................................
SofiaCollazos
Ā 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
Ā 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
Ā 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
Ā 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
Ā 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
Ā 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
Ā 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
Ā 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
Ā 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
Ā 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
Ā 
PDF
Software Development Methodologies in 2025
KodekX
Ā 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
Ā 
PDF
The Future of Artificial Intelligence (AI)
Mukul
Ā 
Doc9.....................................
SofiaCollazos
Ā 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
Ā 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
Brief History of Internet - Early Days of Internet
sutharharshit158
Ā 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
Ā 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
Ā 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
Ā 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
Ā 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
Ā 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
Ā 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
Ā 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
Ā 
Software Development Methodologies in 2025
KodekX
Ā 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
Ā 
The Future of Artificial Intelligence (AI)
Mukul
Ā 

Geth important commands

  • 1. Installation sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum sudo apt-get install solc Genesis { "nonce": ​"0xdeadbeefdeadbeef"​, "timestamp": ​"0x00"​, "parentHash": ​"0x0000000000000000000000000000000000000000000000000000000000000000"​, "extraData": ​"0x686f727365"​, "gasLimit": ​"0x08000000"​, "difficulty": ​"0x0400"​, "mixhash": ​"0x0000000000000000000000000000000000000000000000000000000000000000"​, "coinbase": ​"0x3333333333333333333333333333333333333333"​, "alloc": { }, "config": { "homesteadBlock": ​0​, "eip155Block": ​0​, "eip158Block": ​0 } } Understanding Genesis Create Node geth --datadir ethdir/vijay init vijay.json Open Geth without console geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234 Open Geth with console geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234 console 2>console.log Node Info admin.nodeInfo
  • 2. List All Accounts personal.listAccounts eth.accounts Check Block number eth.blockNumber Check block details eth.getBlock() Create an Account personal.newAccount() Start Mining miner.start(1) Stop Mining miner.stop() Unlock Account personal.unlockAccount(eth.accounts[0]) Check Account Balance eth.getBalance(eth.accounts[0]) Create More Accounts Attach More Console to a Node geth attach ipc:ethdir/vijay/geth.ipc 1. Check node info on both terminal 2. Check accounts and balances Create More Nodes 1. Create More nodes with above commands 2. Check Node Info 3. Check accounts 4. Check block number 5. Node should be on same network
  • 3. Add Peers admin.addPeer("enode") 1. Check Node Info 2. Check Accounts 3. Check Block Number Check Peers admin.peers 1. Start Mining 2. Check block 3. Check miner of the block 4. Check block details 5. Check Account and balance 6. Stop mining 7. Create account on node 2 8. Repeat from 1-3 Check total Balance of the miner eth.getBalance(eth.getBlock(eth.blockNumber).miner) Transfer funds between them (without or without mining) Check you have two account on node Unlock Account before transferring funds personal.sendTransaction({"from":eth.accounts[0], "to":eth.accounts[1], value: web3.toWei(1.23,"ether")}, "vijay") Will give you transaction hash Check pending Transaction eth.pendingTransactions Check balance of both account Smart Contract ā— Open local solidity browser ā— Create a contract in IDE ā— Start full loaded node geth --datadir ethdir/vijay/ --ethash.dagdir ethdag/ --networkid 1234 --rpc --rpcport 8545 --rpccorsdomain "*" console 2>console.log ā— Connect to node using web3 provider ā— Unlock your Account before deployment Deploy Smart Contract Create Contract with required parameter Check block number
  • 4. Check pending transaction Start mining Contract will be deployed will get an address of the account DApps
  • 5. Smart Contract on Geth Console Greeter.solcĀ  pragma solidity ^0.4.2;Ā  contract mortal {Ā  address owner;Ā  function mortal() { owner = msg.sender; }Ā  function kill() { if (msg.sender == owner) suicide(owner); }Ā  }Ā  contract greeter is mortal {Ā  Ā  string greeting;Ā  Ā  function greeter(string _greeting) public {Ā  Ā  greeting = _greeting;Ā  }Ā  function newGreeting(string _greeting) public {Ā  Ā  Modified(greeting, _greeting, greeting, _greeting);Ā  Ā  greeting = _greeting;Ā  }Ā  Ā  function greet() constant returns (string) {Ā  Ā  return greeting;Ā 
  • 6. }Ā  Ā  event Modified(Ā  Ā  string indexed oldGreetingIdx, string indexed newGreetingIdx,Ā  Ā  string oldGreeting, string newGreeting);Ā  }Ā  Ā  Ā  Compiling the Solidity use solcĀ  Deploying it on geth console using below setupĀ  Ā  var contractInfo =Ā  JSON.parse('{"contract_name":"Greeter","abi":[{"constant":false,"inputs":[],"name": "kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function "},{"constant":false,"inputs":[{"name":"_greeting","type":"string"}],"name":"newGre eting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function "},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string "}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name": "_greeting","type":"string"}],"payable":false,"stateMutability":"nonpayable","type" :"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldGreetingIdx ","type":"string"},{"indexed":true,"name":"newGreetingIdx","type":"string"},{"index ed":false,"name":"oldGreeting","type":"string"},{"indexed":false,"name":"newGreetin g","type":"string"}],"name":"Modified","type":"event"}]}')Ā  ***********************************************************************Ā  var mycontract = eth.contract(contractInfo.abi);Ā  ***********************************************************************Ā  varĀ  greeter=mycontract.new("vijay",{from:primaryAddress,data:"0x6060604052341561000f576 00080fd5b6040516106073803806106078339810160405280805160008054600160a060020a03191633 600160a060020a03161790559190910190506001818051610059929160200190610060565b50506100f b565b828054600181600116156101000203166002900490600052602060002090601f01602090048101 9282601f106100a157805160ff19168380011785556100ce565b828001600101855582156100ce57918 2015b828111156100ce5782518255916020019190600101906100b3565b506100da9291506100de565b 5090565b6100f891905b808211156100da57600081556001016100e4565b90565b6104fd8061010a600 0396000f3006060604052600436106100565763ffffffff7c0100000000000000000000000000000000 00000000000000000000000060003504166341c0e1b5811461005b5780634ac0d66e14610070578063c fae3217146100c1575b600080fd5b341561006657600080fd5b61006e61014b565b005b341561007b57 600080fd5b61006e60046024813581810190830135806020601f8201819004810201604051908101604 052818152929190602084018383808284375094965061018c95505050505050565b34156100cc576000 80fd5b6100d461037e565b6040516020808252819081018381815181526020019150805190602001908 0838360005b838110156101105780820151838201526020016100f8565b50505050905090810190601f 16801561013d5780820380516001836020036101000a031916815260200191505b50925050506040518 0910390f35b6000543373ffffffffffffffffffffffffffffffffffffffff9081169116141561018a57 60005473ffffffffffffffffffffffffffffffffffffffff16ff5b565b8060405180828051906020019 08083835b602083106101bc5780518252601f19909201916020918201910161019d565b600183602003 6101000a038019825116818451161790925250505091909101925060409150505180910390206001604 05180828054600181600116156101000203166002900480156102455780601f10610223576101008083 540402835291820191610245565b820191906000526020600020905b815481529060010190602001808 311610231575b505091505060405180910390207f047dcd1aa8b77b0b943642129c767533eeacd700c7 c1eab092b8ce05d2b2faf56001846040516040808252835460026000196101006001841615020190911 604908201819052819060208201906060830190869080156102f45780601f106102c957610100808354 0402835291602001916102f4565b820191906000526020600020905b815481529060010190602001808 3116102d757829003601f168201915b5050838103825284818151815260200191508051906020019080 838360005b8381101561032b578082015183820152602001610313565b50505050905090810190601f1 680156103585780820380516001836020036101000a031916815260200191505b509450505050506040 5180910390a3600181805161037a929160200190610427565b5050565b6103866104a5565b600180546 00181600116156101000203166002900480601f01602080910402602001604051908101604052809291
  • 7. 908181526020018280546001816001161561010002031660029004801561041c5780601f106103f1576 1010080835404028352916020019161041c565b820191906000526020600020905b8154815290600101 906020018083116103ff57829003601f168201915b505050505090505b90565b8280546001816001161 56101000203166002900490600052602060002090601f016020900481019282601f1061046857805160 ff1916838001178555610495565b82800160010185558215610495579182015b8281111561049557825 182559160200191906001019061047a565b506104a19291506104b7565b5090565b6020604051908101 6040526000815290565b61042491905b808211156104a157600081556001016104bd5600a165627a7a7 23058209ca1afae1366fec4a6ecbcaf13cd87569d07266c428915c3e44167b091a8bf420029", gas:Ā  1000000});Ā  Ā  Ā  ******************************************Ā  greeterĀ  ****************************************************************Ā  Ā  eth.getTransactionReceipt(greeter.transactionHash);Ā  *******************************************************************Ā  Ā  var storageAddressĀ  =eth.getTransactionReceipt(greeter.transactionHash).contractAddressĀ  Ā  Ā  Ā  ********************************************************************Ā  var storage = mycontract.at(storageAddress);Ā  Ā  Ā  ******************************************************************************Ā