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. npm publish 一直报错 404

    在封装 zswui  react ui 组件库的时候,尝试了下 github的 packages 包设置,然后就给自己挖坑了. zswui   这是一个从零开始配置,实现组件开发测试的项目. 因为设置 ...

  2. netty WEBSOKET 客户端 JAVA

    https://blog.csdn.net/mafei6827/article/details/80657405 https://blog.csdn.net/u010939285/article/de ...

  3. div定位relative和absolute测试1

    div里的position定位也是比较常见的,relative是相对定位,absolute是绝对定位.如本文测试:body自带8px的margin,这里不对其进行清空.蓝色的div和红色的div分别设 ...

  4. Nginx日志挂载目录为nfs文件服务器时开机无法自启动的问题解决

    为了方便收集查看日志把nginx日志输出至nfs文件服务器,nfs文件服务器使用autofs自动挂载,nginx和autofs都使用systemctl设置了开机自启动. 但是在重启主机的时候nginx ...

  5. docker 安装 tomcat8

    docker hub 查找 tomcat meiya@meiya:/etc/docker$ docker search tomcat NAME DESCRIPTION STARS OFFICIAL A ...

  6. java多线程中篇(一) —— Thread详情

    简介 简言之,现在的JDK线程模型基于操作系统原生线程,所以模型依赖于操作系统对线程的支持,另外Windows和Linux系统提供的线程模型就是一对一的 所以可以简单认为: 现在Java线程与操作系统 ...

  7. java通过jasper文件生成jpg图片

    iReport资料紧俏,整理好就赶紧传上来: 工具类:JpgExport public class JpgExportUtil { public static String Export(Map< ...

  8. adb连接安卓设备的2种方式

    一.usb连接 安卓设备打开开发者模式,启用usb调试 CMD窗口输入adb devices,此时可以看到自己的设备 PS:无法看到自己设备时,查看手机USB调试是否打开:PC端是否安装手机驱动. 二 ...

  9. JAVA基础_修饰符

    引言:Java的修饰符根据修饰的对象不同,分为类修饰符.方法修饰符.变量修饰符,其中每种修饰符又分为访问控制修饰符和非访问控制修饰符.访问控制存在的原因:a.让客户端程序员无法触及他们不应该触及的部分 ...

  10. 2.33模型--去除字符串两头空格.c

    [注:本程序验证是使用vs2013版] #include <stdio.h> #include <stdlib.h> #include <string.h> #pr ...