【区块链】以太坊之001

1、安装

apt-get update

apt-get install software-properties-common

add-apt-repository -y ppa:ethereum/ethereum

add-apt-repository -y ppa:ethereum/ethereum-dev

apt-get update

apt-get install ethereum

2、初始化genesis.json

{
  "config": {
        "chainId": 10,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x02000000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

basepath=$(cd `dirname $0`; pwd)

geth  --datadir "$basepath/chain" init genesis.json 

geth  --datadir "$basepath/chain" console

> personal.newAccount('jurassic')
"0x8df4fd909ae2433b98f734ab39c4357928265eda"

 

 


 

geth –targetgaslimit 4294967295 –rpc –rpcaddr “192.168.1.146” –rpcport “8101” –port “30301” –rpcapi “eth,web3,personal” –networkid 2016 –identity 2016 -nodiscover -maxpeers 5 –datadir “%cd%\chain” -unlock 0 -rpccorsdomain “*” –mine console

posted @ 2018-04-11 23:13  咸鱼翻身  阅读(146)  评论(0)    收藏  举报