zoukankan      html  css  js  c++  java
  • 比特币全节点(bitcoind) eth 全节点

     

    • 运行全节点的用途:  1.挖矿  2.钱包   运行全节点,可以做关于btc的任何事情,例如创建钱包地址、管理钱包地址、发送交易、查询全网的交易信息等等
    • 选个节点钱包:bitcoind 

    1.配置文件:

    ~/.bitcoin/bitcoin.conf  文件配置

    testnet=1     # 测试网络 (同步快,17g左右)

    server=1      #允许rpc访问

    daemon=1      #后台运行

    datadir=/home/data    #区块存储位置(硬盘要够用)

    walletnotify=sh /home/notify_btc/notify.sh %s     #通知到账

    rpcallowip=116.247.112.151      

    rpcport=8332

    rpcuser=bitcoinrpc

    rpcpassword=123456

     

    2.命令  bitcoin-cli getinfo

    help ( "command" )

    stop
    getinfo
    ping
    getnettotals
    getnetworkinfo
    getpeerinfo
    getconnectioncount
    verifychain ( checklevel numblocks )
    getaddednodeinfo dns ( "node" )
    addnode "node" "add|remove|onetry"

     

     

    3.获取测试网络的btc

    https://testnet.manu.backend.hamburg/faucet

     

     

     

    Linux 下运行 eth全节点:

    有两种选择方案,官方的 go-ethereum  和 parity  两个钱包选择:

     

     

    1. 下载安装 go-ethereum

     

     (需要安装go环境,1.7版本以上)

     

    git clone https://github.com/ethereum/go-ethereum.git

    cd go-ethereum

    make geth

    make all

        实验了一把,发现国内go-ethereum同步非常慢,需要加入火星节点

     

    2.parity:   

       运行命令:parity --config config.toml

    #config.toml
    [parity]
    mode = "active"
    chain = "mainnet"
    light = false
    base_path = "/home/parity/db"

    [ui]
    force = false
    disable = false
    port = 8180
    interface = "all"
    path = "$HOME/.local/share/io.parity.ethereum/signer"

    [rpc]
    #rpc相当于http接口,可通过http请求的形式与parity交互
    #
    disable = false
    # # 是否关闭rpc接口
    #
    port = 8546
    # # rpc接口的端口号
    #
    interface = "all"
    apis = ["all","web3", "eth", "pubsub", "net", "parity", "parity_pubsub", "traces", "rpc", "shh", "shh_pubsub"]
    [websockets]
    # # websockets是另一种与parity的交互形式,他能提供rpc不能提供的信息,比如能订阅新的交易并收到推送。
    # # 以下内容和rpc一致

    disable = false
    port = 39843
    interface = "all"

    使用web3.js python 或者rpc均可以和和区块链节点进行交互

      

     

     

  • 相关阅读:
    selenium3+python自动化1-xpath学习总结
    Jmeter连接Mysql数据库
    fiddler过滤功能
    Excel动态图表制作
    【C#】虹软 视频多人脸识别的实现过程
    [C#]_Demo_4线程虹软人脸识别注册开发全过程
    【Linux】虹软人脸识别Face Recognition的封装
    [Android]虹软人脸检测与人脸识别集成分享
    虹软人脸识别demo使用教程
    [Android]虹软人脸识别Demo 第二版
  • 原文地址:https://www.cnblogs.com/GuoJiaSheng/p/9176812.html
Copyright © 2011-2022 走看看