Author

Topic: 简单区块程序编写步骤 (Read 313 times)

copper member
Activity: 532
Merit: 0
February 26, 2018, 03:27:42 AM
#20
希望能有更多大虾来技术交流!
full member
Activity: 255
Merit: 100
February 25, 2018, 01:06:48 AM
#19
我会写python的程序。
newbie
Activity: 79
Merit: 0
February 15, 2018, 05:10:04 AM
#18
中文区已经沦陷成广告集聚地,你还是发到英文区比较好
member
Activity: 154
Merit: 10
February 14, 2018, 08:06:02 AM
#17
这个应该是要发到高级讨论区吧,这里 估计没几人看的明白
full member
Activity: 490
Merit: 100
February 14, 2018, 06:54:25 AM
#16
楼主这种帖子也算是一种干货,毕竟BTT充斥了太多的无意义的水贴,希望能多看见一些向楼主这样的技术帖子出现。
当然不一定多数人能看的懂,但是只要写出来,总是有会愿意去看的人,这个就是帖子的价值之所在。 Wink
newbie
Activity: 51
Merit: 0
February 13, 2018, 08:43:09 PM
#15
区块链技术会应用越来越普遍,希望能有更多大虾来技术交流!
full member
Activity: 266
Merit: 100
February 13, 2018, 08:32:10 PM
#14
感谢楼主分享,区块链技术会应用越来越普遍,希望能有更多大虾来技术交流
member
Activity: 103
Merit: 10
February 13, 2018, 08:16:46 PM
#13
好帖子哇,论坛里就该多些技术交流贴,大家可以互相交流,也能学到新的知识
full member
Activity: 277
Merit: 100
February 13, 2018, 07:56:09 PM
#12
多谢楼主分享,又学习到新知识了,区块链技术会越来越好,也是未来发展的一大方向
member
Activity: 462
Merit: 23
February 13, 2018, 04:04:40 PM
#11
你这个不是从别处搬运过来的吧? 如果是原创的话,建议整理一下,可以获取不少merit呢,如果是搬运过来的,建议注明出处,不然小心被别人举报,这个论坛的管理者们很反感copy行为的,即便你是从别的网站copy过来的,也可能被btt上的一些专门为了邀功获取merit的人抓住,然后举报以获取奖励。
当然,如果你是原创,大可不必考虑这个。

我在上面第一行已经写了英文原版编程的人名 Lauri Hartikka
原版是英文程序,如果懂编程的会知道,编程的步骤其实差不多,我用简单中文解释下行吧,
如果不行,就稍微改改里面一些 code, 就变成自己的了


其实我建议楼主,如果有这个技术或者想法,你可以写一写关于搭建海外节点方面的教程,现在流行节点挖矿,需要租用阿里云等公司的服务器,但是很多节点是用linux系统来安装软件的,老外的教程难以看懂,大家对这个可能更感兴趣吧。
毕竟区块程序编写这个离我们大多数人太过遥远了。

我只懂很基础的编程,这个根本就是编程基础入门,教别人我还没到那个级别,
这里肯定有很多懂得挖矿技术的牛人

member
Activity: 392
Merit: 14
February 13, 2018, 03:37:24 PM
#10
你这个不是从别处搬运过来的吧? 如果是原创的话,建议整理一下,可以获取不少merit呢,如果是搬运过来的,建议注明出处,不然小心被别人举报,这个论坛的管理者们很反感copy行为的,即便你是从别的网站copy过来的,也可能被btt上的一些专门为了邀功获取merit的人抓住,然后举报以获取奖励。
当然,如果你是原创,大可不必考虑这个。

我在上面第一行已经写了英文原版编程的人名 Lauri Hartikka
原版是英文程序,如果懂编程的会知道,编程的步骤其实差不多,我用简单中文解释下行吧,
如果不行,就稍微改改里面一些 code, 就变成自己的了


其实我建议楼主,如果有这个技术或者想法,你可以写一写关于搭建海外节点方面的教程,现在流行节点挖矿,需要租用阿里云等公司的服务器,但是很多节点是用linux系统来安装软件的,老外的教程难以看懂,大家对这个可能更感兴趣吧。
毕竟区块程序编写这个离我们大多数人太过遥远了。
member
Activity: 462
Merit: 23
February 13, 2018, 03:14:30 PM
#9
你这个不是从别处搬运过来的吧? 如果是原创的话,建议整理一下,可以获取不少merit呢,如果是搬运过来的,建议注明出处,不然小心被别人举报,这个论坛的管理者们很反感copy行为的,即便你是从别的网站copy过来的,也可能被btt上的一些专门为了邀功获取merit的人抓住,然后举报以获取奖励。
当然,如果你是原创,大可不必考虑这个。

我在上面第一行已经写了英文原版编程的人名 Lauri Hartikka
原版是英文程序,如果懂编程的会知道,编程的步骤其实差不多,我用简单中文解释下行吧,
如果不行,就稍微改改里面一些 code, 就变成自己的了
member
Activity: 392
Merit: 14
February 13, 2018, 03:08:21 PM
#8
你这个不是从别处搬运过来的吧? 如果是原创的话,建议整理一下,可以获取不少merit呢,如果是搬运过来的,建议注明出处,不然小心被别人举报,这个论坛的管理者们很反感copy行为的,即便你是从别的网站copy过来的,也可能被btt上的一些专门为了邀功获取merit的人抓住,然后举报以获取奖励。
当然,如果你是原创,大可不必考虑这个。
newbie
Activity: 58
Merit: 0
February 13, 2018, 02:50:20 PM
#7
赞技术贴,也想学习一下!
newbie
Activity: 201
Merit: 0
February 13, 2018, 01:08:19 PM
#6
支持楼主,难得的技术贴,论坛的风气会越来越好的。
newbie
Activity: 126
Merit: 0
February 13, 2018, 12:58:33 PM
#5
多谢指点
Error: Could not locate the bindings file. Tried:

