当前位置:首页 » 《资源分享》 » 正文

HECO使用docker部署单节点的开发网_J_Lee

8 人参与  2021年10月22日 11:43  分类 : 《资源分享》  评论

点击全文阅读


文章目录

  • 一. 编写说明
    • 1.1 文档说明
    • 1.2 配置信息
    • 1.3 部署文档信息
  • 二.heco开发网镜像生成
  • 三.heco主链容器生成
    • 3.1 配置文件编写
    • 3.2 预先创建一个账户地址
    • 3.3 创建genesis.json
    • 3.4 初始化geth
    • 3.5 启动geth
    • 3.6 启动挖矿
  • 四.控制台指令使用
  • 五.rpc命令使用
    • 5.1当前燃气价格
    • 5.2 返回客户端拥有的地址列表
    • 5.3 返回给定地址的帐户的余额
    • 5.4 转账
    • 5.5 根据交易哈希查询交易信息
    • 5.6 从这个地址发送的交易数量的整数
    • 5.7 查询最新区块高度
    • 5.8 根据区块高度获取区块信息
    • 5.9 根据区块哈希获取区块信息
    • 5.10 根据区块哈希查询当前区块里的交易数
    • 5.11 根据区块高度查询当前区块里的交易数

前两天更新了一篇heco(火币生态链)主网链部署
,因为我们有转账等功能的测试需求,使用主网测试这些功能不太合适,利用测试网进行测试,每次币的申请也很难受,于是今天这篇帖子带你部署HECO的开发网,搞定你的测试需求。


一. 编写说明

1.1 文档说明

  • 文档内容
通过本文档对HECO使用docker进行单节点及多节点部署过程进行描述
  • 部署服务
服务器程序默认端口
127.0.0.1HECO开发网节点(HECO)rpc接口:8545
p2p接口:30303

1.2 配置信息

  • 硬件配置
服务器系统:Centos7+
CPU:8核
内存:16GB
硬盘:SSD 500 GB
网络:千兆网卡
  • 软件环境
Docker:19.03.11

注意:软件使用版本不强制使用与上面一样的版本

1.3 部署文档信息

  • heco官网:https://www.hecochain.com/zh-cn/
  • heco链github地址:https://github.com/HuobiGroup/huobi-eco-chain/releases
  • 主网区块链浏览器:https://hecoinfo.com/
  • 主网链官方部署文档:https://docs.hecochain.com/#/dev/install
  • heco主网相关信息:https://docs.hecochain.com/#/mainnet
  • 手续费(gasprice):https://tc.hecochain.com/price/prediction
  • 创世文件介绍:https://docs.hecochain.com/#/genesis
  • 开发者文档:https://docs.hecochain.com/#/

二.heco开发网镜像生成

  • 下载heco主链基础镜像
docker pull buildpack-deps:jessie-curl
  • 编写Dockerfile
FROM buildpack-deps:jessie-curl
RUN wget -P /usr/local/bin/ https://github.com/HuobiGroup/huobi-eco-chain/releases/download/v1.1.1/geth-linux-amd64 && mv /usr/local/bin/geth-linux-amd64 /usr/local/bin/geth && chmod +x /usr/local/bin/geth
EXPOSE 8545 8546 30303 30303/udp 
WORKDIR /data
ENTRYPOINT ["geth"]
  • 生成heco主链镜像
docker build . -t huobi-eco:v1.1.1

注:需要在与Dockerfile同一级目录下执行此命令

  • 查看是否生成镜像
# docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
huobi-eco               v1.1.1              aebed661188b        49 minutes ago      200MB

三.heco主链容器生成

3.1 配置文件编写

参考 https://github.com/HuobiGroup/huobi-eco-chain-docs/blob/master/dev/deploy.md

[Eth]
SyncMode = "fast"
DiscoveryURLs = []
TrieCleanCacheRejournal= 300000000000

[Eth.Miner]
GasFloor = 8000000
GasCeil = 8000000
GasPrice = 0
Recommit = 3000000000
Noverify = false

[Eth.Ethash]
CacheDir = "ethash"
CachesInMem = 2
CachesOnDisk = 3
CachesLockMmap = false
DatasetDir = "/data/heco/.ethash"
DatasetsInMem = 1
DatasetsOnDisk = 2
DatasetsLockMmap = false
PowMode = 0

[Eth.TxPool]
Locals = []
NoLocals = false
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1
PriceBump = 10
AccountSlots = 16
GlobalSlots = 4096
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000

[Node]
DataDir = "/data/heco"
InsecureUnlockAllowed = true
NoUSB = true
IPCPath = "geth.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8545
HTTPCors = ["*"]
HTTPVirtualHosts = ["*"]
HTTPModules = ['eth', 'net', 'web3']

WSHost = "0.0.0.0"
WSPort = 8546
WSModules = ['eth', 'net', 'web3']

GraphQLVirtualHosts = ["localhost"]


[Node.P2P]
MaxPeers = 50
NoDiscovery = false

ListenAddr = ":32668"
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000

geth.toml 文件可创建在/opt/docker/heco-private

3.2 预先创建一个账户地址

使用MetaMask或者其他工具预先创建一个账户地址,并保存好私钥,后面这个地址会配置在初始的Validators中,并用做boot节点启动挖矿coinbase地址

3.3 创建genesis.json

参考 https://docs.hecochain.com/#/genesis

根据需要修改特定的字段,常规的比如

  • chainId 修改为自己的独有链id
  • extraData 修改为预先创建的地址
  • alloc中的0xdaf88b74fca1246c6144bc846aaa3441ed095191修改为初始资金接收地址,balance根据业务需要,计算相应预先发行数量(精度18位)的16进制

对于共识参数,可以根据需要再做修改

"congress": {
    "period": 3, // 出块间隔(秒)
    "epoch": 200 // 出块顺序刷新间隔(块数)
}

genesis.json 文件创建

