以太坊私有链
用到的端口 TCP 30303 8545
sudo apt-get update
sudo apt-get installsoftware-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
apt-get install ethminer GPU挖矿工具
piccgenesis.json
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x40000",
"extraData" : "",
"gasLimit" : "0xffffffff",
"nonce" : "0x0000000000000000",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00",
"alloc": { }
}
basepath=$(cd `dirname $0`; pwd)
获取当前的目录
geth --datadir "$basepath/chain" init piccgenesis.json
创建数据存放地址并初始化创世块
geth --identity "etherum" --rpc --rpccorsdomain "*" --datadir "$basepath/chain" --port "30303" --rpcapi "db,eth,net,web3" --networkid 18 console --nodiscover
RPC
geth.exe --datadir D:\Ethereum --rpc --rpccorsdomain "*" --rpcapi "db,eth,net,web3" console --rpcaddr 0.0.0.0
json rpc
{"jsonrpc":"2.0","method":"eth_blockNumber","params":["0x5325FA1961a5ba119724956B03610C221eF40295", "latest"],"id":1}