Docker-compose部署LTC同步节点

1、下载ltc程序包,litecoin下载地址
下载页
在这里插入图片描述

mkdir /data/docker-compose/ltc
cd /data/docker-compose/ltc
https://github.com/litecoin-project/litecoin/releases/download/v0.21.3/litecoin-0.21.3-x86_64-linux-gnu.tar.gz

2、编写dockerfile和bitcoin.conf
bitcoin.conf

cat bitcoin.conf
server=1
txindex=1
listen=1
rpcbind=0.0.0.0:9332
rpcallowip=0.0.0.0/0
rpcport=9332
rpcuser=root
rpcpassword=123456
uacomment=litecoin
datadir=/litecoin/data

Dockerfile

FROM ubuntu:20.04# 安装依赖库和工具
RUN apt-get update && apt-get install -y \curl \libssl-dev \libevent-dev \software-properties-commonADD litecoin-0.21.3-x86_64-linux-gnu.tar.gz .
# 解压并复制二进制文件到 /usr/local/bin 目录
RUN mv litecoin-0.21.3/bin/litecoind /usr/local/bin/ && \mv litecoin-0.21.3/bin/litecoin-cli /usr/local/bin/ && \rm -rf litecoin-0.21.3 # 配置 Bitcoin Cash 节点
COPY litecoin.conf /root/.litecoin/litecoin.conf# 暴露节点端口
EXPOSE 9332 9333# 启动 Bitcoin Cash 节点
CMD ["/usr/local/bin/litecoind", "--conf=/root/.litecoin/litecoin.conf", "--printtoconsole"]

3、编译镜像