{
  "config": {
    "chainId": 1024,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "muirGlacierBlock": 0,
    "congress": {
      "period": 3,
      "epoch": 200
    }
  },
  "nonce": "0x0",
  "timestamp": "0x5fc58968", 
  "extraData": "0x00000000000000000000000000000000000000000000000000000000000000006e60f5243e1a3f0be3f407b5afe9e5395ee82aa20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x280de80",
  "difficulty": "0x1",  
  "alloc": {
    "6e60f5243e1a3f0be3f407b5afe9e5395ee82aa2": {  
      "balance": "0xe2949abe875abae1600000"  
    },
    "000000000000000000000000000000000000F000": {
      "balance":"0x0",
      "code": "0x6080604052600436106101e25760003560e01c80638a11d7c911610102578063b6c8851911610095578063d6c0edad11610064578063d6c0edad14610e90578063db78dd2814610e98578063efd8d8e214610eca578063f2888dbb14610edf576101e2565b8063b6c8851914610b5c578063be64569214610e21578063c253c38414610e36578063c967f90f14610e64576101e2565b8063a224cee7116100d1578063a224cee7146106be578063a406fcb714610739578063a43569b314610904578063afeea11514610b47576101e2565b80638a11d7c9146105495780638b0e9f3f1461061157806398e3b626146106265780639de7025814610659576101e2565b806340a141ff1161017a5780636846992a116101495780636846992a146103e35780636969a25c146104935780637f4f95fa146104bd57806382bd3d9214610516576101e2565b806340a141ff1461033c5780634b3d500b146103715780635dd095901461039b5780636233be5d146103ce576101e2565b8063222d3b05116101b6578063222d3b051461029b57806326476204146102ce5780633a061bd3146102f457806340550a1c14610309576101e2565b8062362a77146101e75780631303f7cf1461022e578063158ef93e146102555780631b5e358c1461026a575b600080fd5b3480156101f357600080fd5b5061021a6004803603602081101561020a57600080fd5b50356001600160a01b0316610f12565b604080519115158252519081900360200190f35b34801561023a57600080fd5b5061024361117a565b60408051918252519081900360200190f35b34801561026157600080fd5b5061021a611180565b34801561027657600080fd5b5061027f611189565b604080516001600160a01b039092168252519081900360200190f35b3480156102a757600080fd5b5061021a600480360360208110156102be57600080fd5b50356001600160a01b031661118f565b61021a600480360360208110156102e457600080fd5b50356001600160a01b03166113b4565b34801561030057600080fd5b5061027f6117df565b34801561031557600080fd5b5061021a6004803603602081101561032c57600080fd5b50356001600160a01b03166117e5565b34801561034857600080fd5b5061036f6004803603602081101561035f57600080fd5b50356001600160a01b0316611840565b005b34801561037d57600080fd5b5061027f6004803603602081101561039457600080fd5b5035611988565b3480156103a757600080fd5b5061036f600480360360208110156103be57600080fd5b50356001600160a01b03166119af565b3480156103da57600080fd5b5061027f611a08565b3480156103ef57600080fd5b5061036f6004803603604081101561040657600080fd5b810190602081018135600160201b81111561042057600080fd5b82018360208201111561043257600080fd5b803590602001918460208302840111600160201b8311171561045357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250611a0e915050565b34801561049f57600080fd5b5061027f600480360360208110156104b657600080fd5b5035611c55565b3480156104c957600080fd5b506104f8600480360360408110156104e057600080fd5b506001600160a01b0381358116916020013516611c62565b60408051938452602084019290925282820152519081900360600190f35b34801561052257600080fd5b5061021a6004803603602081101561053957600080fd5b50356001600160a01b0316611c9f565b34801561055557600080fd5b5061057c6004803603602081101561056c57600080fd5b50356001600160a01b0316611f03565b6040516001600160a01b03881681526020810187600481111561059b57fe5b60ff16815260200186815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156105f75781810151838201526020016105df565b505050509050019850505050505050505060405180910390f35b34801561061d57600080fd5b5061024361234c565b34801561063257600080fd5b5061021a6004803603602081101561064957600080fd5b50356001600160a01b0316612352565b34801561066557600080fd5b5061066e6123a4565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106aa578181015183820152602001610692565b505050509050019250505060405180910390f35b3480156106ca57600080fd5b5061036f600480360360208110156106e157600080fd5b810190602081018135600160201b8111156106fb57600080fd5b82018360208201111561070d57600080fd5b803590602001918460208302840111600160201b8311171561072e57600080fd5b509092509050612407565b34801561074557600080fd5b5061021a600480360360c081101561075c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561078657600080fd5b82018360208201111561079857600080fd5b803590602001918460018302840111600160201b831117156107b957600080fd5b919390929091602081019035600160201b8111156107d657600080fd5b8201836020820111156107e857600080fd5b803590602001918460018302840111600160201b8311171561080957600080fd5b919390929091602081019035600160201b81111561082657600080fd5b82018360208201111561083857600080fd5b803590602001918460018302840111600160201b8311171561085957600080fd5b919390929091602081019035600160201b81111561087657600080fd5b82018360208201111561088857600080fd5b803590602001918460018302840111600160201b831117156108a957600080fd5b919390929091602081019035600160201b8111156108c657600080fd5b8201836020820111156108d857600080fd5b803590602001918460018302840111600160201b831117156108f957600080fd5b509092509050612768565b34801561091057600080fd5b506109376004803603602081101561092757600080fd5b50356001600160a01b0316612d74565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019080838360005b8381101561098457818101518382015260200161096c565b50505050905090810190601f1680156109b15780820380516001836020036101000a031916815260200191505b5086810385528a5181528a516020918201918c019080838360005b838110156109e45781810151838201526020016109cc565b50505050905090810190601f168015610a115780820380516001836020036101000a031916815260200191505b5086810384528951815289516020918201918b019080838360005b83811015610a44578181015183820152602001610a2c565b50505050905090810190601f168015610a715780820380516001836020036101000a031916815260200191505b5086810383528851815288516020918201918a019080838360005b83811015610aa4578181015183820152602001610a8c565b50505050905090810190601f168015610ad15780820380516001836020036101000a031916815260200191505b50868103825287518152875160209182019189019080838360005b83811015610b04578181015183820152602001610aec565b50505050905090810190601f168015610b315780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b348015610b5357600080fd5b5061066e6131a8565b348015610b6857600080fd5b5061021a600480360360a0811015610b7f57600080fd5b810190602081018135600160201b811115610b9957600080fd5b820183602082011115610bab57600080fd5b803590602001918460018302840111600160201b83111715610bcc57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610c1e57600080fd5b820183602082011115610c3057600080fd5b803590602001918460018302840111600160201b83111715610c5157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610ca357600080fd5b820183602082011115610cb557600080fd5b803590602001918460018302840111600160201b83111715610cd657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610d2857600080fd5b820183602082011115610d3a57600080fd5b803590602001918460018302840111600160201b83111715610d5b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610dad57600080fd5b820183602082011115610dbf57600080fd5b803590602001918460018302840111600160201b83111715610de057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613208945050505050565b348015610e2d57600080fd5b506102436133ad565b348015610e4257600080fd5b50610e4b6133ba565b6040805192835260208301919091528051918290030190f35b348015610e7057600080fd5b50610e796133cf565b6040805161ffff9092168252519081900360200190f35b61036f6133d4565b348015610ea457600080fd5b50610ead613574565b6040805167ffffffffffffffff9092168252519081900360200190f35b348015610ed657600080fd5b50610ead61357b565b348015610eeb57600080fd5b5061021a60048036036020811015610f0257600080fd5b50356001600160a01b0316613581565b600033816001600160a01b038416600090815260016020526040902054600160a01b900460ff166004811115610f4457fe5b1415610f8d576040805162461bcd60e51b815260206004820152601360248201527215985b1a59185d1bdc881b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b6001600160a01b03838116600090815260016020526040902054811690821614610fe85760405162461bcd60e51b815260040180806020018281038252602e8152602001806148f9602e913960400191505060405180910390fd5b6001600160a01b0383166000908152600160205260409020600901544361708090910111156110485760405162461bcd60e51b815260040180806020018281038252605c81526020018061476c605c913960600191505060405180910390fd5b6001600160a01b038316600090815260016020526040902060070154806110b6576040805162461bcd60e51b815260206004820152601a60248201527f596f7520646f6e2774206861766520616e792070726f66697473000000000000604482015290519081900360640190fd5b6001600160a01b0384166000908152600160205260408120600781019190915543600990910155801561111b576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611119573d6000803e3d6000fd5b505b816001600160a01b0316846001600160a01b03167f51a69b4502f660774c9339825c7b5adbf0b8622289134647e29728ec5d9b3bb98342604051808381526020018281526020019250505060405180910390a36001925050505b919050565b60065481565b60005460ff1681565b61f00181565b3360008181526002602090815260408083206001600160a01b0386168452825280832060019092528220549192918390600160a01b900460ff1660048111156111d457fe5b141561121d576040805162461bcd60e51b81526020600482015260136024820152721d985b1a59185d1bdc881b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b6001810154611273576040805162461bcd60e51b815260206004820152601960248201527f596f75206861766520746f20756e7374616b6520666972737400000000000000604482015290519081900360640190fd5b436201518067ffffffffffffffff1682600101540111156112c55760405162461bcd60e51b81526004018080602001828103825260218152602001806147c86021913960400191505060405180910390fd5b8054611313576040805162461bcd60e51b8152602060048201526018602482015277596f7520646f6e2774206861766520616e79207374616b6560401b604482015290519081900360640190fd5b80546000808355600183018190556040516001600160a01b0385169183156108fc02918491818181858888f19350505050158015611355573d6000803e3d6000fd5b50846001600160a01b0316836001600160a01b03167fa70cd94070cd852339a76b32cf2d95a3c8f2a322269163d276071c1c149556198342604051808381526020018281526020019250505060405180910390a3506001949350505050565b6000805460ff166113fb576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b333460016001600160a01b038516600090815260016020526040902054600160a01b900460ff16600481111561142d57fe5b1480611466575060026001600160a01b038516600090815260016020526040902054600160a01b900460ff16600481111561146457fe5b145b6114a15760405162461bcd60e51b815260040180806020018281038252602d815260200180614850602d913960400191505060405180910390fd5b6007546040805163416259d960e11b81526001600160a01b038781166004830152915191909216916382c4b3b2916024808301926020929190829003018186803b1580156114ee57600080fd5b505afa158015611502573d6000803e3d6000fd5b505050506040513d602081101561151857600080fd5b50516115555760405162461bcd60e51b815260040180806020018281038252603881526020018061489e6038913960400191505060405180910390fd5b6001600160a01b03808316600090815260026020908152604080832093881683529290522060010154156115ba5760405162461bcd60e51b815260040180806020018281038252602281526020018061482e6022913960400191505060405180910390fd5b6001600160a01b0384166000908152600160208190526040909120908101546801bc16d674ec800000906115f4908463ffffffff6139d916565b1015611647576040805162461bcd60e51b815260206004820152601860248201527f5374616b696e6720636f696e73206e6f7420656e6f7567680000000000000000604482015290519081900360640190fd5b6001600160a01b038084166000908152600260209081526040808320938916835292905220546116c057600a810180546001600160a01b038086166000818152600260208181526040808420958d1684529481529382200184905560018401855593845292200180546001600160a01b03191690911790555b60018101546116d5908363ffffffff6139d916565b600182015560028154600160a01b900460ff1660048111156116f357fe5b1461170a57805460ff60a01b1916600160a11b1781555b611718858260010154613a3c565b6001600160a01b0380841660009081526002602090815260408083209389168352929052205461174e908363ffffffff6139d916565b6001600160a01b038085166000908152600260209081526040808320938a1683529290522055600554611787908363ffffffff6139d916565b6005556040805183815242602082015281516001600160a01b0380891693908716927fb9ba725934532316cffe10975da6eb25ad49c2d1c294d982c46c9f8d684ee075929081900390910190a3506001949350505050565b61f00081565b6000805b60035481101561183757826001600160a01b03166003828154811061180a57fe5b6000918252602090912001546001600160a01b0316141561182f576001915050611175565b6001016117e9565b50600092915050565b3361f0011461188d576040805162461bcd60e51b815260206004820152601460248201527350756e69736820636f6e7472616374206f6e6c7960601b604482015290519081900360640190fd5b6001600160a01b0381166000908152600160205260409020600701546118b282613cd6565b60045460011015611984576118c682613dfa565b600754604080516315ea278160e01b81526001600160a01b038581166004830152915191909216916315ea27819160248083019260209291908290030181600087803b15801561191557600080fd5b505af1158015611929573d6000803e3d6000fd5b505050506040513d602081101561193f57600080fd5b50506040805182815242602082015281516001600160a01b038516927fa26de7ab324eac08c596549f421e5c8741213d237d2e9a2c9c0ebde0a7a849fe928290030190a25b5050565b6004818154811061199557fe5b6000918252602090912001546001600160a01b0316905081565b3361f001146119fc576040805162461bcd60e51b815260206004820152601460248201527350756e69736820636f6e7472616374206f6e6c7960601b604482015290519081900360640190fd5b611a0581613cd6565b50565b61f00281565b334114611a4f576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b4360009081526009602090815260408083206001845290915290205460ff1615611ac0576040805162461bcd60e51b815260206004820152601a60248201527f56616c696461746f727320616c72656164792075706461746564000000000000604482015290519081900360640190fd5b60005460ff16611b06576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b80804381611b1057fe5b0615611b56576040805162461bcd60e51b815260206004820152601060248201526f426c6f636b2065706f6368206f6e6c7960801b604482015290519081900360640190fd5b43600090815260096020908152604080832060018085529252909120805460ff191690911790558251611bc7576040805162461bcd60e51b815260206004820152601460248201527356616c696461746f722073657420656d7074792160601b604482015290519081900360640190fd5b8251611bda9060039060208601906145d3565b507feacea8f3c22f06c0b18306bdb04d0a967255129e8ce0094debb0a0ff89d006b5836040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015611c3d578181015183820152602001611c25565b505050509050019250505060405180910390a1505050565b6003818154811061199557fe5b6001600160a01b03918216600090815260026020818152604080842094909516835292909252919091208054600182015491909201549192909190565b60003361f00214611cf0576040805162461bcd60e51b815260206004820152601660248201527550726f706f73616c20636f6e7472616374206f6e6c7960501b604482015290519081900360640190fd5b60005460ff16611d36576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b60036001600160a01b038316600090815260016020526040902054600160a01b900460ff166004811115611d6657fe5b14158015611da2575060046001600160a01b038316600090815260016020526040902054600160a01b900460ff166004811115611d9f57fe5b14155b15611daf57506001611175565b60046001600160a01b038316600090815260016020526040902054600160a01b900460ff166004811115611ddf57fe5b1415611ea057600854604080516363e1d45160e01b81526001600160a01b038581166004830152915191909216916363e1d4519160248083019260209291908290030181600087803b158015611e3457600080fd5b505af1158015611e48573d6000803e3d6000fd5b505050506040513d6020811015611e5e57600080fd5b5051611ea0576040805162461bcd60e51b815260206004820152600c60248201526b18db19585b8819985a5b195960a21b604482015290519081900360640190fd5b6001600160a01b038216600081815260016020908152604091829020805460ff60a01b1916600160a01b179055815142815291517fd8b2c426ec1be69ca7583d26b1e893946e3227430d3ebc3bd64d9e1c469cb4009281900390910190a2919050565b6000806000806000806060611f16614638565b6001600160a01b038981166000908152600160209081526040918290208251610100810190935280549384168352919290830190600160a01b900460ff166004811115611f5f57fe5b6004811115611f6a57fe5b815260200160018201548152602001600282016040518060a0016040529081600082018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120215780601f10611ff657610100808354040283529160200191612021565b820191906000526020600020905b81548152906001019060200180831161200457829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120c35780601f10612098576101008083540402835291602001916120c3565b820191906000526020600020905b8154815290600101906020018083116120a657829003601f168201915b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f810183900483028501830190915280845293810193908301828280156121555780601f1061212a57610100808354040283529160200191612155565b820191906000526020600020905b81548152906001019060200180831161213857829003601f168201915b505050918352505060038201805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529382019392918301828280156121e95780601f106121be576101008083540402835291602001916121e9565b820191906000526020600020905b8154815290600101906020018083116121cc57829003601f168201915b505050918352505060048201805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815293820193929183018282801561227d5780601f106122525761010080835404028352916020019161227d565b820191906000526020600020905b81548152906001019060200180831161226057829003601f168201915b5050505050815250508152602001600782015481526020016008820154815260200160098201548152602001600a820180548060200260200160405190810160405280929190818152602001828054801561230157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122e3575b505050505081525050905080600001518160200151826040015183608001518460a001518560c001518660e00151809050975097509750975097509750975050919395979092949650565b60055481565b6000805b60045481101561183757826001600160a01b03166004828154811061237757fe5b6000918252602090912001546001600160a01b0316141561239c576001915050611175565b600101612356565b606060038054806020026020016040519081016040528092919081815260200182805480156123fc57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116123de575b505050505090505b90565b60005460ff1615612455576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600780546001600160a01b031990811661f002179091556008805490911661f00117905560005b8181101561275657600083838381811061249257fe5b905060200201356001600160a01b03166001600160a01b031614156124fe576040805162461bcd60e51b815260206004820152601960248201527f496e76616c69642076616c696461746f72206164647265737300000000000000604482015290519081900360640190fd5b61252283838381811061250d57fe5b905060200201356001600160a01b03166117e5565b61257157600383838381811061253457fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b0395909202939093013593909316929092179055505b61259583838381811061258057fe5b905060200201356001600160a01b0316612352565b6125e45760048383838181106125a757fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b0395909202939093013593909316929092179055505b60006001818585858181106125f557fe5b6001600160a01b03602091820293909301358316845283019390935260409091016000205416919091141590506126aa5782828281811061263257fe5b905060200201356001600160a01b03166001600085858581811061265257fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6000600160008585858181106126bc57fe5b602090810292909201356001600160a01b031683525081019190915260400160002054600160a01b900460ff1660048111156126f457fe5b141561274e5760026001600085858581811061270c57fe5b602090810292909201356001600160a01b0316835250810191909152604001600020805460ff60a01b1916600160a01b83600481111561274857fe5b02179055505b60010161247c565b50506000805460ff1916600117905550565b6000805460ff166127af576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b6001600160a01b038c16612800576040805162461bcd60e51b8152602060048201526013602482015272496e76616c696420666565206164647265737360681b604482015290519081900360640190fd5b61290f8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b815292508b91508a908190840183828082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525061320892505050565b612956576040805162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103232b9b1b934b83a34b7b760691b604482015290519081900360640190fd5b336000818152600160205260408120548190600160a01b900460ff16600481111561297d57fe5b1415612a7b576007546040805163416259d960e11b81526001600160a01b038581166004830152915191909216916382c4b3b2916024808301926020929190829003018186803b1580156129d057600080fd5b505afa1580156129e4573d6000803e3d6000fd5b505050506040513d60208110156129fa57600080fd5b5051612a4d576040805162461bcd60e51b815260206004820152601c60248201527f596f75206d75737420626520617574686f72697a656420666972737400000000604482015290519081900360640190fd5b506001600160a01b0381166000908152600160208190526040909120805460ff60a01b1916600160a01b1790555b6001600160a01b038281166000908152600160205260409020548116908f1614612aed578d60016000846001600160a01b03166001600160a01b0316815260200190815260200160002060000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6040518060a001604052808e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f8f018190048102820181019092528d815291810191908e908e9081908401838280828437600092019190915250505090825250604080516020601f8d018190048102820181019092528b815291810191908c908c9081908401838280828437600092019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a9081908401838280828437600092019190915250505090825250604080516020601f89018190048102820181019092528781529181019190889088908190840183828082843760009201829052509390945250506001600160a01b03851681526001602090815260409091208351805160029092019350612c4d928492910190614684565b506020828101518051612c669260018501920190614684565b5060408201518051612c82916002840191602090910190614684565b5060608201518051612c9e916003840191602090910190614684565b5060808201518051612cba916004840191602090910190614684565b509050508015612d14578d6001600160a01b0316826001600160a01b03167f887eec9d757b7247dd8e51198f9d1b8f27979bceb34bdcc1bffd4ec5ec736c22426040518082815260200191505060405180910390a3612d60565b8d6001600160a01b0316826001600160a01b03167fb8421f65501371f54d58de1937ff1e1ccdb76423ef6f84acea1814a0f6362ca0426040518082815260200191505060405180910390a35b5060019d9c50505050505050505050505050565b6060806060806060612d84614638565b6001600160a01b038781166000908152600160209081526040918290208251610100810190935280549384168352919290830190600160a01b900460ff166004811115612dcd57fe5b6004811115612dd857fe5b815260200160018201548152602001600282016040518060a0016040529081600082018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e8f5780601f10612e6457610100808354040283529160200191612e8f565b820191906000526020600020905b815481529060010190602001808311612e7257829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f315780601f10612f0657610100808354040283529160200191612f31565b820191906000526020600020905b815481529060010190602001808311612f1457829003601f168201915b5050509183525050600282810180546040805160206001841615610100026000190190931694909404601f81018390048302850183019091528084529381019390830182828015612fc35780601f10612f9857610100808354040283529160200191612fc3565b820191906000526020600020905b815481529060010190602001808311612fa657829003601f168201915b505050918352505060038201805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529382019392918301828280156130575780601f1061302c57610100808354040283529160200191613057565b820191906000526020600020905b81548152906001019060200180831161303a57829003601f168201915b505050918352505060048201805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529382019392918301828280156130eb5780601f106130c0576101008083540402835291602001916130eb565b820191906000526020600020905b8154815290600101906020018083116130ce57829003601f168201915b5050505050815250508152602001600782015481526020016008820154815260200160098201548152602001600a820180548060200260200160405190810160405280929190818152602001828054801561316f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613151575b5050509190925250505060609081015180516020820151604083015193830151608090930151919b909a50929850909650945092505050565b606060048054806020026020016040519081016040528092919081815260200182805480156123fc576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116123de575050505050905090565b600060468651111561325a576040805162461bcd60e51b8152602060048201526016602482015275092dcecc2d8d2c840dadedcd2d6cae440d8cadccee8d60531b604482015290519081900360640190fd5b610bb8855111156132b2576040805162461bcd60e51b815260206004820152601760248201527f496e76616c6964206964656e74697479206c656e677468000000000000000000604482015290519081900360640190fd5b608c84511115613302576040805162461bcd60e51b8152602060048201526016602482015275092dcecc2d8d2c840eecac4e6d2e8ca40d8cadccee8d60531b604482015290519081900360640190fd5b608c83511115613350576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840cadac2d2d840d8cadccee8d60631b604482015290519081900360640190fd5b610118825111156133a1576040805162461bcd60e51b8152602060048201526016602482015275092dcecc2d8d2c840c8cae8c2d2d8e640d8cadccee8d60531b604482015290519081900360640190fd5b50600195945050505050565b6801bc16d674ec80000081565b6000806133c76000613e67565b915091509091565b601581565b334114613415576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b43600090815260096020908152604080832083805290915290205460ff1615613485576040805162461bcd60e51b815260206004820152601960248201527f426c6f636b20697320616c726561647920726577617264656400000000000000604482015290519081900360640190fd5b60005460ff166134cb576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b4360009081526009602090815260408083208380528252808320805460ff1916600190811790915533808552925282205490913491600160a01b900460ff16600481111561351557fe5b1415613522575050613572565b61352d816000613f5b565b6040805182815242602082015281516001600160a01b038516927f7dc4e5df59513708dca355b8706273a5df7b810a4cec8019f2a4b9bb166a1a04928290030190a250505b565b6201518081565b61708081565b6000805460ff166135c8576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b3360006001600160a01b038416600090815260016020526040902054600160a01b900460ff1660048111156135f957fe5b1415613642576040805162461bcd60e51b815260206004820152601360248201527215985b1a59185d1bdc881b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b6001600160a01b038082166000908152600260209081526040808320938716835292815282822060019182905292909120825491830154909190156136b85760405162461bcd60e51b81526004018080602001828103825260238152602001806148d66023913960400191505060405180910390fd5b60008111613708576040805162461bcd60e51b8152602060048201526018602482015277596f7520646f6e2774206861766520616e79207374616b6560401b604482015290519081900360640190fd5b600454600114801561371e575061371e86612352565b8015613747575060018201546801bc16d674ec80000090613745908363ffffffff6142c416565b105b156137835760405162461bcd60e51b81526004018080602001828103825260458152602001806147e96045913960600191505060405180910390fd5b600a82015460028401546000199091011461386057600a8201805460001981019081106137ac57fe5b9060005260206000200160009054906101000a90046001600160a01b031682600a018460020154815481106137dd57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600201546002600084600a0186600201548154811061382757fe5b60009182526020808320909101546001600160a01b0390811684528382019490945260409283018220938b168252929092529020600201555b81600a0180548061386d57fe5b600082815260209020810160001990810180546001600160a01b031916905501905560018201546138a4908263ffffffff6142c416565b6001808401919091554390840155600060028401556005546138cc908263ffffffff6142c416565b60055560018201546801bc16d674ec800000111561397a57815460ff60a01b1916600360a01b1782556138fe86614306565b600754604080516315ea278160e01b81526001600160a01b038981166004830152915191909216916315ea27819160248083019260209291908290030181600087803b15801561394d57600080fd5b505af1158015613961573d6000803e3d6000fd5b505050506040513d602081101561397757600080fd5b50505b856001600160a01b0316846001600160a01b03167f449002ae18e748d69a55f38514400d64f966492e593e32d6e9b8b24db98a0bc18342604051808381526020018281526020019250505060405180910390a350600195945050505050565b600082820183811015613a33576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b60005b600454811015613a8957826001600160a01b031660048281548110613a6057fe5b6000918252602090912001546001600160a01b03161415613a815750611984565b600101613a3f565b5060045460151115613b1c57600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0384166001600160a01b031990911681179091556040805142815290517f1e3310ad6891b30e03874ec3d1422a6386c5da63d9faf595f5d99eeaf443b99a9181900360200190a2611984565b6000600160006004600081548110613b3057fe5b60009182526020808320909101546001600160a01b03168352820192909252604001812060019081015492505b600454811015613bee57826001600060048481548110613b7957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020600101541015613be6576001600060048381548110613bb857fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190206001015492509050805b600101613b5d565b50818311613bfd575050611984565b6040805142815290516001600160a01b038616917f1e3310ad6891b30e03874ec3d1422a6386c5da63d9faf595f5d99eeaf443b99a919081900360200190a260048181548110613c4957fe5b600091825260209182902001546040805142815290516001600160a01b03909216927f7521e44559c870c316e84e60bc4785d9c034a8ab1d6acdce8134ac03f946c6ed92918290030190a28360048281548110613ca257fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050505050565b60006001600160a01b038216600090815260016020526040902054600160a01b900460ff166004811115613d0657fe5b1480613d155750600354600110155b15613d1f57611a05565b6001600160a01b0381166000908152600160205260409020600701548015613db457613d4b8183613f5b565b600654613d5e908263ffffffff6139d916565b6006556001600160a01b038216600090815260016020526040902060080154613d8d908263ffffffff6139d916565b6001600160a01b038316600090815260016020526040812060088101929092556007909101555b6040805182815242602082015281516001600160a01b038516927fe294e9d73f8eee23e21b2e1567960625a6b5d339cb127b55d0d09473a9951235928290030190a25050565b60006001600160a01b038216600090815260016020526040902054600160a01b900460ff166004811115613e2a57fe5b1415613e3557611a05565b6001600160a01b0381166000908152600160205260409020805460ff60a01b1916600160a21b179055611a0581614306565b600080805b600354811015613f555760046001600060038481548110613e8957fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff600160a01b909104166004811115613ec457fe5b14158015613ef6575060038181548110613eda57fe5b6000918252602090912001546001600160a01b03858116911614155b15613f4d57613f446001600060038481548110613f0f57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060010154849063ffffffff6139d916565b92506001909101905b600101613e6c565b50915091565b81613f6557611984565b600080613f7183613e67565b909250905080613f82575050611984565b6000808361410e576000613f9c878563ffffffff61443c16565b9050613fbe613fb1828663ffffffff61447e16565b889063ffffffff6142c416565b925060005b60035481101561409d57600060038281548110613fdc57fe5b6000918252602090912001546001600160a01b0316905060046001600160a01b038216600090815260016020526040902054600160a01b900460ff16600481111561402357fe5b141580156140435750876001600160a01b0316816001600160a01b031614155b15614094576001600160a01b038116600090815260016020526040902060070154614074908463ffffffff6139d916565b6001600160a01b0382166000908152600160205260409020600701559250825b50600101613fc3565b506000831180156140b657506001600160a01b03821615155b15614104576001600160a01b0382166000908152600160205260409020600701546140e7908463ffffffff6139d916565b6001600160a01b0383166000908152600160205260409020600701555b5050505050611984565b6000805b6003548110156142425760006003828154811061412b57fe5b6000918252602090912001546001600160a01b0316905060046001600160a01b038216600090815260016020526040902054600160a01b900460ff16600481111561417257fe5b141580156141925750876001600160a01b0316816001600160a01b031614155b15614239576001600160a01b0381166000908152600160208190526040822001546141d69089906141ca908d9063ffffffff61447e16565b9063ffffffff61443c16565b90506141e8848263ffffffff6139d916565b6001600160a01b0383166000908152600160205260409020600701549295509350849161421b908263ffffffff6139d916565b6001600160a01b038316600090815260016020526040902060070155505b50600101614112565b50614253878263ffffffff6142c416565b925060008311801561426d57506001600160a01b03821615155b156142bb576001600160a01b03821660009081526001602052604090206007015461429e908463ffffffff6139d916565b6001600160a01b0383166000908152600160205260409020600701555b50505050505050565b6000613a3383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506144d7565b60005b6004548110801561431c57506004546001105b15611984576004818154811061432e57fe5b6000918252602090912001546001600160a01b0383811691161415614434576004546000190181146143c15760048054600019810190811061436c57fe5b600091825260209091200154600480546001600160a01b03909216918390811061439257fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60048054806143cc57fe5b6000828152602090819020820160001990810180546001600160a01b03191690559091019091556040805142815290516001600160a01b038516927f7521e44559c870c316e84e60bc4785d9c034a8ab1d6acdce8134ac03f946c6ed928290030190a2611984565b600101614309565b6000613a3383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061456e565b60008261448d57506000613a36565b8282028284828161449a57fe5b0414613a335760405162461bcd60e51b815260040180806020018281038252602181526020018061487d6021913960400191505060405180910390fd5b600081848411156145665760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561452b578181015183820152602001614513565b50505050905090810190601f1680156145585780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836145bd5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561452b578181015183820152602001614513565b5060008385816145c957fe5b0495945050505050565b828054828255906000526020600020908101928215614628579160200282015b8281111561462857825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906145f3565b506146349291506146fe565b5090565b60408051610100810190915260008082526020820190815260200160008152602001614662614722565b8152602001600081526020016000815260200160008152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106146c557805160ff19168380011785556146f2565b828001600101855582156146f2579182015b828111156146f25782518255916020019190600101906146d7565b50614634929150614751565b61240491905b808211156146345780546001600160a01b0319168155600101614704565b6040518060a0016040528060608152602001606081526020016060815260200160608152602001606081525090565b61240491905b80821115614634576000815560010161475756fe596f75206d757374207761697420656e6f75676820626c6f636b7320746f20776974686472617720796f75722070726f66697473206166746572206c6174657374207769746864726177206f6620746869732076616c696461746f72596f7572207374616b696e6720686176656e277420756e6c6f636b656420796574596f752063616e277420756e7374616b652c2076616c696461746f72206c6973742077696c6c20626520656d7074792061667465722074686973206f7065726174696f6e2143616e2774207374616b65207768656e20796f752061726520756e7374616b696e6743616e2774207374616b6520746f20612076616c696461746f7220696e2061626e6f726d616c20737461747573536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652076616c696461746f7220796f752077616e7420746f207374616b65206d75737420626520617574686f72697a6564206669727374596f752061726520616c726561647920696e20756e7374616b696e6720737461747573596f7520617265206e6f742074686520666565207265636569766572206f6620746869732076616c696461746f72a26469706673582212208aa6d48a2de06a670224f303bda2fac3b306e533f05bcbf162f9f41f02457b2064736f6c63430006010033"
    },
    "000000000000000000000000000000000000F001": {
      "balance": "0x0",
      "code": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063be645692116100a2578063db78dd2811610071578063db78dd281461022f578063e0d8ea5314610254578063ea7221a11461025c578063efd8d8e214610282578063f62af26c1461028a57610116565b8063be645692146101e3578063c967f90f146101eb578063cb1ea7251461020a578063d93d2cb91461021257610116565b80633a061bd3116100e95780633a061bd31461019b57806344c1aa99146101a35780636233be5d146101ab57806363e1d451146101b35780638129fc1c146101d957610116565b8063158ef93e1461011b5780631b5e358c146101375780632897183d1461015b57806332f3c17f14610175575b600080fd5b6101236102a7565b604080519115158252519081900360200190f35b61013f6102b0565b604080516001600160a01b039092168252519081900360200190f35b6101636102b6565b60408051918252519081900360200190f35b6101636004803603602081101561018b57600080fd5b50356001600160a01b03166102bc565b61013f6102d7565b6101636102dd565b61013f6102e3565b610123600480360360208110156101c957600080fd5b50356001600160a01b03166102e9565b6101e1610515565b005b610163610598565b6101f36105a5565b6040805161ffff9092168252519081900360200190f35b6101636105aa565b6101e16004803603602081101561022857600080fd5b50356105b0565b610237610853565b6040805167ffffffffffffffff9092168252519081900360200190f35b61016361085a565b6101e16004803603602081101561027257600080fd5b50356001600160a01b0316610860565b610237610b76565b61013f600480360360208110156102a057600080fd5b5035610b7c565b60005460ff1681565b61f00181565b60035481565b6001600160a01b031660009081526005602052604090205490565b61f00081565b60025481565b61f00281565b6000805460ff16610330576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b3361f00014610386576040805162461bcd60e51b815260206004820152601860248201527f56616c696461746f727320636f6e7472616374206f6e6c790000000000000000604482015290519081900360640190fd5b6001600160a01b038216600090815260056020526040902054156103be576001600160a01b0382166000908152600560205260408120555b6001600160a01b03821660009081526005602052604090206002015460ff1680156103ea575060065415155b1561050d576006546001600160a01b038316600090815260056020526040902060010154600019909101146104b4576006805460009190600019810190811061042f57fe5b60009182526020808320909101546001600160a01b038681168452600590925260409092206001015460068054929093169350839291811061046d57fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790558583168252600590526040808220600190810154949093168252902001555b60068054806104bf57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038416825260059052604081206001810191909155600201805460ff191690555b506001919050565b60005460ff1615610563576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600480546001600160a01b03191661f0001790556018600181815560306002556003919091556000805460ff19169091179055565b6801bc16d674ec80000081565b601581565b60015481565b3341146105f1576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b4360009081526008602052604090205460ff161561064a576040805162461bcd60e51b8152602060048201526011602482015270105b1c9958591e48191958dc99585cd959607a1b604482015290519081900360640190fd5b60005460ff16610690576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b8080438161069a57fe5b06156106e0576040805162461bcd60e51b815260206004820152601060248201526f426c6f636b2065706f6368206f6e6c7960801b604482015290519081900360640190fd5b436000908152600860205260409020805460ff191660011790556006546107065761084f565b60005b600654811015610824576003546002548161072057fe5b04600560006006848154811061073257fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205411156107e3576003546002548161076a57fe5b04600560006006848154811061077c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120546006805493909103926005929190859081106107b957fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205561081c565b600060056000600684815481106107f657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b600101610709565b506040517f181d51be54e8e8eaca6eae0eab32d4162099236bd519e7238d015d0870db464190600090a15b5050565b6201518081565b60065490565b3341146108a1576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b60005460ff166108e7576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b4360009081526007602052604090205460ff161561093f576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c1d5b9a5cda195960821b604482015290519081900360640190fd5b436000908152600760209081526040808320805460ff191660011790556001600160a01b0384168352600590915290206002015460ff166109e857600680546001600160a01b038316600081815260056020526040812060018082018590558085019095557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90930180546001600160a01b0319168317905552600201805460ff191690911790555b6001600160a01b03811660009081526005602052604090208054600101908190556002549081610a1457fe5b06610aa15760048054604080516340a141ff60e01b81526001600160a01b0385811694820194909452905192909116916340a141ff9160248082019260009290919082900301818387803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b5050506001600160a01b03821660009081526005602052604081205550610b34565b6001546001600160a01b03821660009081526005602052604090205481610ac457fe5b06610b345760048054604080516305dd095960e41b81526001600160a01b038581169482019490945290519290911691635dd095909160248082019260009290919082900301818387803b158015610b1b57600080fd5b505af1158015610b2f573d6000803e3d6000fd5b505050505b6040805142815290516001600160a01b038316917f770e0cca42c35d00240986ce8d3ed438be04663c91dac6576b79537d7c180f1e919081900360200190a250565b61708081565b60068181548110610b8957fe5b6000918252602090912001546001600160a01b031690508156fea264697066735822122060d823e4e77419f5139811eeb88f06b779ebe34ed1c4a63f2d354e230517fc5c64736f6c63430006010033"
    },
    "000000000000000000000000000000000000F002": {
      "balance": "0x0",
      "code": "0x608060405234801561001057600080fd5b50600436106101005760003560e01c806382c4b3b211610097578063c967f90f11610066578063c967f90f146103fc578063db78dd281461041b578063e823c81414610440578063efd8d8e21461044857610100565b806382c4b3b214610327578063a224cee71461034d578063a4c4d922146103bd578063be645692146103e257610100565b80631f4f7d29116100d35780631f4f7d29146101c157806332ed5b121461023f5780633a061bd3146103175780636233be5d1461031f57610100565b8063158ef93e1461010557806315ea2781146101215780631b5e358c146101475780631db5ade81461016b575b600080fd5b61010d610450565b604080519115158252519081900360200190f35b61010d6004803603602081101561013757600080fd5b50356001600160a01b0316610459565b61014f61050e565b604080516001600160a01b039092168252519081900360200190f35b6101976004803603604081101561018157600080fd5b506001600160a01b038135169060200135610514565b604080516001600160a01b0390941684526020840192909252151582820152519081900360600190f35b61010d600480360360408110156101d757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561020157600080fd5b82018360208201111561021357600080fd5b803590602001918460018302840111600160201b8311171561023457600080fd5b50909250905061054d565b61025c6004803603602081101561025557600080fd5b5035610827565b604080516001600160a01b03808a16825288166020808301919091526060820187905261ffff8087166080840152851660a083015283151560c083015260e0928201838152885193830193909352875191929161010084019189019080838360005b838110156102d65781810151838201526020016102be565b50505050905090810190601f1680156103035780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b61014f610906565b61014f61090c565b61010d6004803603602081101561033d57600080fd5b50356001600160a01b0316610912565b6103bb6004803603602081101561036357600080fd5b810190602081018135600160201b81111561037d57600080fd5b82018360208201111561038f57600080fd5b803590602001918460208302840111600160201b831117156103b057600080fd5b509092509050610927565b005b61010d600480360360408110156103d357600080fd5b50803590602001351515610a72565b6103ea61118f565b60408051918252519081900360200190f35b61040461119c565b6040805161ffff9092168252519081900360200190f35b6104236111a1565b6040805167ffffffffffffffff9092168252519081900360200190f35b6103ea6111a8565b6104236111ae565b60005460ff1681565b60003361f000146104b1576040805162461bcd60e51b815260206004820152601860248201527f56616c696461746f727320636f6e7472616374206f6e6c790000000000000000604482015290519081900360640190fd5b6001600160a01b038216600081815260026020908152604091829020805460ff19169055815142815291517f4e0b191f7f5c32b1b5e3704b68874b1a3980147cae00be8ece271bfb5b92c07a9281900390910190a2506001919050565b61f00181565b60046020908152600092835260408084209091529082529020805460018201546002909201546001600160a01b03909116919060ff1683565b6001600160a01b03831660009081526002602052604081205460ff16156105a55760405162461bcd60e51b815260040180806020018281038252602981526020018061128d6029913960400191505060405180910390fd5b6000338585854260405160200180866001600160a01b03166001600160a01b031660601b8152601401856001600160a01b03166001600160a01b031660601b81526014018484808284379190910192835250506040805180830381526020928301909152805191012094505050610bb885111591506106609050576040805162461bcd60e51b815260206004820152601060248201526f44657461696c7320746f6f206c6f6e6760801b604482015290519081900360640190fd5b60008181526003602081905260409091200154156106c5576040805162461bcd60e51b815260206004820152601760248201527f50726f706f73616c20616c726561647920657869737473000000000000000000604482015290519081900360640190fd5b6106cd6111b4565b3381526001600160a01b03861660208083019190915260408051601f870183900483028101830190915285815290869086908190840183828082843760009201829052506040808701958652426060880152878252600360209081529120865181546001600160a01b039182166001600160a01b031991821617835583890151600184018054919093169116179055945180518796955061077794506002860193509101906111f1565b506060820151600382015560808201516004909101805460a084015160c09094015161ffff1990911661ffff9384161763ffff000019166201000093909416929092029290921764ff000000001916600160201b911515919091021790556040805142815290516001600160a01b03881691339185917fc10f2f4d53a0e342536c6af3cce9c6ee25c32dbb323521ce0e1d4494a3e362e8916020918190039190910190a450600195945050505050565b60036020908152600091825260409182902080546001808301546002808501805488516101009582161595909502600019011691909104601f81018790048702840187019097528683526001600160a01b03938416969390911694919290918301828280156108d75780601f106108ac576101008083540402835291602001916108d7565b820191906000526020600020905b8154815290600101906020018083116108ba57829003601f168201915b50505050600383015460049093015491929161ffff80821692506201000082041690600160201b900460ff1687565b61f00081565b61f00281565b60026020526000908152604090205460ff1681565b60005460ff1615610975576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b62093a80600155600580546001600160a01b03191661f00017905560005b81811015610a605760008383838181106109a957fe5b905060200201356001600160a01b03166001600160a01b03161415610a15576040805162461bcd60e51b815260206004820152601960248201527f496e76616c69642076616c696461746f72206164647265737300000000000000604482015290519081900360640190fd5b600160026000858585818110610a2757fe5b602090810292909201356001600160a01b0316835250810191909152604001600020805460ff1916911515919091179055600101610993565b50506000805460ff1916600117905550565b60055460408051631015428760e21b815233600482015290516000926001600160a01b0316916340550a1c916024808301926020929190829003018186803b158015610abd57600080fd5b505afa158015610ad1573d6000803e3d6000fd5b505050506040513d6020811015610ae757600080fd5b5051610b2b576040805162461bcd60e51b815260206004820152600e60248201526d56616c696461746f72206f6e6c7960901b604482015290519081900360640190fd5b60008381526003602081905260409091200154610b84576040805162461bcd60e51b8152602060048201526012602482015271141c9bdc1bdcd85b081b9bdd08195e1a5cdd60721b604482015290519081900360640190fd5b33600090815260046020908152604080832086845290915290206001015415610bde5760405162461bcd60e51b81526004018080602001828103825260238152602001806112b66023913960400191505060405180910390fd5b60015460008481526003602081905260409091200154014210610c3b576040805162461bcd60e51b815260206004820152601060248201526f141c9bdc1bdcd85b08195e1c1a5c995960821b604482015290519081900360640190fd5b336000818152600460209081526040808320878452825291829020426001820181905581546001600160a01b031916851782556002909101805460ff1916871515908117909155835190815291820152815186927f6c59bda68cac318717c60c7c9635a78a0f0613f9887cc18a7157f5745a86d14e928290030190a38115610ce9576000838152600360205260409020600401805461ffff8082166001011661ffff19909116179055610d1d565b60008381526003602052604090206004018054600161ffff62010000808404821692909201160263ffff0000199091161790555b6000838152600360209081526040808320600101546001600160a01b03168352600290915290205460ff1680610d6b5750600083815260036020526040902060040154600160201b900460ff165b15610d7857506001611189565b600554604080516313bce04b60e31b815290516002926001600160a01b031691639de70258916004808301926000929190829003018186803b158015610dbd57600080fd5b505afa158015610dd1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610dfa57600080fd5b8101908080516040519392919084600160201b821115610e1957600080fd5b908301906020820185811115610e2e57600080fd5b82518660208202830111600160201b82111715610e4a57600080fd5b82525081516020918201928201910280838360005b83811015610e77578181015183820152602001610e5f565b505050509050016040525050505181610e8c57fe5b60008581526003602052604090206004015491900460010161ffff90911610610fd4576000838152600360208181526040808420600181810180546001600160a01b03908116885260028652848820805460ff19169093179092558987529484526004918201805464ff000000001916600160201b1790556005549454835163415e9ec960e11b815290821692810192909252915193909116936382bd3d9293602480840194939192918390030190829087803b158015610f4c57600080fd5b505af1158015610f60573d6000803e3d6000fd5b505050506040513d6020811015610f7657600080fd5b505060008381526003602090815260409182902060010154825142815292516001600160a01b039091169286927fc9d96d61eb62031865c523ae107f3c22f5ed445af237636bcd88bea1705c70d592918290030190a3506001611189565b600554604080516313bce04b60e31b815290516002926001600160a01b031691639de70258916004808301926000929190829003018186803b15801561101957600080fd5b505afa15801561102d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561105657600080fd5b8101908080516040519392919084600160201b82111561107557600080fd5b90830190602082018581111561108a57600080fd5b82518660208202830111600160201b821117156110a657600080fd5b82525081516020918201928201910280838360005b838110156110d35781810151838201526020016110bb565b5050505090500160405250505051816110e857fe5b046001016003600085815260200190815260200160002060040160029054906101000a900461ffff1661ffff16106111855760008381526003602090815260409182902060048101805464ff000000001916600160201b17905560010154825142815292516001600160a01b039091169286927fec955d77e6e7d74e18b1c91977ef0f6fd5a6d02a28d1979686339fe69399782592918290030190a35b5060015b92915050565b6801bc16d674ec80000081565b601581565b6201518081565b60015481565b61708081565b6040805160e08101825260008082526020820181905260609282018390529181018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061123257805160ff191683800117855561125f565b8280016001018555821561125f579182015b8281111561125f578251825591602001919060010190611244565b5061126b92915061126f565b5090565b61128991905b8082111561126b5760008155600101611275565b9056fe44737420616c7265616479207061737365642c20596f752063616e207374617274207374616b696e67596f752063616e277420766f746520666f7220612070726f706f73616c207477696365a2646970667358221220b5d3e92040a63e987684b1a28e58e27016be64891c0368ebe359a5ee243ba7db64736f6c63430006010033"
    } 
  },
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

注:genesis.json 应创建在/opt/docker/heco-private

3.4 初始化geth

将上面修改好的geth.tomlgenesis.json及预生成的账户地址keystore文件放到规划好的位置,我们此时放在 /opt/docker/heco-private

  • 初始化geth
cd /opt/docker/heco-private

docker run --rm -v $(pwd):/data huobi-eco:v1.1.1 init /data/genesis.json --datadir /data/heco
  • 将预生成的账户地址keystore文件拷贝至初始数据文件中
cp UTC--2021-07-14T07-08-50.678943586Z--b5ca2e8dcc6134bbdc7790d292e838e40c39ba39 ./heco/keystore/

或者可以将以上步骤编写为一个脚本,例如:

# vim /opt/docker/heco-private/genesis.sh 

#!/bin/bash
docker run --rm -v $(pwd):/data huobi-eco:v1.1.1 init /data/genesis.json --datadir /data/heco
cp UTC--* ./heco/keystore/

3.5 启动geth

  • 启动geth
docker run -itd --restart=unless-stopped -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --name private_heco -v /opt/docker/heco/private:/data -p 30303:30303 -p 8545:8545 huobi-eco:v1.1.1 --config geth.toml --nodiscover
  • 查看geth启动日志
# docker logs -f private_heco --tail 1000
INFO [07-14|19:42:36.397] Starting Geth on Ethereum mainnet... 
INFO [07-14|19:42:36.397] Bumping default cache on mainnet         provided=1024 updated=4096
INFO [07-14|19:42:36.399] Maximum peer count                       ETH=50 LES=0 total=50
INFO [07-14|19:42:36.399] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [07-14|19:42:36.400] Set global gas cap                       cap=25000000
WARN [07-14|19:42:36.400] Sanitizing invalid miner gas price       provided=0    updated=1000000000
INFO [07-14|19:42:36.400] Allocated trie memory caches             clean=1023.00MiB dirty=1024.00MiB
INFO [07-14|19:42:36.400] Allocated cache and file handles         database=/data/heco/geth/chaindata cache=2.00GiB handles=524288
INFO [07-14|19:42:36.457] Opened ancient database                  database=/data/heco/geth/chaindata/ancient
INFO [07-14|19:42:36.457] Initialised chain configuration          config="{ChainID: 1024 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, YOLO v1: <nil>, RedCoastBlock: <nil>, Engine: congress}"
INFO [07-14|19:42:36.458] Initialising Ethereum protocol           versions="[65 64 63]" network=128 dbversion=<nil>
WARN [07-14|19:42:36.458] Upgrade blockchain database version      from=<nil> to=8
INFO [07-14|19:42:36.458] Loaded most recent local header          number=0 hash="24e0fe…fc772a" td=1 age=7mo2w1d
INFO [07-14|19:42:36.458] Loaded most recent local full block      number=0 hash="24e0fe…fc772a" td=1 age=7mo2w1d
INFO [07-14|19:42:36.459] Loaded most recent local fast block      number=0 hash="24e0fe…fc772a" td=1 age=7mo2w1d
INFO [07-14|19:42:36.459] JamConfig sanity PeriodsSecs             old=0 new=3
INFO [07-14|19:42:36.459] JamConfig sanity JamSecs                 old=0 new=15
INFO [07-14|19:42:36.459] JamConfig sanity UnderPricedFactor       old=0 new=3
INFO [07-14|19:42:36.459] JamConfig sanity PendingFactor           old=0 new=1
INFO [07-14|19:42:36.459] JamConfig sanity MaxValidPendingSecs     old=0 new=300
INFO [07-14|19:42:36.459] Regenerated local transaction journal    transactions=0 accounts=0
INFO [07-14|19:42:36.486] Allocated fast sync bloom                size=2.00GiB
INFO [07-14|19:42:36.488] Prediction started                       checkBlocks=20 Interval=3 ff=2 mf=5 lf=8 minMi=500 minLi=1000 fp=75 mp=90 minCnt=100
INFO [07-14|19:42:36.488] Starting peer-to-peer node               instance=Geth/v1.1.1-stable-b5a6d1ae/linux-amd64/go1.13.4
INFO [07-14|19:42:36.488] Stored checkpoint snapshot to disk       number=0 hash="24e0fe…fc772a"
INFO [07-14|19:42:36.501] Initialized fast sync bloom              items=8 errorrate=0.000 elapsed=13.901ms
INFO [07-14|19:42:36.508] New local node record                    seq=1 id=11bbb5a76c298976 ip=127.0.0.1 udp=0 tcp=32668
INFO [07-14|19:42:36.508] Started P2P networking                   self="enode://afeb88b78f0f2014722e590edd9a5c2471a6d813139ca0125a9f2bd39c4e15914c17eb93ae6bf7c4a9ca00d2d767cc3c7b1c65bc16eac5a7c1333163abf173ee@127.0.0.1:32668?discport=0"
INFO [07-14|19:42:36.508] IPC endpoint opened                      url=/data/heco/geth.ipc
INFO [07-14|19:42:36.509] HTTP server started                      endpoint=[::]:8545 cors=* vhosts=*
INFO [07-14|19:42:36.509] WebSocket enabled                        url=ws://[::]:8546

注意:此时heco私链并没有开启挖矿

3.6 启动挖矿

启动后,进入ipc,解锁我们预先生成的地址,作为此节点的coinbase

  • 从另一个终端进入geth控制台
geth attach /data/heco/geth.ipc
  • 查看当前的的coinbase地址
> eth
{
  accounts: ["0x6e60f5243e1a3f0be3f407b5afe9e5395ee82aa2"],
  blockNumber: 0,
  coinbase: "0x6e60f5243e1a3f0be3f407b5afe9e5395ee82aa2",

accounts和coinbase都为以上步骤预先生成的地址

  • 设置该地址为无限期解锁,因为后面需要使用该私钥进行出块签名。0为无限期
> personal.unlockAccount("0x6e60f5243e1a3f0be3f407b5afe9e5395ee82aa2","123456",0)
true
  • 启动挖矿
>  miner.start(1)
null

注:开启一个线程进行挖矿

  • 此时查看容器日志
# docker logs -f private_heco --tail 10

INFO [07-14|19:59:58.170] Commit new mining work                   number=1 sealhash="bf7336…e33410" uncles=0 txs=0 gas=0 fees=0 elapsed="806.874µs"
INFO [07-14|19:59:58.171] Successfully sealed new block            number=1 sealhash="bf7336…e33410" hash="2895d7…ce0d38" elapsed="827.942µs"
INFO [07-14|19:59:58.171]  mined potential block                  number=1 hash="2895d7…ce0d38"
INFO [07-14|19:59:58.171] Commit new mining work                   number=2 sealhash="87b89e…d4c45c" uncles=0 txs=0 gas=0 fees=0 elapsed="301.408µs"
INFO [07-14|20:00:01.000] Successfully sealed new block            number=2 sealhash="87b89e…d4c45c" hash="ea11f6…73a6e4" elapsed=2.829s
INFO [07-14|20:00:01.000]  mined potential block                  number=2 hash="ea11f6…73a6e4"
INFO [07-14|20:00:01.001] Commit new mining work                   number=3 sealhash="1b3243…a9033b" uncles=0 txs=0 gas=0 fees=0 elapsed="383.343µs"
INFO [07-14|20:00:04.000] Successfully sealed new block            number=3 sealhash="1b3243…a9033b" hash="2af89a…f1a236" elapsed=2.999s
INFO [07-14|20:00:04.000]  mined potential block                  number=3 hash="2af89a…f1a236"

节点出块主要是以下日志

// 成功封存新的区块
INFO [07-14|20:05:49.000] Successfully sealed new block            number=118 sealhash="28eba5…16ba9f" hash="58933f…aef958" elapsed=2.999s
// 区块进行上链
INFO [07-14|20:05:49.000]  block reached canonical chain          number=111 hash="809cf0…0a71b6"
// 挖掘可能的区块
INFO [07-14|20:05:49.000]  mined potential block                  number=118 hash="58933f…aef958"
// 进行新的挖矿工作
INFO [07-14|20:05:49.001] Commit new mining work                   number=119 sealhash="87c28f…932b1e" uncles=0 txs=0 gas=0 fees=0 elapsed="336.003µs"

四.控制台指令使用

  • 地址余额查询

查看前面预先设置的初始资金接收地址余额

> eth.getBalance("0xb5Ca2e8dcC6134Bbdc7790D292e838E40c39BA39")
2.73919e+26
  • 当前最新区块号
>  eth.blockNumber
936
  • 当前最新区块的详细信息
> eth.getBlock( eth.blockNumber )
{
  difficulty: 2,
  extraData: "0xd883010101846765746888676f312e31332e34856c696e7578000000000000001f2651f2602b922e29e4c4b9719c8ac1b2d213839ce3688d8e011c2798afb0a93f5c84fe325ffbee410050587b5a80040113c877e280d806fb680f00ebb4f64b01",
  gasLimit: 16569850,
  gasUsed: 0,
  hash: "0xe9732601d046973f0344603979504ac312ce20f84234cd31b68cc222628f46f2",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39",
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: "0x0000000000000000",
  number: 952,
  parentHash: "0x65626f27f605602d96ff52361dd4c2efa88a7e8b8c26899b92788df4cceffbbc",
  receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 608,
  stateRoot: "0x20bb8563b18ec151297ad0de912ed826b7e18f7f875fb09bee68273929b382f9",
  timestamp: 1626266851,
  totalDifficulty: 1905,
  transactions: [],
  transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  uncles: []
}
  • 查询哪个地址挖掘的最新区块
> eth.getBlock(eth.blockNumber).miner
"0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39"
  • 查询账户余额(单位:heco)
> web3.fromWei(eth.getBalance(eth.accounts[0]))
273919000
  • 创建账户
> personal.newAccount()
Passphrase:   输入账号密码      
Repeat passphrase:   再次输入账号密码
"0xa271429e1a5fb2dcfd14c44907ae024b951cb400"  获得账号地址
// 得到当前节点拥有地址
> eth.accounts
["0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39", "0xa271429e1a5fb2dcfd14c44907ae024b951cb400"]

// 解锁from地址
> personal.unlockAccount('0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39','123456',0)
true

// 转账1个heco
> eth.sendTransaction({from: "0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39", to: "0xa271429e1a5fb2dcfd14c44907ae024b951cb400", value: web3.toWei(1, "ether")})
"0x8d97bd999c60cc16fa3ca4df36cba3366f58465dfca7a2d354924d9cb20f0077"

// 查看to地址余额为1 heco
> eth.getBalance("0xa271429e1a5fb2dcfd14c44907ae024b951cb400")
1000000000000000000
  • 停止挖矿
> miner.stop()
null

五.rpc命令使用

注:服务一旦搭建完成,我们不可能每次进行交易或查询用户信息时,都进入到heco私链容器内进行操作,以下示例为在宿主机命令行或者任意一台与宿主机可通信的命令行内使用curl命令调用rpc远程调用协议进行相关操作

5.1当前燃气价格

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":73}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":73,"result":"0x3b9aca00"}

5.2 返回客户端拥有的地址列表

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":["0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39","0xa271429e1a5fb2dcfd14c44907ae024b951cb400"]}

5.3 返回给定地址的帐户的余额

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xa271429e1a5fb2dcfd14c44907ae024b951cb400", "latest"],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0xde0b6b3a7640000"}

