以太币私有链搭建教程

sudo apt-get update

sudo apt-get install software-properties-common

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

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

sudo apt-get update

sudo apt-get install ethereum

geth #启动

创始块配置文件 piccgenesis.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"
}
geth  --datadir "Your/Path" init piccgenesis.json

创建数据存放地址并初始化创世块

geth --identity "YourName"  --rpc  --rpccorsdomain "*" --datadir "Your/Path" --port "30303"  --rpcapi "db,eth,net,web3" --networkid  95518  console

#如果nohup 请去掉 console

从第二个节点连接。创建目录并将piccgenesis.json拷贝进去。

geth --datadir . init ./piccgenesis.json  #初始化目录
geth --datadir . --networkid 95518 --ipcdisable --port 61911 --rpcport 8101 --bootnodes "enode://8a0127669dc890530d868aa2a08efaff12933c885da21882ed935f563b7cdb7aa3497aa24807bc348c143017dba4c4433d97e64571a1962e257726a7c0725ed8@172.18.100.205:8888" console

创建账号

personal.newAccount()

#启动挖矿
miner.start()

#查看账户余额,不为零即已经在挖矿了
eth.getBalance(eth.accounts[0])

显卡挖矿

下载二进制安装包

https://github.com/ethereum-mining/ethminer/releases

或(注意两种安装方式的命令不一样,请  -h 查看)

apt-get install ethminer
ethminer -G

解锁账户

personal.unlockAccount("0x00530bc8552639fd8479c22f403e84fe5e98896f","===pwd===")

转账3以太币

eth.sendTransaction({from:"0x00530bc8552639fd8479c22f403e84fe5e98896f",to:"0xa6993059b5a31e53f4df0e84a59ccf13abf86b86",value:web3.toWei(3,"ether")})

矿池挖矿

./ethminer --farm-recheck 2000 -G -S us2.ethpool.org:3333 -FS us1.ethpool.org:3333 -O 0x550ce8f9cacae8d5137feb704fbfa45e213bcd30