区块链私有链环境搭建

本文搭建的环境是基于Ubuntu 16.04。私有链的环境搭建还是比较简单。

 

第一步 安装geth客户端

Ubuntu安装geth客户端很简单,只需要三条命令足以。

sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

安装完成后,用命令geth help验证是否安装成功。

输出类似结果即为安装成功

NAME:
   geth - the go-ethereum command line interface
   Copyright 2013-2018 The go-ethereum Authors

USAGE:
   geth [options] command [command options] [arguments...]

VERSION:
   1.8.14-stable-316fc7ec

 

第二步 创建创世区块

准备genesis.json创世文件

vim genesis.json

内容如下

{ 
    "config": 
        { 
            "chainId": 15, 
            "homesteadBlock": 0, 
            "eip155Block": 0, 
            "eip158Block": 0 
        }, 
        "coinbase" : "0x0000000000000000000000000000000000000000", 
        "difficulty" : "0x40000", 
        "extraData" : "", 
        "gasLimit" : "0xffffffff", 
        "nonce" : "0x0000000000000042", 
        "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000", 
        "parentHash" : "0x0000
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值