[去 中 心 化]--社会需要进步

如何在zeronet上创建去中心化的网站

作者:Eureka

首先到官网http://zeronet.io下载软件,如图:

下载zeronet

下载后解压,运行zeronet.cmd 这时会打开浏览器,并浏览默认主页。此时,在左侧的链表上会显示我们已经访问过的各种站点。如果我们不想从头创建一个网站,那这时我们可以通过clone(克隆)功能复制一个网站框架下来供直接使用。如图:

克隆zeronet站点

当然,我们还可以创建一个全新的网站。 1. 先关闭ZeroNet (在屏幕左下角有个小logo,右键点击弹出菜单,然后左键点quit即可) 2. 来到ZeroNet安装目录下的ZeroNet目录下,运行 D:\Dac\ZeroBundle\Python\python zeronet.py siteCreate //注意python安装位置,我装在了D盘。还有竟然区分大小写的。 如下:

D:\Dac\ZeroBundle\ZeroNet>D:\Dac\ZeroBundle\Python\python zeronet.py siteCreate
- Starting ZeroNet…
- OpenSSL loaded, version: 01000201F
- Generating new privatekey…
- +———————————————————————-
- Site private key: 5JdxYZe2J1XTScWxvgKcYaWttjC4vnKns9KY8JttDWN9pZinKuc
-                   !!! ^ Save it now, required to modify the site ^ !!!
- Site address:     1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms
- +———————————————————————-
? Have you secured your private key? (yes, no) > y
- Please, secure it now, you going to need it to modify your site!
? Have you secured your private key? (yes, no) > yes
- Creating directory structure…
- Creating content.json…
Site:1D88a3..q5ms Content.json not exist: data/1D88a3c45q4R7mu5cfG77QYmRR1jsRq5m
s/content.json
Site:1D88a3..q5ms File content.json not exist yet, loading default values…
Site:1D88a3..q5ms Opening site data directory: data/1D88a3c45q4R7mu5cfG77QYmRR1j
sRq5ms/…
Site:1D88a3..q5ms - index.html (SHA512: ad733668568698cf018ca554528a26c218e8f1d4
45985ca9dda006e38ff8e02b)
Site:1D88a3..q5ms Adding timestamp and sha512sums to new content.json…
Site:1D88a3..q5ms Verifying private key…
Site:1D88a3..q5ms Correct 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms in valid signers: [
‘1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms’]
Site:1D88a3..q5ms Signing content.json…
Site:1D88a3..q5ms Saving to content.json…
Site:1D88a3..q5ms File content.json signed!
SiteManager Save error: No sites found
- Site created!

这时,获得了网站的私钥,必须妥善保存。

同时生成了在D:\Dac\ZeroBundle\ZeroNet\data 目录下生成了一个以公钥命名的文件夹,即: 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms 里面有两个文件 content.json , index.html 这时,我们可以在这里编辑我们的网站,完成后运行: D:\Dac\ZeroBundle\Python\python zeronet.py siteSign 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms 在提示输入密钥的地方输入密钥(不会显示出来),如下:

D:\Dac\ZeroBundle\ZeroNet>D:\Dac\ZeroBundle\Python\python zeronet.py siteSign 1D
88a3c45q4R7mu5cfG77QYmRR1jsRq5ms
- Starting ZeroNet…
- OpenSSL loaded, version: 01000201F
- Signing site: 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms…
Private key (input hidden):
Site:1D88a3..q5ms Opening site data directory: data/1D88a3c45q4R7mu5cfG77QYmRR1j
sRq5ms/…
Site:1D88a3..q5ms - [SKIPPED] content.json
Site:1D88a3..q5ms - index.html (SHA512: d54494d5cc94238d04ed6d554924a8d6fd93e8db
81a048650e9766f68761c1bc)
Site:1D88a3..q5ms - test.html (SHA512: 44736467c02075ad3d9dc7f66ae5346dd1229d4f6
12ecad706d097ebed00a5ca)
Site:1D88a3..q5ms Adding timestamp and sha512sums to new content.json…
Site:1D88a3..q5ms Verifying private key…
Site:1D88a3..q5ms Correct 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms in valid signers: [
‘1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms’]
Site:1D88a3..q5ms Signing content.json…
Site:1D88a3..q5ms Saving to content.json…
Site:1D88a3..q5ms File content.json signed!

这时,就可以通过公钥访问我刚刚创建的去中心化网站了。 http://127.0.0.1:43110/1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms

网站创建后,更新后为了通知其它节点,我们需要运行下面的命令:

D:\Dac\ZeroBundle\Python\python.exe zeronet.py sitePublish 1D88a3c45q4R7mu5cfG77QYmRR1jsRq5ms

如果sitePublish遇到问题,我们还可以用siteSign发布网站。


下面您可根据自己的喜好分别使用“Disqus”或者“多说”进行留言评论: