ltc 节点搭建

litecoin节点部署

1.下载安装包并解压

  • 版本说明

    litecoin的官方网站为 https://litecoin.org/ 首页最下面有各个系统的下载地址,我们选择下载linux 64位程序,截止到 2019.12.27 最新软件版本为 0.17.1

  • 下载

    选择 litecoin-0.17.1-x86_64-linux-gnu.tar.gz 适用于centos7的安装包

    wget https://download.litecoin.org/litecoin-0.17.1/linux/litecoin-0.17.1-x86_64-linux-gnu.tar.gz
    
  • 解压压缩包

    tar -zxvf litecoin-0.17.1-x86_64-linux-gnu.tar.gz
    

2.配置litecoin

  • 创建数据存储路径 /data/litecoin/litecoin_data

    mkdir -p /data/litecoin/litecoin_data
    
  • 创建配置文件到路径 /data/litecoin/litecoin.conf

    vim /data/litecoin/litecoin.conf
    
  • 向配置文件中添加如下内容

    # rpc 用户名
    rpcuser=litecoinrpc
    # rpc 密码
    rpcpassword=litecoin202001
    
    rpcallowip=0.0.0.0/0
    # 端口
    rpcport=9046
    
    # 是否是服务器
    server=1
    # 允许后台运行
    daemon=1
    txindex=1
    # 非测试网络  
    testnet=0
    dbcache=8000
    
    # 区块存储位置
    datadir=/data/litecoin/litecoin_data
    #paytxfee=0.00
    # rpc 请求超时时间
    #rpctimeout=30
    # 不挖矿
    #gen=0
    # 通知到账
    

3.运行litecoin

进入安装目录,进入litecoin-0.17.1//bin/

  • ​ 执行 ./litecoind --version 查看版本号

    Litecoin Core Daemon version v0.17.1
    Copyright (C) 2011-2019 The Litecoin Core developers
    Copyright (C) 2009-2019 The Bitcoin Core developers
    
    Please contribute if you find Litecoin Core useful. Visit
    <https://litecoin.org> for further information about the software.
    The source code is available from
    <https://github.com/litecoin-project/litecoin>.
    
    This is experimental software.
    Distributed under the MIT software license, see the accompanying file COPYING
    or <https://opensource.org/licenses/MIT>
    
    This product includes software developed by the OpenSSL Project for use in the
    OpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by
    Eric Young and UPnP software written by Thomas Bernard.
    
  • 将可执行文件拷贝至环境目录

    sudo cp litecoin-cli /usr/bin/
    sudo cp litecoind /usr/bin/
    
  • 启动运行

    sudo litecoind -conf=/data/litecoin/litecoin.conf
    

    出现 Litecoin server starting 说明莱特币正在同步节点.

    也可以去区块存储位置查看/data/litecoin/litecoin_data/debug.log日志

4.查看同步信息

  • 执行命令

    sudo litecoin-cli -conf=/data/litecoin/litecoin.conf getblockchaininfo
    
  • 结果中 blocks 为目前同步区块数,网络状态良好的情况下从零同步大约需要24小时,占用磁盘大约30G

    {
      "chain": "main",
      "blocks": 1770453,
      "headers": 1770453,
      "bestblockhash": "d7831322d7babe25e051ddab10285deac92c2fa7b2f27552e8ef2fb8da936a80",
      "difficulty": 5611557.210897547,
      "mediantime": 1578900373,
      "verificationprogress": 0.9999985435825187,
      "initialblockdownload": false,
      "chainwork": "0000000000000000000000000000000000000000000003942a013fa421321cb2",
      "size_on_disk": 26804527696,
      "pruned": false,
      "softforks": [
        {
          "id": "bip34",
          "version": 2,
          "reject": {
            "status": true
          }
        },
        {
          "id": "bip66",
          "version": 3,
          "reject": {
            "status": true
          }
        },
        {
          "id": "bip65",
          "version": 4,
          "reject": {
            "status": true
          }
        }
      ],
      "bip9_softforks": {
        "csv": {
          "status": "active",
          "startTime": 1485561600,
          "timeout": 1517356801,
          "since": 1201536
        },
        "segwit": {
          "status": "active",
          "startTime": 1485561600,
          "timeout": 1517356801,
          "since": 1201536
        }
      },
      "warnings": ""
    }
    
    

5.设置节点密码

如果不设置节点密码,则在进行转账交易的时候会提示节点在裸call,所以需要设置节点密码,该密码也需要配置到后台服务的配置文件中,设置命令:

sudo litecoin-cli -conf=/data/litecoin/litecoin.conf encryptwallet "hahahah"

加密后 litecoind 服务会停止, 需要运行 sudo litecoind -conf=/data/litecoin/litecoin.conf 重新启动

6.确认 litecoind 服务启动

ps aux | grep litecoind

7.停止 litecoin 应用 (不停止不用执行一下命令)

litecoin-cli 是进行rpc各种命令操作的

  • 停止服务:

    sudo litecoin-cli -conf=/data/litecoin/litecoin.conf stop
    
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页