在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jamescarlyle/ipfs-wiki开源软件地址:https://github.com/jamescarlyle/ipfs-wiki开源编程语言:JavaScript 48.6%开源软件介绍:Interplanetary WikiNote that this implementation has been superceded with a version called WIKID, which does not require a separate IPFS daemon. This version is preserved for historical reasons. This is a minimum viable web application to explore the read/write web on IPFS. There are many directions to take this but please fork or raise an issue if you'd like to see a particular change. The product is a Wiki that has no central server. All of the Wiki content is held on IPFS itself, and the Wiki html + Javascript files can also be held and served from IPFS via an IPFS gateway, or served to the browser from a local filesystem or local webserver. The Wiki supports a subset of markdown syntax: specifically the following
More complete markdown syntax support will be added in future. Getting startedIn order to use the Wiki, simply download all the files in this repository using the following command
Then start the IPFS daemon
Then start a local webserver. For example, a simple webserver on OS X can be started with
Then load the index.html page. At this stage, it should be possible to create a new Wiki and add pages. If not, please raise an issue.
Technical DetailsThe page can also be loaded via IPFS itself (note that the hash will change):
But then if the local daemon is specified, the following error will be seen
There is a current dependency on the IPFS daemon which provides the ability to fetch and save Wiki content through the IPFS API. The Wiki app is preconfigured to talk to the API on localhost port 5001 (this is the default port for the IPFS API), in order to both fetch content and save changes. Browsers require that if an IPFS gateway is used to serve the Javascript, it needs to use the same protocol as the API, i.e. http rather than https. If you want to run the daemon and allow it to be writable by users of the Wiki who are not using the same host and port to serve the html and Javascript, then CORS must be configured on the IPFS daemon, so that the API will allow requests from Javascript hosted on other origins. See Wikipedia on CORS for more. So if you serve the HTML and Javascript using the local IPFS daemon, thus:
then you will see the following error
This can be corrected with the following configuration:
The Wiki works by managing a "context" or "umbrella" for all the Wiki pages that link directly to each other. Behind the scenes, this is an IPFS Object with an array of Links mapping WikiNames to hashes. The Wiki pages themselves are IPFS Objects with Data but no Links. Technically speaking, when rendering a page, the context is loaded first, so that the hash of the page can be looked up, and then requested. When saving a page, the page is saved first, its hash obtained, then the parent context is updated with the new hash for the page. Then the context hash itself will change, so the URL path of the browser changes to reflect the new context. A Wiki (page collection or context) is an Object in IPFS terms:
For an individual page, the Object stores the following
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论