Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example #2

Open
xloem opened this issue Oct 30, 2020 · 3 comments
Open

example #2

xloem opened this issue Oct 30, 2020 · 3 comments

Comments

@xloem
Copy link

xloem commented Oct 30, 2020

I'm having some trouble getting connected. Is there a simple known-working example to compare with?

@mafintosh
Copy link
Collaborator

you can try the imdb mirror 46190f4a2daaaae53689d292501f18b8e0302dc9344e3756d8ec7a2d03cb5348

@xloem
Copy link
Author

xloem commented Oct 30, 2020

I mean, a simple sourcefile that runs successfully?

@mafintosh
Copy link
Collaborator

You can wrap that in a hypercore:

const hypercore = require('hypercore')
const feed = hypercore('feed', '46190f4a2daaaae53689d292501f18b8e0302dc9344e3756d8ec7a2d03cb5348')

require('@hyperswarm/replicator')(feed, { lookup: true, announce: false })

feed.get(0, function (err, data) {
  console.log(err, data)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants