The goal of the project is to build a wiki system on ipfs. The wiki data is decentration and not modifiable.
If anyone interest this project, they can direct clone this repo to yourself.
Welcome to commit any question or issue to me.
Feel free to star and fork.
mkdir workplace
cd workplace
git clone git@github.com:daijiale/ipfs-wiki-system.git
Exec these command:
cd workplace/ipfs-wiki-system/wiki-release
ll
The output:
-
wiki-release
- index.html //markdown模板渲染
- navigation.md //导航markdown
- index.md //首页markdown
Everyone can refer this repo to make yourself wiki content by markdown
format.
Remember the hash of the files root directory: QmV5ZVQxXURKPDcVDW8WjpLCiQYvNzg173XcB6rYFevoXm
Just execute ipfs daemon
, the wiki file would to send to the ipfs net.
The example is this
Since one hash corresponding one not modifable content, if update a website, the website hash would be changed, and other old links can't find this new website.
For resolve this problem, ipfs
support a basic component names IPNS
.
ipfs allow user to create an additional message with a file hash and a private key, and use a pubkeyhash to indicate your lastest website version.
The operation command is blow:
Finish it now, we have a fixed link to bundle a website: QmPS5NRXPCeAUtofKbW7c58Qm4PpM8mPEVJvaooE13LF78
ipfs name resolve QmPS5NRXPCeAUtofKbW7c58Qm4PpM8mPEVJvaooE13LF78
/ipfs/QmV5ZVQxXURKPDcVDW8WjpLCiQYvNzg173XcB6rYFevoXm
Use IPNS To Access Fixed Node Hash:
https://ipfs.io/ipns/QmPS5NRXPCeAUtofKbW7c58Qm4PpM8mPEVJvaooE13LF78
When verification successful, we will see this result:
Now we assume the node that recived our data is first node. Then we create another node in location to simulate the second node.
Open web console:
In the second node, we also can use IPFS HASH
to find the ipfs-wiki-system
content of first node.
And we can see our data has spreaded to 275 nodes in the ipfs console. In other words, there are 274 nodes have recorded our data in there own 'book'. So we don't warry about any disaster. If one node is well, our data would not lost.