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小时前 ...
随机推荐
- sklearn简单线性回归
from sklearn import datasetsfrom sklearn.model_selection import train_test_splitfrom sklearn.linear_ ...
- dockerfile里面的内容编写顺序,必须严格按照顺序编写,否则编译不成
完整文档请参照https://www.cnblogs.com/effortsing/p/10480972.html 这里只介绍dockerfile里面的步骤顺序 cat>/home/jenkin ...
- C#Json数据反序列化为Dictionary并根据关键字获取指定的值
Json数据: { "dataSet": { "header": { ", "errorInfo": "HTTP请求错误 ...
- DataTable.NET 使用server-side processing
https://datatables.net/examples/server_side/simple.html 當頁面上要顯示的數據在10萬筆以上時,可以使用server-side processin ...
- Js把对象数组列表转换成数组
今天写组件的时候遇到一个问题,就是当我需要对获取到的对象列表进行删减的时候,发现没有合适的方法,比如: //获取图片列表 var imgs = document.getElementsByTagNam ...
- maven 中配置多个mirror的问题
公司搭建的maven私服做镜像,有使用aliyun的镜像,还有其他地方的, 默认情况下配置多个mirror的情况下,只有第一个生效.那么我们可以将最后一个作为默认值,前面配置的使用环境变量动态切换. ...
- varnish缓存清理
本篇日志应该较早该去写的,一直脱了好久,直到最近才写.在使用任务cache工具时,都会提到的一个问题.如何只清理想清理的那部分缓存,而其已缓存的部分不受影响 .这里就要用到varnishadm工具,先 ...
- java抽象类及接口
Java抽象类: 抽象类特点:抽象类除了不能实例化对象之外,类的其它功能依然存在,成员变量.成员方法和构造方法的访问方式和普通类一样. 由于抽象类不能实例化对象,所以抽象类必须被extends [抽象 ...
- (一)Shiro,久闻其名,而今初相识
文章目录 shiro简介 功能介绍 从外部看 Shiro 架构 从内部看 Shiro 架构 多说一句,在学习shiro之前,我觉得应该先用 filter ,自己动手写过粗粒度的权限系统,而不要一上来就 ...
- C++ 获取系统当前时间(日历时)
获取系统当前时间(日历时) //Linux & C++11 #include <chrono> #include <ctime> using namespace std ...