5.4 转账

转账1heco

# curl -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction", "params":[{"from":"0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39","to":"0xa271429e1a5fb2dcfd14c44907ae024b951cb400","gas":"0x5208","gasPrice":"0x1264c45600","value":"0xde0b6b3a7640000"}],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0xe5992c527c2009fafe848f75f0e7687dc3ad67bbed3332ac7994670e55c3fbd2"}

5.5 根据交易哈希查询交易信息

# curl -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xe5992c527c2009fafe848f75f0e7687dc3ad67bbed3332ac7994670e55c3fbd2"],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xc71d4e9e7f28ad43d9ad6cfb1824a8f3e756a01ab245bee49da843799a256f13","blockNumber":"0x4c6","from":"0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39","gas":"0x5208","gasPrice":"0x1264c45600","hash":"0xe5992c527c2009fafe848f75f0e7687dc3ad67bbed3332ac7994670e55c3fbd2","input":"0x","nonce":"0x1","to":"0xa271429e1a5fb2dcfd14c44907ae024b951cb400","transactionIndex":"0x0","value":"0xde0b6b3a7640000","v":"0x824","r":"0x120302defe97917e5476fcb15f15b47ef41db7b39e565e9d0d9bc423b18eae67","s":"0x14e45dbbbdb971b9a237db7cd6f86131ee7ffb177e2dffd1ad8b48e829a4d4ac"}}

