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

可能遇到的问题

  1. 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
  1. /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
  1. Gtk-Message: 04:25:25.218: Failed to load module "canberra-gtk-module"

    • sudo apt-get install libcanberra-gtk-module
  2. 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私有链简单搭建的更多相关文章

  1. 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 ...

  2. 以太坊开发(二)使用Ganache CLI在私有链上搭建智能合约

    以太坊开发(二)使用Ganache CLI在私有链上搭建智能合约 在上一篇文章中,我们使用Truffle自带的客户端Truffle Develop,在私有链上搭建并运行了官方提供的WebPack智能合 ...

  3. 区块链学习(四)truffle部署编译智能合约以太坊私有链

    前面我们介绍了以太坊私有链的搭建以及多节点私有链网络,这次我们介绍如何使用truffle框架来部署编译智能合约到我们之前搭建的私有链网络中. 搭建环境及需使用的工具:ubuntu18.04  Truf ...

  4. 转:使用 Go-Ethereum 1.7.2搭建以太坊私有链

    使用 Go-Ethereum 1.7.2搭建以太坊私有链 目录 [toc] 1.什么是Ethereum(以太坊) 以太坊(Ethereum)并不是一个机构,而是一款能够在区块链上实现智能合约.开源的底 ...

  5. 以太坊 链私有链环境搭建(windows)

    摸索以太坊区块链技术几个月了.最近打算逐步的把自己学到的东西和大家分享一下.在阅读本文之前,希望大家能对区块链的概念能有所了解.这样操作过程中的环节理解更深入.下面开始进入准备.因为本次是window ...

  6. 使用 Go-Ethereum 1.7.2搭建以太坊私有链

    目录 [toc] 1.什么是Ethereum(以太坊) 以太坊(Ethereum)并不是一个机构,而是一款能够在区块链上实现智能合约.开源的底层系统,以太坊从诞生到2017年5月,短短3年半时间,全球 ...

  7. docker 搭建以太坊私有链搭建

    最近区块链,火得不行,身边也有朋友准备玩这个,说是搭了一个星期,没有把环境搭建起来,叫我帮忙看看环境怎么搭建 于是我找到了官方的地址 https://github.com/ethereum/go-et ...

  8. 区块链--Ubuntu上搭建以太坊私有链

    1.搭建私链所需环境 操作系统:ubuntu16.04,开虚拟机的话要至少4G,否则会影响测试挖矿时的速度 软件: geth客户端 Mist和Ethereum Wallet:https://githu ...

  9. 转:区块链开发(一)搭建基于以太坊go-ethereum的私有链环境

    区块链开发(一)搭建基于以太坊go-ethereum的私有链环境 wo541075754 · 2016-11-07 13:00:03 · 3730 次点击 · 预计阅读时间 3 分钟 · 约1小时前  ...

随机推荐

  1. python 的环境变量

    import sys,os BASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(B ...

  2. linux c基础技巧

    C语言:向文件末尾进行追加数据https://blog.csdn.net/qq_31243065/article/details/82354557 https://zhidao.baidu.com/q ...

  3. [.Net Core] - Asp.Net Core 编译成功,发布失败之解决

    背景 Asp.Net Core 项目编译成功,发布失败. 错误 Assets file 'D:\……\obj\project.assets.json' doesn't have a target fo ...

  4. phpstrom xdebug phpstudy调试,跳不到设置断点的原因,以及配置方法

    设置的是127 的地址,而用localhost 方式请求,所以无法跳到断点 环境 phpstudy 2018 php 7.2.10 xdebug版本 (因为要与php版本要对应,注意别选错了,我的用的 ...

  5. Python函数基础学习(定义、函数参数、递归函数)

    1.本程序是测试函数的基础.函数的参数.递归函数的测试. 函数的参数有: 必选参数.默认参数.可变参数.命名关键字参数和关键字参数 #!/usr/bin/python # -*- coding: ut ...

  6. C++_自引用指针this

    自引用指针this 例 3.1 this指针的引例 #include<iostream.h> class A{ public: A(int x1){ x=x1; } void disp() ...

  7. django 相关配置(pycharm)

      第二步  

  8. 小程序的目录结构/配置介绍/视图层wxml数据绑定/双线程模型/小程序的启动流程

    安装好微信小程序开发软件,创建项目 小程序文件结构和传统web对比 结构 传统web 微信小程序 结构 HTML WXML 样式 CSS WXSS 逻辑 Javascript Javascript 配 ...

  9. OpenCV学习笔记3

    OpenCV学习笔记3 图像平滑(低通滤波) 使用低通滤波器可以达到图像模糊的目的.这对与去除噪音很有帮助.其实就是去除图像中的高频成分(比如:噪音,边界).所以边界也会被模糊一点.(当然,也有一些模 ...

  10. 机器学习之softmax回归笔记

    本次笔记绝大部分转自https://www.cnblogs.com/Luv-GEM/p/10674719.html softmax回归 Logistic回归是用来解决二类分类问题的,如果要解决的问题是 ...