Skip to content

Instantly share code, notes, and snippets.

@alfonsodev
Created October 5, 2017 18:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfonsodev/d30c672e854920a35e60691eac175ceb to your computer and use it in GitHub Desktop.
Save alfonsodev/d30c672e854920a35e60691eac175ceb to your computer and use it in GitHub Desktop.
Ethereum hello world

Ethereum

Following this video ---> https://www.youtube.com/watch?v=T3X7hfltr8c

Instalar geth desde

https://ethereum.github.io/go-ethereum/downloads/

descomprimir y copiar a /usr/local/bin/geth
! ojo que lo tengas en el path

Instalar una Wallet llamada Mist

https://github.com/ethereum/mist/releases/tag/v0.9.0 https://github.com/ethereum/mist/releases/download/v0.9.0/Ethereum-Wallet-macosx-0-9-0.dmg

and isntall it ok, so mist wallet is the same than ethereum wallet :D

run geth

running geth, opens a go-ethereum node. control-c to c

Genesis block

Before starting you need a genesis block

{
    "alloc" : {
        "0x0000000000000000000000000000000000000000000000000000000000000001": {"balance": "111111111111111111111111"},
        "0x0000000000000000000000000000000000000000000000000000000000000002": {"balance": "222222222222222222222222"},
    },
    "coinbase" : "0x0000000000000000000000000000000000000001",
    "difficulty" : "0x1",
    "extraData" : "0x00",
    "gasLimit" : "0x47e7c5",
    "nonce" : "0x0000000000000042",
    "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "config": {
        "chainId": 88888,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "timestamp" : "0x00",
}

iniciar

geth --datadir ./chaindata init genesis.json

start server

geth --datedir ./chaindata

attach

geth attach

If you have this error Fatal: Unable to attach to remote geth: dial unix /Users/alfonso/Library/Ethereum/geth.ipc: connect: no such file or directory

You need to point to the ipc file.

geth attach ipc://Users/alfonso/code/example/chaindata/geth.ipc

Open Mist (Ethereum wallet) to use private network

ethereum/mist#1693

To be able to pass the ipc parameter, we need to open it from command line

/Applications/Ethereum\ Wallet.app/Contents/MacOS/Ethereum\ Wallet --rpc ./chaindata/geth.ipc

Minar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment