Commit bd40b08f authored by Michał Woźniak's avatar Michał Woźniak
Browse files

ipns+ipfs plugin clearly marked as a work-in-progress

parent 411e04b7
......@@ -8,7 +8,7 @@
/*
* THIS PLUGIN IS WORK IN PROGRESS AND IS NOT FUNCTIONAL YET
* THIS PLUGIN IS A WORK IN PROGRESS AND IS NOT FUNCTIONAL YET
*
* see: https://0xacab.org/rysiek/samizdat/-/issues/2
*/
......@@ -77,6 +77,8 @@ async function setup_ipfs() {
* the workhorse of this plugin
*/
async function getContentFromIPNSAndIPFS(url) {
return new Error("Not implemented yet.")
var urlArray = url.replace(/https?:\/\//, '').split('/')
var gunaddr = [urlArray[0], '/' + urlArray.slice(1).join('/')]
......@@ -177,6 +179,8 @@ async function getContentFromIPNSAndIPFS(url) {
* returns a Promise that resolves to an object mapping URLs to IPFS hashes
*/
let addToIPFS = (resources) => {
return new Error("Not implemented yet.")
return new Promise((resolve, reject) => {
console.log("Adding to IPFS...")
......@@ -224,6 +228,8 @@ let addToIPFS = (resources) => {
* and returns a Promise that resolves to true
*/
let verifyInIPFS = (ipfs_addresses) => {
return new Error("Not implemented yet.")
return new Promise((resolve, reject) => {
console.log('Checking IPFS content against a gateway...')
console.log('+-- gateway in use: ' + IPFSGateway)
......@@ -267,6 +273,7 @@ let verifyInIPFS = (ipfs_addresses) => {
* and handle stuff appropriately
*/
let publishContent = (resource, user, password) => {
return new Error("Not implemented yet.")
if (typeof resource === 'string') {
// we need this as an array of strings
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment