Code Monkey home page Code Monkey logo

poc-ipfs's Introduction

IOTA IPFS

This package is an implementation of the Tangle and Data Storage Blueprint https://docs.iota.org/docs/blueprints/0.1/tangle-data-storage/overview

The IOTA IPFS Demonstration is composed of 2 packages api and client.

API

The API facilitates all the services required by client web UI. It is a set of services running on NodeJS connecting to the Tangle and IPFS.

See ./api/README.md for more details.

Client

The client package provides a React Web UI to provide facilities to upload and authenticate files using IOTA and IPFS.

See ./client/README.md for more details.

Deployed

A demonstration version of the application is currently deployed at the following urls

poc-ipfs's People

Contributors

dependabot[bot] avatar karimkozman avatar obany avatar zksadj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poc-ipfs's Issues

Cors policy error running poc-ipfs locally

I'm trying to run the poc on my local machine, followed the doc for the client and the api,
As I try to upload a file I get this error:
"Access to XMLHttpRequest at 'http://localhost:4000/ipfs' from origin 'http://localhost:3000' has been blocked by CORS policy:"

Now I'm aware about cross domain ajax requests and understand the underlying security issue.
But right now both scripts are running locally, so they should be able to communicate...or I'm missing something?

my config files for api and client are the following:

{ "node": { "provider": "https://nodes.thetangle.org:443", "depth": 3, "mwm": 9 }, "ipfs": { "provider": "cloudflare-ipfs.com", "token": "MYIPFSNODE_TOKEN" }, "dynamoDbConnection": { "region": "AWS-REGION", "accessKeyId": "AWS-ACCESS-KEY-ID", "secretAccessKey": "AWS-SECRET-ACCESS-KEY", "dbTablePrefix": "DATABASE-TABLE-PREFIX" }, "allowedDomains": [ "https://ipfs.iota.works", "https://ipfs.iota.org", "cloudflare-ipfs.com" ] }

{ "apiEndpoint": "http://localhost:4000/", "ipfsGateway": "https://ipfs.io/ipfs/:hash", "tangleExplorer": { "transactions": "https://utils.iota.org/transaction/:transactionHash", "bundles": "https://utils.iota.org/bundle/:bundleHash" }, "googleAnalyticsId": "" }

API deploy error

under ./api, executed 'npm run build' without error.
However, runing 'now' for deployment, there is an error message saying
'Error: No output directory named "public" found.'
A more detailed information can be found at https://zeit.co/johnpeng968/iota-poc-ipfs-api/6c11s3ph6.
But I found the 'public' directory was there under my project root ~project/my-iota-app/.
The package.json under project root is
{
"name": "my-iota-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@iota/core": "^1.0.0-beta.23",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.3",
"@testing-library/user-event": "^7.1.2",
"ipfs-http-client": "^40.1.0",
"ipfs-http-client-lite": "^0.3.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0",
"typescript": "^3.7.3"
},
"scripts": {
"start": "react-scripts start",
"test": "react-scripts test",
"eject": "react-scripts eject",
"build": "gatsby build --output public",
"dev": "gatsby develop"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

ipfs local testing

I am trying to setup a local test environment (both client and api) by running client/api by npm start.

Getting back errors as following:

client (localhost:3000):
There was a problem communicating with the API.
Error: Request failed with status code 404

api (localhost:4000):

[email protected] start /root/project/my-iota-app/src/api > node ./dist/index Started API Server on port 4000 v1.2.1 Running Config 'local' ===> GET / {} <=== duration: 11ms { name: 'iota-poc-ipfs-api', version: '1.2.1' } ===> GET / {} <=== duration: 1ms { name: 'iota-poc-ipfs-api', version: '1.2.1' }

config.local.json setting
{ "node": { "provider": "https://nodes.devnet.thetangle.org:443", "depth": 3, "mwm": 9 }, "ipfs": { "provider": "http://127.0.0.1:4000", "token": "" }, "dynamoDbConnection": { "region": "", "accessKeyId": "", "secretAccessKey": "",
"dbTablePrefix": "" }, "allowedDomains": [ "https://ipfs.iota.works", "https://ipfs.iota.org" ] }

could not add file from local dev

Adding file OIP.jfif to IPFS of length 17962
<=== duration: 1579ms
{
success: false,
Cannot POST /api/v0/add

got this response on API, accordingly client got response . Please, advice to solve

Error: Cannot find module '../data/config.local.json'

Hi,

When I executed 'npm run dev-start', it complained: Cannot find module '../data/config.local.json'.

I found that there is a config.template.json under ./api/src/data. Are they related?

How to fix this problem?

Thank you in advance.

could not run at local

Require stack:

  • F:\iota\poc-ipfs-master\api\dist\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (F:\iota\poc-ipfs-master\api\dist\index.js:48:14)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'F:\iota\poc-ipfs-master\api\dist\index.js' ]
    }
    [nodemon] app crashed - waiting for file changes before starting...

Dependency error during API install

Output on npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/tslint
npm ERR!   dev tslint@"6.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer tslint@"^5.0.0" from [email protected]
npm ERR! node_modules/tslint-eslint-rules
npm ERR!   dev tslint-eslint-rules@"5.4.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.  

If I use --force it complete the install but at launch (npm run start-dev) it give this error

Error: Cannot find module './data/config.local.json'
Require stack:
- C:\Users\User\Documents\www\poc-ipfs\api\dist\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\User\Documents\www\poc-ipfs\api\dist\index.js:48:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\User\\Documents\\www\\poc-ipfs\\api\\dist\\index.js'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...

"ResourceNotFoundException: Requested resource not found" running poc-ipfs locally

I'm trying to run the poc on my local machine, followed the doc for the client and the api,
As I try to upload a file I get this error:
{"success":false,"message":"ResourceNotFoundException: Requested resource not found"}

I started ipfs server on DigitalOcean and run DynamoDB on aws and provided workable credentials(both for dynamoDbConnection and for ipfs) in config files

Problem that when I try to put file into storage I got above error message.
It is not so easy to debug error.

May be you could assume where is the problem?

Could not find a declaration file for module 'ipfs-http-client'

I encountered a problem when compiling, the error message is as following:
(npm install @types/ipfs-http-client doesn't help...)

/root/project/my-iota-app/src/api/src/routes/ipfsStore.ts
TypeScript error in /root/project/my-iota-app/src/api/src/routes/ipfsStore.ts(4,24):
Could not find a declaration file for module 'ipfs-http-client'. '/root/project/my-iota-app/src/api/node_modules/ipfs-http-client/src/index.js' implicitly has an 'any' type.
Try npm install @types/ipfs-http-client if it exists or add a new declaration (.d.ts) file containing declare module 'ipfs-http-client'; TS7016

2 | import { asTransactionTrytes } from "@iota/transaction-converter";
3 | import crypto from "crypto";

4 | import ipfsClient from "ipfs-http-client";
| ^
5 | import { SHA3 } from "sha3";
6 | import { IIPFSStoreRequest } from "../models/api/IIPFSStoreRequest";
7 | import { IIPFSStoreResponse } from "../models/api/IIPFSStoreResponse";

file uploading issue

when ever I upload a file it gives me this error and I don't know from which file its giving this error.

"TypeError: Cannot set property 'seed' of undefined"

please help...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.