zoukankan      html  css  js  c++  java
  • 以太坊geth主网全节点部署

    以太坊geth主网全节点部署

    环境 ubuntu 16.4
    硬盘500GB(目前占用200G)

    #客户端安装

    # 查看下载页面最新版
    # https://ethereum.github.io/go-ethereum/downloads/
    
    #下载
    cd /opt
    Version=1.8.20-24d727b6
    wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${Version}.tar.gz
    
    #解压安装
    tar zxf geth-linux-amd64-${Version}.tar.gz
    rm -f geth-linux-amd64-${Version}.tar.gz
    rm -rf /opt/geth
    ln -fs /opt/geth-linux-amd64-${Version} /opt/geth
    ln -fs /opt/geth-linux-amd64-${Version}/geth  /usr/local/bin/
    
    #检查
    geth version
    

    #启动

    nohup geth --rpc --rpcapi web3,eth,net,db,personal --rpcaddr 0.0.0.0 --rpcport 8545
    

    默认date目录在 ~/.ethereum/
    可添加参数指定 --datadir "/data/geth_data"

    # geth客户端登陆操作

    #登陆
    geth attach rpc:http://127.0.0.1:8545
    
    #查看状态
    eth
    
    #查看最新区块高度
    eth.blockNumber
    
    # 查看同步状态,返回 false 未同步或同步到最新了
    eth.syncing
    
    #生成账户,密码 password123
    personal.newAccount('password123')
    
    

    区块浏览器,查看最新区块
    https://etherscan.io


    # docker方式部署geth节点

    #date dir
    mkdir -p /data/eth_date
    
    #run eth
    docker run -dit --name eth -h eth 
     -v /etc/localtime:/etc/localtime:ro 
     -v /data/eth_date:/root/.ethereum 
     -p 30303:30303 -p 8545:8545 
      --restart=always 
    ethereum/client-go:stable  --rpc --rpcaddr "0.0.0.0" 
      --rpcapi "web3,eth,net,db,personal" --maxpeers=50 --rpccorsdomain "*"
    
  • 相关阅读:
    vue
    vim 使用
    ssh 免密码登录
    shell 监控
    shell top
    使用网络技术---WebView
    安卓数据存储
    模块
    面向对象
    文件
  • 原文地址:https://www.cnblogs.com/elvi/p/10203930.html
Copyright © 2011-2022 走看看