~# docker build -t devocenter/litecoin .
[+] Building 1.9s (11/11) FINISHED                                                                                                                                                                                             docker:default=> [internal] load build definition from Dockerfile                                                                                                                                                                                     0.0s=> => transferring dockerfile: 699B                                                                                                                                                                                                     0.0s=> [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                          1.8s=> [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                                                                            0.0s=> [internal] load .dockerignore                                                                                                                                                                                                        0.0s=> => transferring context: 2B                                                                                                                                                                                                          0.0s=> [1/5] FROM docker.io/library/ubuntu:20.04@sha256:21ae67bf44d1d0a53ecdce48742c766e44aea4d16e18a3b88a3888eddaf782b5                                                                                                                    0.0s=> [internal] load build context                                                                                                                                                                                                        0.0s=> => transferring context: 264B                                                                                                                                                                                                        0.0s=> CACHED [2/5] RUN apt-get update && apt-get install -y     curl     libssl-dev     libevent-dev     software-properties-common                                                                                                        0.0s=> CACHED [3/5] ADD litecoin-0.21.3-x86_64-linux-gnu.tar.gz .                                                                                                                                                                           0.0s=> CACHED [4/5] RUN mv litecoin-0.21.3/bin/litecoind /usr/local/bin/ &&     mv litecoin-0.21.3/bin/litecoin-cli /usr/local/bin/ &&     rm -rf litecoin-0.21.3                                                                           0.0s=> [5/5] COPY litecoin.conf /root/.litecoin/litecoin.conf                                                                                                                                                                               0.0s=> exporting to image                                                                                                                                                                                                                   0.0s=> => exporting layers                                                                                                                                                                                                                  0.0s=> => writing image sha256:d2a95e0f8ee1e369e2c30f4d16e9d1ef2d5fd6738dec4e7e35b35ef59f3692fa                                                                                                                                             0.0s=> => naming to docker.io/devocenter/litecoin

4、镜像打tag push到仓库

root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker tag d2a95e0f8ee1 devocenter/litecoin:v0.21.3
root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker images
REPOSITORY            TAG       IMAGE ID       CREATED         SIZE
devocenter/litecoin   latest    d2a95e0f8ee1   2 minutes ago   396MB
devocenter/litecoin   v0.21.3   d2a95e0f8ee1   2 minutes ago   396MB
root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker login docker.io
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/Username: devocenter
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded
root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker push devocenter/litecoin:v0.21.3
The push refers to repository [docker.io/devocenter/litecoin]
1990ef79999f: Pushed 
090faf555056: Layer already exists 
6c066eebe679: Layer already exists 
9de7d6e778cc: Layer already exists 
e915d510ff2b: Layer already exists 
v0.21.3: digest: sha256:6d80ac2495c2497f2c8ce99a55302c66d1d7da25edd67ea925fc7663a130ac88 size: 1371
root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker push devocenter/litecoin
Using default tag: latest
The push refers to repository [docker.io/devocenter/litecoin]
1990ef79999f: Layer already exists 
090faf555056: Layer already exists 
6c066eebe679: Layer already exists 
9de7d6e778cc: Layer already exists 
e915d510ff2b: Layer already exists 
latest: digest: sha256:6d80ac2495c2497f2c8ce99a55302c66d1d7da25edd67ea925fc7663a130ac88 size: 1371

在这里插入图片描述

5、编写docker-compose.yaml文件

version: '3'services:bch-node:image: devocenter/litecoinvolumes:- ./bitcoin.conf:/root/.bitcoin/bitcoin.conf- ./data:/litecoin/datarestart: always        ports:- 9332:9332- 9333:9333

6、启动容器

root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker-compose up -d
WARN[0000] /data/ltc/docker-compose.yaml: `version` is obsolete 
[+] Running 2/2 Network ltc_default       Created                                                                                                                                                                                                     0.0s  Container ltc-bch-node-1  Started                                                                                                                                                                                                     0.2s 
root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker-compose ps
WARN[0000] /data/ltc/docker-compose.yaml: `version` is obsolete 
NAME             IMAGE                 COMMAND                  SERVICE    CREATED         STATUS         PORTS
ltc-bch-node-1   devocenter/litecoin   "/usr/local/bin/lite…"   bch-node   4 seconds ago   Up 2 seconds   0.0.0.0:9332-9333->9332-9333/tcp, :::9332-9333->9332-9333/tcp

7、验证节点同步情况

root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker exec -it ltc-bch-node-1 /bin/bash
#获取最新同步区块的信息
root@0d354a8aae19:/# curl --user root:123456  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9332/
{"result":{"chain":"main","blocks":39048,"headers":2677088,"bestblockhash":"d8ce662813d1fd00356081a74f244de3537862200e6ca1981ff799d40b77dd0d","difficulty":0.640534438438908,"mediantime":1322339330,"verificationprogress":0.0008527834538067149,"initialblockdownload":true,"chainwork":"00000000000000000000000000000000000000000000000000002b182584c4d3","size_on_disk":369020539,"pruned":false,"softforks":{"bip34":{"type":"buried","active":false,"height":710000},"bip66":{"type":"buried","active":false,"height":811879},"bip65":{"type":"buried","active":false,"height":918684},"csv":{"type":"buried","active":false,"height":1201536},"segwit":{"type":"buried","active":false,"height":1201536},"taproot":{"type":"bip8","bip8":{"status":"defined","start_height":2161152,"timeout_height":2370816,"since":0},"active":false},"mweb":{"type":"bip8","bip8":{"status":"defined","start_height":2217600,"timeout_height":2427264,"since":0},"active":false}},"warnings":""},"error":null,"id":"curltest"}# 获取最新同步到的区块数
root@0d354a8aae19:/# curl --user root:123456  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9332/
{"result":39248,"error":null,"id":"curltest"}#获取最新同步区块的信息
litecoin-cli --conf=/root/.litecoin/litecoin.conf getblockchaininfo
{"chain": "main","blocks": 0,"headers": 455999,"bestblockhash": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2","difficulty": 0.000244140625,"mediantime": 1317972665,"verificationprogress": 5.359866906187669e-09,"initialblockdownload": true,"chainwork": "0000000000000000000000000000000000000000000000000000000000100010","size_on_disk": 288,"pruned": false,"softforks": {"bip34": {"type": "buried","active": false,"height": 710000},"bip66": {"type": "buried","active": false,"height": 811879},"bip65": {"type": "buried","active": false,"height": 918684},"csv": {"type": "buried","active": false,"height": 1201536},"segwit": {"type": "buried","active": false,"height": 1201536},"taproot": {"type": "bip8","bip8": {"status": "defined","start_height": 2161152,"timeout_height": 2370816,"since": 0},"active": false},"mweb": {"type": "bip8","bip8": {"status": "defined","start_height": 2217600,"timeout_height": 2427264,"since": 0},"active": false}},"warnings": ""
}

lite节点钱包设置密码

root@iZt4n6qi8yq5skigf2kwxwZ:/data/ltc# docker exec -it ltc-bch-node-1 /bin/bash
root@0d354a8aae19:/# litecoin-cli --conf=/root/.litecoin/litecoin.conf encryptwallet Lite@2024

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/316738.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

JVM (Micrometer)监控SpringBoot(AWS EKS版)

问题 怎样使用JVM (Micrometer)面板&#xff0c;监控Spring&#xff1f;这里不涉及Prometheus和Grafana&#xff0c;重点介绍与Micrometer与Springboot&#xff0c;k8s怎样集成。 pom.xml 引入依赖&#xff0c;如下&#xff1a; <properties><micrometer.version&…

【蓝桥杯C++A组省三 | 一场勇敢的征途与致19岁的信】

随着4.13西大四楼考场的倒计时结束… 就这样蓝桥杯落幕了 省三的名次既满足又不甘心&#xff0c;但又确乎说得上是19岁途中的又一枚勋章 从去年得知&#xff0c;纠结是否要报名、到寒假开始战战兢兢地准备、陆续开始创作博客&#xff0c;记录好题和成长……感谢你们的关注&…

2024年十五届蓝桥杯省赛大学B组真题(Java完整版)

2024年十五届蓝桥杯省赛大学B组真题&#xff08;Java&#xff09; 前言&#xff1a; 赛后一直犹豫要不要对比赛进行复盘出个题解&#xff0c;拖到了现在&#xff0c;终于也是等到比赛结果出来&#xff0c;看到没有辜负个人期望成功取得省一&#xff0c;决定在国赛前对省赛进行…

使用 Python 代码实现 ICMP Timestamp 请求和回应

前言 ICMP&#xff08;Internet Control Message Protocol&#xff09;是在IP网络上传输控制消息的协议。其中&#xff0c;ICMP Timestamp请求和回应是ICMP协议中的一种消息类型&#xff0c;用于获取和同步网络设备的时间戳信息。 ICMP Timestamp请求和回应的工作原理如下&am…

STM32与Proteus的串口仿真详细教程与源程序

资料下载地址&#xff1a;STM32与Proteus的串口仿真详细教程与源程序 资料内容 包含LCD1602显示&#xff0c;串口发送接收&#xff0c;完美实现。 文档内容齐全&#xff0c;包含使用说明&#xff0c;相关驱动等。 解决了STM32的Proteus串口收发问题。 注意&#xff1a;每输…

【酱浦菌-爬虫项目】爬取百度文库文档

1. 首先&#xff0c;定义了一个变量url&#xff0c;指向百度文库的搜索接口 ‘https://wenku.baidu.com/gsearch/rec/pcviewdocrec’。 2. 然后&#xff0c;设置了请求参数data&#xff0c;包括文档ID&#xff08;docId&#xff09;和查询关键词&#xff08;query&#xff09;。…

debian gnome-desktop GUI(图形用户界面)系统

目录 &#x1f31e;更新 &#x1f3a8;安装 &#x1f34e;分配 &#x1f6cb;️重启 &#x1f511;通过VNC连接 debian gnome-desktop &#x1f31e;更新 sudo apt update sudo apt -y upgrade &#x1f3a8;安装 sudo apt -y install task-gnome-desktop 这个过程比…

【HTTP协议】了解http需要学习哪些内容

HTTP&#xff08;Hypertext Transfer Protocol&#xff09;是超文本传输协议&#xff0c;互联网上应用最广泛的一种协议&#xff0c;它负责在客户端和服务器之间传输数据。本文将从HTTP协议的基本原理、请求-响应模型、常见特性以及应用场景等方面进行总结。 1. HTTP基本原理 …

WordPress缓存插件有哪些?好用的缓存插件分享

目前WordPress缓存插件有&#xff1a;WP Rocket、WP Super Cache、W3 Total Cache、Sucuri、NitroPack、SiteGround Optimizer、LiteSpeed Cache、WP-Optimize、Hummingbird、Cache Enabler、Comet Cache。 在当今的数字世界中&#xff0c;拥有一个高效的网站对于吸引和留住用…

智慧农场系统 搭建重点,会用到哪些三方服务?

智慧农场小游戏的搭建重点主要集中在游戏设计、用户体验、数据安全和稳定性等方面。为了实现这些目标&#xff0c;可能会用到以下第三方服务&#xff1a; 游戏引擎和开发工具&#xff1a;使用成熟的游戏引擎和开发工具可以极大地简化开发流程&#xff0c;提高开发效率。例如&a…

Node+Express连接mysql实现增删改查

还是大剑师兰特&#xff1a;曾是美国某知名大学计算机专业研究生&#xff0c;现为航空航海领域高级前端工程师&#xff1b;CSDN知名博主&#xff0c;GIS领域优质创作者&#xff0c;深耕openlayers、leaflet、mapbox、cesium&#xff0c;canvas&#xff0c;webgl&#xff0c;ech…

GhostNetV3 论文学习

论文地址&#xff1a;https://arxiv.org/abs/2404.11202 代码地址&#xff1a;https://github.com/huawei-noah/Efficient-AI-Backbones 解决了什么问题&#xff1f; 对于边端设备&#xff0c;人们特别设计了一些精简的神经网络&#xff0c;这些网络推理速度更快、表现适中。…

C++并发编程

基本介绍 线程 C98标准没有直接提供原生的多线程支持 在C98中&#xff0c;并没有像后来的C11标准中那样的<thread>库或其他直接的多线程工具 然而&#xff0c;这并不意味着在C98中无法实现多线程。开发者通常会使用平台特定的API&#xff08;如Windows的线程API或POSI…

【C/C++】动态内存管理(C:malloc,realloc,calloc,free || C++:new,delete)

&#x1f525;个人主页&#xff1a; Forcible Bug Maker &#x1f525;专栏&#xff1a; C | | C语言 目录 前言C/C内存分布C语言中的动态内存管理&#xff1a;malloc/realloc/realloc/freemallocrealloccallocfree C中的动态内存管理&#xff1a;new/deletenew和delete操作内…

微信小程序:9.小程序配置

全局配置文件 小程序根目录下的app.json文件是小程序的全局配置文件。 常用的配置文件如下: pages 记录当前小程序所有的页面存放路径信息 window 全局设置小程序窗口外观 tabBar 设置小程序底部的tabBar效果 style 是否启用新版style 小程序窗口的组成部分 了解windo节点常…

HTTP:强缓存优化实践

强缓存&#xff1a;浏览器不会向服务器发送任何请求&#xff0c;直接从本地缓存中读取文件 强缓存是指浏览器在向服务器请求资源时&#xff0c;判断本地是否存在该资源的缓存&#xff0c;并判断是否过期。 如果本地缓存未过期&#xff0c;浏览器就直接使用本地缓存&#xff0c…

element 分页切换时:current-page无效 页数不会跟着一起切换

问题回溯&#xff1a;使用el-pagination组件 选择切换当前分页 页数为2 问题结果&#xff1a;el-pagination组件 当前页切换失败 一直都是 1&#xff0c;接口传参分页数据是2&#xff0c;打印当前分页也是2 解决方案1&#xff1a;使用 current-page参数 .sync 修饰符 解决方案2…

微信小程序简单实现购物车功能

微信小程序简单实现购物车结算和购物车列表展示功能 实现在微信小程序中对每一个购物车界面的商品订单&#xff0c;进行勾选结算和取消结算的功能&#xff0c;相关界面截图如下&#xff1a; 具体实现示例代码为&#xff1a; 1、js代码&#xff1a; Page({/*** 页面的初始数…

清理电脑垃圾软件

清理电脑垃圾软件 1.geek.exe 强力卸载 2. 磁盘分析 直接删除 log 磁盘文件大小分析工具WizTree_v4.01

TCP相关问题总结

文章目录 TCP连接建立过程1. TCP三次握手2. TCP四次挥手3. TCP为什么是三次握手4. TCP为什么是四次挥手 TCP流量控制TCP拥塞控制1. 为什么需要拥塞控制2. 控制手段 TCP连接建立过程中出现丢包 TCP连接建立过程 1. TCP三次握手 首先client端发出连接请求&#xff0c;并且请求同…