IOTA私有链简单搭建
IOTA
参考:https://github.com/iotaledger/wallet
参考:https://github.com/iotaledger/iota.js
参考:https://github.com/schierlm/private-iota-testnet
参考:https://docs.iota.org/
基础环境
npm install -g electron
npm install -g bower
npm install ajv@^5.0.0
构建自己的Snapshot.txt
进入private-iota-tetstnet-master文件目录
mvn package
分配2,779,530,283,277,761个可用的iota到指定的地址上
java -jar target/iota-testnet-tools-0.1-SNAPSHOT-jar-with-dependencies.jar SnapshotBuilder
将Snapshot.txt文件与iri-1.4.2.4.jar放在一个文件夹后开启服务
java -jar iri-1.4.2.4.jar --testnet --testnet-no-coo-validation --snapshot=Snapshot.txt -p 11219
创建里程碑
java -jar target/iota-testnet-tools-0.1-SNAPSHOT-jar-with-dependencies.jar Coordinator localhost 11219
搭建钱包
git clone https://github.com/iotaledger/wallet
cd wallet
git clone https://github.com/iotaledger/iri
cd iri //放进 iri.jar 更改名字为
//更改testnet.json 覆盖 .json
npm install //会比较久
npm start
安装库
npm install iota.lib.js
可能遇到的问题
- Could not resolve dependencies for project com.iota:iri:jar:1.7.0-DEV-${git.commit.id.abbrev}: Could not find artifact com.sun:tools:jar:1.8 at specified path /usr/lib/jvm/java-11-openjdk-amd64/../lib/tools.jar -> [Help 1]
- ubuntu默认安装JAVA的openjdk版本没有tools.jar的问题
sudo apt-get install openjdk-8-jdk
- /home/xxx/wallet/node_modules/electron/dist/electron: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
- ubuntu默认没有该库
+sudo apt -y install libgconf2-4
Gtk-Message: 04:25:25.218: Failed to load module "canberra-gtk-module"
sudo apt-get install libcanberra-gtk-module
context mismatch in svga_sampler_view_destroy
- echo "export SVGA_VGPU10=0" >> ~/.bashrc
示例脚本
const IOTA = require('iota.lib.js')
const iota = new IOTA({
host: 'http://127.0.0.1',
port: 11219
})
const seed = 'APMXGGWAIIQFKV9CYSKKDYUOFZC9FYMGQAELAUJBDW9SMXNNRIYPLOMQYT9SMNLUVFWSHJFDYMGBSMBAL';
const Depth = 3 /* constant defined by IOTA - how deep to look for the tips in the Tangle*/
const MinWeightMagnitude = 13 /* constant defined by IOTA Testnet - the difficulty of PoW*/
const transfers = [
{
// where are we sending the transaction to?
address: 'OHCEFHHAKKNSINQTNK9DPEERVIPOBPKKJWNIFLUEMTJGFZUGASHRMZUGSOGQEJRVFSMFFH9PGBBILNHPZSOILTDFLW',
// how many tokens are we transferring?
value: 100,
// do we want to comment on this transaction?
message: iota.utils.toTrytes('Hello World!')
}
]
iota.api.getNodeInfo((error, nodeInfo) => {
if (error) {
console.error('getNodeInfo error', error)
} else {
console.log('getNodeInfo result', nodeInfo)
}
});
iota.api.sendTransfer(seed, Depth, MinWeightMagnitude, transfers, (error, transactions) => {
if (error) {
console.error('sendTransfer error', error)
} else {
console.log('transactions sent!', transactions)
}
});
IOTA私有链简单搭建的更多相关文章
- Truffle 4.0、Geth 1.7.2、TestRPC在私有链上搭建智能合约
目录 目录 1.什么是 Truffle? 2.适合 Truffle 开发的客户端 3.Truffle的源代码地址 4.如何安装? 4.1.安装 Go-Ethereum 1.7.2 4.2.安装 Tru ...
- 以太坊开发(二)使用Ganache CLI在私有链上搭建智能合约
以太坊开发(二)使用Ganache CLI在私有链上搭建智能合约 在上一篇文章中,我们使用Truffle自带的客户端Truffle Develop,在私有链上搭建并运行了官方提供的WebPack智能合 ...
- 区块链学习(四)truffle部署编译智能合约以太坊私有链
前面我们介绍了以太坊私有链的搭建以及多节点私有链网络,这次我们介绍如何使用truffle框架来部署编译智能合约到我们之前搭建的私有链网络中. 搭建环境及需使用的工具:ubuntu18.04 Truf ...
- 转:使用 Go-Ethereum 1.7.2搭建以太坊私有链
使用 Go-Ethereum 1.7.2搭建以太坊私有链 目录 [toc] 1.什么是Ethereum(以太坊) 以太坊(Ethereum)并不是一个机构,而是一款能够在区块链上实现智能合约.开源的底 ...
- 以太坊 链私有链环境搭建(windows)
摸索以太坊区块链技术几个月了.最近打算逐步的把自己学到的东西和大家分享一下.在阅读本文之前,希望大家能对区块链的概念能有所了解.这样操作过程中的环节理解更深入.下面开始进入准备.因为本次是window ...
- 使用 Go-Ethereum 1.7.2搭建以太坊私有链
目录 [toc] 1.什么是Ethereum(以太坊) 以太坊(Ethereum)并不是一个机构,而是一款能够在区块链上实现智能合约.开源的底层系统,以太坊从诞生到2017年5月,短短3年半时间,全球 ...
- docker 搭建以太坊私有链搭建
最近区块链,火得不行,身边也有朋友准备玩这个,说是搭了一个星期,没有把环境搭建起来,叫我帮忙看看环境怎么搭建 于是我找到了官方的地址 https://github.com/ethereum/go-et ...
- 区块链--Ubuntu上搭建以太坊私有链
1.搭建私链所需环境 操作系统:ubuntu16.04,开虚拟机的话要至少4G,否则会影响测试挖矿时的速度 软件: geth客户端 Mist和Ethereum Wallet:https://githu ...
- 转:区块链开发(一)搭建基于以太坊go-ethereum的私有链环境
区块链开发(一)搭建基于以太坊go-ethereum的私有链环境 wo541075754 · 2016-11-07 13:00:03 · 3730 次点击 · 预计阅读时间 3 分钟 · 约1小时前 ...
随机推荐
- numpy包中,与线性代数相关的模块——linalg(利那隔)
https://github.com/scalanlp/breeze/wiki/Linear-Algebra-Cheat-Sheethttps://docs.scipy.org/doc/numpy-1 ...
- curl命令测试网络请求中DNS解析、响应时间
https://blog.csdn.net/dreamer2020/article/details/78152576
- Red Team远程控制软件
开源远程管理控制 https://github.com/malwaredllc/byob 僵尸网络生成框架 https://github.com/panda-re/lava 大规模向程序中植入恶意程序 ...
- Socket测试工具(客户端、服务端)
Socket是什么? SOCKET用于在两个基于TCP/IP协议的应用程序之间相互通信.最早出现在UNIX系统中,是UNIX系统主要的信息传递方式.在WINDOWS系统中,SOCKET称为WINSOC ...
- 【GStreamer开发】GStreamer基础教程08——pipeline的快捷访问
目标 GStreamer建立的pipeline不需要完全关闭.有多种方法可以让数据在任何时候送到pipeline中或者从pipeline中取出.本教程会展示: 如何把外部数据送到pipeline中 如 ...
- addEventListener兼容性问题
参考链接:https://blog.csdn.net/lililiaaa/article/details/83960924
- Appium移动自动化测试-----(十二)appium API 之 TouchAction 操作
Appium的辅助类,主要针对手势操作,比如滑动.长按.拖动等. 1.按压控件 方法: press() 开始按压一个元素或坐标点(x,y).通过手指按压手机屏幕的某个位置. press(WebElem ...
- 安装rpy2 报错<cdef source string>:23:5: before: blah1 解决办法就是直接下载一个rpy2的轮子
win7上安装rpy2, python环境是3.6.1. 使用pip install rpy2直接安装rpy2,对应的版本时rpy2 3.0.5 报如下错误: ERROR: Complete outp ...
- JVM(四) 垃圾回收
1. 堆内存结构 Java堆从GC的角度可以细分为:新生代(Eden区.From Survivor区和To Survivor区)和老年代. 1.1 新生代 新生代是用来存放新生的对象.一般占据堆的1/ ...
- hadoop 集群调优实践总结
调优概述# 几乎在很多场景,MapRdeuce或者说分布式架构,都会在IO受限,硬盘或者网络读取数据遇到瓶颈.处理数据瓶颈CPU受限.大量的硬盘读写数据是海量数据分析常见情况. IO受限例子: 索引 ...