zoukankan      html  css  js  c++  java
  • 以太坊公链Geth同步

    1、安装所需基础工具

    yum update -y && yum install git wget bzip2 vim gcc-c++ ntp epel-release nodejs cmake -y

    2、安装Go

    wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz
    tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz
    echo 'export GOROOT=/usr/local/go' >> /etc/profile 
    echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/profile 
    echo 'export GOPATH=/root/go' >> /etc/profile
    echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile
    source /etc/profile

    验证

    $ go version
    go version go1.10 linux/amd64
    

    3、克隆编译项目go-ethereum

    git clone https://github.com/ethereum/go-ethereum.git 
    cd go-ethereum 
    make all
    

    在path中加入geth路径

    echo 'export PATH=$PATH:/opt/go-ethereum/build/bin' >> /etc/profile
    source /etc/profile

    验证

    [root@iZrj9hk3x36fkle13532jaZ ~]# geth version
    INFO [08-16|10:12:12.117] Bumping default cache on mainnet         provided=1024 updated=4096
    Geth
    Version: 1.9.2-unstable
    Git Commit: c9cdf144d55f6bbd75314e812eeefc18d7e8c40e
    Git Commit Date: 20190808
    Architecture: amd64
    Protocol Versions: [63]
    Network Id: 1
    Go Version: go1.10
    Operating System: linux
    GOPATH=/root/go
    GOROOT=/usr/local/go
    

    4、同步以太坊区块

    nohup geth --syncmode "fast" --port "30303" --cache=4096 --datadir /data/geth --rpc --rpcapi db,eth,net,web3,personal,admin,miner --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*"  --maxpeers 999  --maxpendpeers 999 > output.log 2>&1 &
    

    5、进入geth控制台

    geth attach ipc:/data/geth/geth.ipc
    

      

  • 相关阅读:
    Python基础知识之4——三大控制结构
    Python基础知识之3——运算符与表达式
    Python基础知识之2——字典
    常用的数据分析方法汇总
    关于Windows10企业版的激活方法
    插补法图像压缩
    MouseHover-鼠标停留伴随内容提示
    移动端viewport模版
    Ajax的跨域请求
    Json用途
  • 原文地址:https://www.cnblogs.com/zhangmingcheng/p/11362306.html
Copyright © 2011-2022 走看看