找不到file,你可试试复制 file 到
/home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node

Error ECONNRESET: node 没连好
可参考这个链接
https://bitcointalk.org/index.php?topic=641696.1920;imode
member
Activity: 462
Merit: 23
February 13, 2018, 11:31:02 AM
#4
Error: Could not locate the bindings file. Tried:

找不到file,你可试试复制 file 到
/home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node

Error ECONNRESET: node 没连好
可参考这个链接
https://bitcointalk.org/index.php?topic=641696.1920;imode
newbie
Activity: 84
Merit: 0
February 13, 2018, 10:43:46 AM
#3
其实是不是就是个链表结构而已
newbie
Activity: 126
Merit: 0
February 13, 2018, 10:41:59 AM
#2
大佬,我在建一个矿池,下不去,能帮忙看一下吗

/Desktop/project02/pool$ node init.js
2018-02-10 17:48:30 [master] Pool spawned on 4 thread(s)
2018-02-10 17:48:30 [api] API started & listening on port 8117
2018-02-10 17:48:30 [payments] Started
2018-02-10 17:48:30 [unlocker] Started
2018-02-10 17:48:30 [api] Error getting daemon data {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}
2018-02-10 17:48:30 [api] Stat collection finished: NaN ms redis, 69 ms daemon
2018-02-10 17:48:30 [api] Error collecting all stats
2018-02-10 17:48:30 [payments] No workers' balances reached the minimum payment threshold
2018-02-10 17:48:30 [unlocker] No blocks candidates in redis
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:31 [master] Pool fork 1 died, spawning replacement worker...
2018-02-10 17:48:31 [master] Pool fork 3 died, spawning replacement worker...
2018-02-10 17:48:31 [master] Pool fork 4 died, spawning replacement worker...
2018-02-10 17:48:31 [master] Pool fork 2 died, spawning replacement worker...
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:33 [master] Pool fork 4 died, spawning replacement worker...
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:33 [master] Pool fork 2 died, spawning replacement worker...
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:33 [master] Pool fork 1 died, spawning replacement worker...
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:33 [master] Pool fork 3 died, spawning replacement worker...
2018-02-10 17:48:35 [api] Error getting daemon data {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}
2018-02-10 17:48:35 [api] Stat collection finished: NaN ms redis, 6 ms daemon
2018-02-10 17:48:35 [api] Error collecting all stats
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:35 [master] Pool fork 4 died, spawning replacement worker...
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:96
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Debug/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/out/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/Release/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/build/default/multihashing.node
 → /home/tony/Desktop/project02/pool/node_modules/multi-hashing/compiled/4.2.6/linux/x64/multihashing.node
    at bindings (/home/tony/Desktop/project02/pool/node_modules/bindings/bindings.js:93:9)
    at Object. (/home/tony/Desktop/project02/pool/node_modules/multi-hashing/index.js:1:99)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/home/tony/Desktop/project02/pool/lib/pool.js:7:20)
    at Module._compile (module.js:410:26)
2018-02-10 17:48:35 [master] Pool fork 2 died, spawning replacement worker...
2018-02-10 17:48:35 [master] Pool fork 1 died, spawning replacement worker...
^Z
[1]+  Stopped                 node init.js
member
Activity: 462
Merit: 23
February 13, 2018, 09:37:55 AM
#1
区块连是由一个个区块组成,那么在编写区块连之前要先把区块逻辑,下面是区块编辑的简单Java 程序,原程序来自英文原编 Lauri Hartikka
对编程感兴趣的可以参考下

第一个逻辑步骤是决定块结构。
这个块中必须能找到前一个块的哈希值(hash),以此来保证整条链的完整性。




class Block {
    constructor(index, previousHash, timestamp, data, hash) {
        this.index = index;
        this.previousHash = previousHash.toString();
//这一步很重要,起到区块链接功能
        this.timestamp = timestamp;
//输入的时间
        this.data = data;
//用户提供的资料
        this.hash = hash.toString();
    }
}


块哈希
var calculateHash = (index, previousHash, timestamp, data) => {
    return CryptoJS.SHA256(index + previousHash + timestamp + data).toString();
};

为了保存完整的数据,必须哈希区块。SHA-256会对块的内容进行加密,
记录这个值应该和“挖矿”毫无关系,因为这里不需要解决工作量证明的问题。

块的生成

var generateNextBlock = (blockData) => {
    var previousBlock = getLatestBlock();
    var nextIndex = previousBlock.index + 1;
    var nextTimestamp = new Date().getTime() / 1000;
    var nextHash = calculateHash(nextIndex, previousBlock.hash, nextTimestamp, blockData);
    return new Block(nextIndex, previousBlock.hash, nextTimestamp, blockData, nextHash);
};

要生成一个块,必须知道前一个块的哈希值,然后创造其余所需的内容(= index, hash, data and timestamp)。
块的data部分是由用户所提供,这样一个签单的块就编写完了。

Jump to: