Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I built a peer-to-peer publishing platform (peerdium.com)
115 points by vishnu_ks on May 13, 2018 | hide | past | favorite | 54 comments

This is pretty nifty! Out of curiosity, why did you choose WebTorrent over, say, IPFS? I considered doing something similar using their JavaScript client[0].

[0]: https://github.com/ipfs/js-ipfs

Interesting question. I was also considering to use IPFS js while developing Peerdium. But it seems like it's not fully ready yet. For example, take a look at this

> DHT (automatic content discovery) and Circuit Relay (pierce through NATs and dial between any node in the network) are two fundamental pieces that are not finalized yet.

Another reason was that I had to still run an IPFS node if articles should be made available for more than 8 hours. I didn't want to do anything with storing articles.

Nice app! Great work, you deserve all the HN attention. :D

How were you able to make WebTorrent work reliably? I was trying to write a WebRTC adapter for https://github.com/amark/gun (I'm the author) but kept on having STUN/ICE problems.

I'd love some tips! And awesome project. Somebody in our community just made a decentralized reddit clone, so it is exciting to see new P2P projects popping up every day! :D

Gun looks pretty cool. I have not fully fixed the STUN/ICE problem. Some of the users on HN are still not able to see the articles. I think the problem reduced a bit after I started running a TURN server. But it's not full eliminated yet. Check out my tweet to Feross. Maybe he has some answers :) https://twitter.com/hackerkidx/status/996009992569274369

@vishnu_ks , I also recently found https://github.com/priologic/easyrtc which worked out of the box, and automatically connects to several public STUN/ICE peers. I'm planning on using it (when I get a chance to finish the WebRTC adapter), maybe we can tag team something? It worked super well on a P2P/decentralized 3D VR multiplayer game somebody had built.

Sure. Do let me know when you need some help :)

Wow GUN looks promising !!! I'm going to follow this closely !

This seems like it could be good as an ephemeral pastebin/image/video sharing with a small group.

off topic, I wish one of these peer-to-peer schemes caught on, if only because it will incentivize people to buy a desktop computer which will serve as network node. There's so many interesting things that can be done if people can be convinced that they are part of the network and not just "tablet users".

I wonder if anyone is trying to build home routers that double as ipfs/torrent nodes.

Was going to say, I remember https://news.ycombinator.com/item?id=9531265 that had the very same idea as this. The thing is, what's the benefit of an ephemeral page? What can I do better if someone else is seeding it for me? Is it that hard to centrally host these bits?

Yes. I think Peerdium is not at all necessary for 99% of the use cases. You can just use a normal publishing platform. Peerdium can become useful if you don't want a single point of failure. That is anyone can spin up Peerdium servers from source code and the links would still work as long as someone is seeding the content. Also nothing is stored in a server. So if you want to share some content that you don't want to get stored in someone's private server then Peerdium can be used as well.

One feature you might want to consider is adding support for RemoteStorage [0] to allow people to export a story to a data provider of their choice, so that they can easily access it later if they care to (and perhaps start re-hosting it?) :)

[0] https://remotestorage.io/

This sounds super interesting. Let me read more about this. :)

You should also check out blockstack, offers similar storage functionality (the user choose where to store the data) and has easy to use js libs

Good idea. If there were some way to store that data in a more permanent form, that would have been awesome. Either way, a small nit.

> Peerdium would not have been possible with WebTorrent, QuillJs and Vue.js

I think you meant "Peerdium would not have been possible WITHOUT WebTorrent, QuillJs and Vue.js"

Yup. I thought I fixed that typo. I can't fix it now as the identifier of the post would change :)

Interestingly, I suppose the Peerdium model means it can't be updated now? A new, corrected page could be published, but it would have a different identifier and would have to be re-seeded.

Yes. That is correct :)

Also you can store the files in local storage by hearting the article.

"This means to open and read a post in Peerdium at-least 1 other person should have the tab opened of the post"

Are you running a server hosting 1 instance of each document so that there is always at least 1 other person hosting the page?

Nope. I am not seeding the articles. If no one else seeding the article it won't be available.

Just made my own post and would love to see how long it can stay up for (and if people will host it for me):


Awesome. I just woke up after posting this to HN and your page is still alive :)

Can't open, do you yourself even have the tab open? :P

I do, though it seems to timeout after a certain amount of time - I can no longer reload it even though I have it open in 3 tabs.

Edit: Oh wait, think we're back on.

i got nothing... "Loading from peers......."

This is neat. How does it work with search engines? Just lots of 404s once articles 'disappear'?

Yup. That is correct. Once the people seeding decided to take it off it is no longer stored anywhere :)

Congrats! This is a really nice project. I'm amazed that the editor is just 200 lines of code and i like the minimalistic design.

Assuming the number in the right side are the spectators. Could you show on the left side how many peers are seeding?

It's the number of people who have the tab opened == no of people seeding the post. When you open a post you get the content from other seeders and starts seeding the post :)

This would be interesting if combined with something like BAT or AdSense or Coinhive to earn revenue from viewing then use that revenue to pay for seeding via something like Sia/ Filecoin.

Never thought about it before. Sounds interesting. Let me see if I can integrate one of these easily :)

Maybe check out IPFS while you are at it.

Does IPFS solve the monetization problem?


This comment has some insights on why I decided to use WebTorrent over IPFS.

So if the only person reading the article closes it, is the article lost? Since there is no one else to retrieve the data from for future readers.

Yup. You have the option to save the article as well by clicking on the heart icon. This allows you to view the article even if no one else is seeing it.

The concern is that someone has to have a post open before I can access it. How does this scale? (Oh, you build it for fun. So no problem.)

Yes. So the author has to keep the tab open till the post gets other seeders :)

Doesn't seem to work for me. Perhaps because I'm behind a corporate proxy? Maybe I'll try when I get home.

Yeah. Torrent ports are often blocked in corporations and some universities. You should check out at home :)

Doesn't seem to load on ios + safari

I am not sure it's an issue with iOS + safari. More likely to be a network issue.

What version? IIRC, WebRTC support (which WebTorrent relies on) started with ios 11.

ehh... what a naming. For russian speaking people it strongly co-sounds with "fart". ;) Please consider to rename it if platform targets worldwide.

Thanks for letting know. There is already an issue open for this in the repo https://github.com/hackerkid/peerdium/issues/2 :)

If there is demand for the service I will try renaming the project :)

Hope it will be demanded. BTW, last notable bad naming was a Fedora project for RaspberryPI named Pidora which sounded for russians as "faggot" :)

It would be better if you used #idhere instead of /id, so then you are not (as) responsible for user content.

Can you explain this a bit more? Also no content created by the user is stored in Peerdium server. Everything is stored in the browser of the user.

Sorry for the late reply. Since the ID is not a # variable in the URLs, it is passed to the web server hosting the content, meaning even if the data/metadata is not stored on any server you own (it doesn't appear to be), you could still be expected to block URLs which someone wants to ban.

# variables are not part of server queries, so they are better for user privacy as well (not stored in server logs). I'm not saying you won't ever get takedown requests with #, but it is easier to argue to authorities that Peerdium is merely a user-ran software you are not in control of when using #.

That makes sense. Thanks :)

How does that work?

Page stalls at "Loading from peers......."

Oh the irony.

Does your network blocks Torrent ports?

this is very, very cool

Thanks :)

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact