Linux系统下搭建莱特币LTC开发环境

1、简介

     莱特币加密货币是一种点对点的分布式网络货币系统。莱特币是受比特币的启发而推出的改进版数字货币。如果说比特币的价值是黄金,那么莱特币就是白银。莱特币的技术原理与比特币相同,也是采用去中心化的架构、无任何中心机构控制。可以以低廉的手续费向世界上的任何地方付款。和比特币相比,莱特币有如下几个优点。

  • 更快的处理交易,每2.5分钟就会产生一个块
  • 货币的总量是比特币的4倍,共发行8400万个莱特币
  • 莱特币使用新的工作量证明算法(scrypt)加密算法,使得更容易挖出莱特币。

2、LTC 客户端下载

下载地址:https://litecoin.org/cn/

下载命令: wget https://download.litecoin.org/litecoin-0.17.1/linux/litecoin-0.17.1-x86_64-linux-gnu.tar.gz

3、解压到一个固定的目录中

命令:tar zxvf litecoin-0.17.1-x86_64-linux-gnu.tar.gz


 

4、启动客户端

启动命令:

./litecoind -daemon -datadir=/var/litecoin -txindex -rpcallowip=140.143.237.224 -rpcport=16567 -rpcuser=litecoin-huan -rpcpassword=litecoin-huan -server -testnet

4.1、参数解释:

-daemon:以后台进程的方式进行启动
-datadir:数据存放的目录
-txindex:维护所有交易的索引
-rpcallowip:允许那个ip可以访问JSON-RPC接口
-rpcport:JSON-RPC的端口
-rpcuser:JSON-RPC的用户名
-rpcpassword:JSON-RPC的密码
-server:表示可以接收JSON-RPC的命令
-testnet:表示的是测试网

4.2、更多详细的配置

执行如下命令: ./litecoind  --help

5、执行命令测试一下

/usr/local/litecoin-0.17.1/bin/litecoin-cli -rpcconnect=140.143.237.224 -rpcport=16567 -rpcuser=litecoin-huan -rpcpassword=litecoin-huan -testnet getblockcount


  

6、获取莱特币测试币(水龙头)

https://kuttler.eu/en/bitcoin/ltc/faucet/

 注意:

         此网站发送的测试币是由别人手动发送的,可能需要几天的时间才能到账。

7、莱特币浏览器

https://chain.so/testnet/ltc

8、莱特币的Api

莱特币的api和比特币的api大体上是相似的,一般比特币可以使用的api莱特币都可以使用。

9、使用ZeroMQ来订阅新的交易和块

启动莱特币客户端时增加如下参数:

ZeroMQ notification options:
	-zmqpubhashblock=<address>
   		Enable publish hash block in <address>
	-zmqpubhashtx=<address>
   		Enable publish hash transaction in <address>
	-zmqpubrawblock=<address>
   		Enable publish raw block in <address>
	-zmqpubrawtx=<address>
   		Enable publish raw transaction in <address>

猜你喜欢

转载自huan1993.iteye.com/blog/2443019
今日推荐