5.6 从这个地址发送的交易数量的整数

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39", "latest"],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0x2"}

5.7 查询最新区块高度

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0x4fd"}

5.8 根据区块高度获取区块信息

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x4fd", true],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x2","extraData":"0xd883010101846765746888676f312e31332e34856c696e757800000000000000b880c5071d879336570b5447bcbb38494a34891bc1d25792b0a826d02da746d66ea238efc8b8d711d88200000db0fc5189bfad42ef4efc13e74828a97e69265501","gasLimit":"0xb80e36","gasUsed":"0x0","hash":"0xcb0bac5086fbe2089f40cee7f5940b7c0f8e322a75db025e4466bf4afc357824","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x4fd","parentHash":"0x19915afc326729c3ff12a039dc380eaee528d47dd251c70c4eb991ddb5be1a9d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x260","stateRoot":"0xb27443b25ad9b0d40b983e24ac2ede7113222e39c29495913c0b69abf0c4c51f","timestamp":"0x60eee0b2","totalDifficulty":"0x9fb","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}

5.9 根据区块哈希获取区块信息

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xcb0bac5086fbe2089f40cee7f5940b7c0f8e322a75db025e4466bf4afc357824", true],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x2","extraData":"0xd883010101846765746888676f312e31332e34856c696e757800000000000000b880c5071d879336570b5447bcbb38494a34891bc1d25792b0a826d02da746d66ea238efc8b8d711d88200000db0fc5189bfad42ef4efc13e74828a97e69265501","gasLimit":"0xb80e36","gasUsed":"0x0","hash":"0xcb0bac5086fbe2089f40cee7f5940b7c0f8e322a75db025e4466bf4afc357824","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xb5ca2e8dcc6134bbdc7790d292e838e40c39ba39","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x4fd","parentHash":"0x19915afc326729c3ff12a039dc380eaee528d47dd251c70c4eb991ddb5be1a9d","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x260","stateRoot":"0xb27443b25ad9b0d40b983e24ac2ede7113222e39c29495913c0b69abf0c4c51f","timestamp":"0x60eee0b2","totalDifficulty":"0x9fb","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}

5.10 根据区块哈希查询当前区块里的交易数

# curl -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0xc71d4e9e7f28ad43d9ad6cfb1824a8f3e756a01ab245bee49da843799a256f13"],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0x1"}

5.11 根据区块高度查询当前区块里的交易数

#  curl -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0x4c6"],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0x1"}

以上,就是今天分享的全部内容了。

希望大家通过以上方式可以解决自己的实际需求,解决自己目前所遇到的问题。

如果在部署过程中有任何疑问,可以扫描下面的二维码,添加我的个人微信,备注:地区-职业方向-昵称,欢迎来撩,加入区块链技术交流群,与更多的区块链技术大佬学习交流。
在这里插入图片描述

原创不易,码字不易。 觉得这篇文章对你有点用的话,麻烦你为本文点个赞,留言或转发一下,因为这将是我输出更多优质文章的动力,感谢!


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/30086.html

区块  地址  生成  
<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1