Giter Club home page Giter Club logo

Comments (4)

haadcode avatar haadcode commented on May 22, 2024

Hi @vijayee, we're currently in the middle of the next release of IPFS and the dependencies are a little wonky atm. Thanks for reporting the issue!

You will be able to get the ipfs-api example working by using a fork of js-ipf-api by installing it with npm npm i @haad/ipfs.api and then requiring it const IpfsApi = require('@haad/ipfs-api'). That version contains support for the missing pubsub both in js-ipfs-api and in the actual go-ipfs daemon.

We're working on getting the js-ipfs version working again, I 'm fairly confident that will land next week.

from orbitdb.

vijayee avatar vijayee commented on May 22, 2024

@haadcode, thanks, I'll give it a shot with this version of the api.

from orbitdb.

vijayee avatar vijayee commented on May 22, 2024

I get another error with the '@haad/ipfs-api' module coming from stream-to-json-value

2016-12-12T16:12:15.355Z [ERROR] orbit-db.IPFSPubSub: SyntaxError: Unexpected token p in JSON at position 4
    at JSON.parse (<anonymous>)
    at streamToValue (/home/victor/Workspace/src/github.com/vijayee/orbit-db-sandbox/node_modules/@haad/ipfs-api/src/stream-to-json-value.js:25:18)
    at res.pipe.concat (/home/victor/Workspace/src/github.com/vijayee/orbit-db-sandbox/node_modules/@haad/ipfs-api/src/stream-to-value.js:9:29)
    at ConcatStream.<anonymous> (/home/victor/Workspace/src/github.com/vijayee/orbit-db-sandbox/node_modules/concat-stream/index.js:36:43)
    at emitNone (events.js:91:20)
    at ConcatStream.emit (events.js:185:7)
    at finishMaybe (/home/victor/Workspace/src/github.com/vijayee/orbit-db-sandbox/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)
    at afterWrite (/home/victor/Workspace/src/github.com/vijayee/orbit-db-sandbox/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:361:3)
    at _combinedTickCallback (internal/process/next_tick.js:80:20)
    at process._tickCallback (internal/process/next_tick.js:98:9)
(node:17389) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Hash can't be null!
(node:17389) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

from orbitdb.

haadcode avatar haadcode commented on May 22, 2024

We just released a new version which includes fixes for the examples. See https://github.com/haadcode/orbit-db/tree/master/examples for all the examples.

You can now do:

npm install orbit-db ipfs-daemon
const IPFS = require('ipfs-daemon/src/ipfs-node-daemon')
const OrbitDB = require('orbit-db')

const ipfs = new IPFS()

ipfs.on('error', (e) => console.error(e))
ipfs.on('ready', (e) => {
  const orbitdb = new OrbitDB(ipfs)

  const db = orbitdb.eventlog("feed name")

  db.add("hello world")
    .then(() => {
      const latest = db.iterator({ limit: 5 }).collect()
      console.log(JSON.stringify(latest, null, 2))
    })  
})

@vijayee, thanks for waiting. If you encounter more problems, let us know!

from orbitdb.

Related Issues (20)

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.