this post was submitted on 05 Sep 2023
16 points (78.6% liked)

Fediverse

28295 readers
687 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to [email protected]!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS
 

Libp2p or similar stack could be used to provide the phone instance an address, caching could be distributed among peers. Of course, as long as other servers also support libp2p.

What would be the up/downsides?

top 24 comments
sorted by: hot top controversial new old
[–] [email protected] 17 points 1 year ago (1 children)

Its technically possible but not a great idea, lemmy instances take a good chunk of power and storage. And a phone will run out of battery very fast, so you'll need to charge it permanently, wich will wear out the phone fast. A raspberry pi would be better suited for it.

[–] [email protected] 2 points 1 year ago (2 children)

You wouldn't need to run the service 24/7, just whenever you're using Lemmy and maybe a few minutes after so your interactions can propagate trough the p2p network. Also the existing servers could be used to cache and relay.

[–] [email protected] 17 points 1 year ago (1 children)

I run my own instance, and that's not really how it works. While the instance is off, it isn't receiving new posts. So when you turn it on and log in, there will be nothing new for you to view. Everything you will see will be the same stuff as when you logged off last time. On top of that, while your instance is off, all the other instances that are federated with you will constantly be trying to communicate with your instance, causing all the other instances to do more work. Recently a change went into lemmy to automatically block instances that have reliability issues. And if other instance admins are watching their logs, they will probably block your instance anyway (lemmy.world has done this occasionally).

Your lemmy instance needs to have at least 98% uptime imo. If it goes down for a few days rarely, it's not a big deal. But shutting it down 80% of the time and only having it up while your using it will be bad for the lemmyverse and for you, the user.

A raspberry pi is inexpensive and is a much better solution, as it can be wired in all the time.

[–] [email protected] 2 points 1 year ago (1 children)

P2p enabled instances would have the option to reverse the communication flow, so besides the servers having to send updates to subscribed servers, the subscribers would have the option to ping peers/servers for updates.

This would help with sync issues when a post is made and the changes are not propagated to all subscribers.

[–] [email protected] 3 points 1 year ago

But does that feature exist, or is it hypothetical?

[–] [email protected] 1 points 1 year ago

Thats a even worse idea and basically bo different than just using a already hosted server...

[–] [email protected] 11 points 1 year ago (1 children)

ActivityPub is all about pushing content around to subscribing servers. It sort of expects the subscribers to always be online which would not work for a phone. Servers could resend missed events, but essentially you would miss every event that occurs while the phone is asleep or doesn’t have the app running.

Also, every event that occurs needs to be processed and stored whether or not you are actively looking at it so it would be a huge battery drain while it was running.

It is definitely a service best run on an always-on server with a client application in a phone just asking the server for the latest stuff on-demand.

[–] [email protected] 2 points 1 year ago (2 children)

Events could be cached on the p2p network, so the phone only pings its peers for new content (mind the existing servers would be peers on the network).

[–] [email protected] 5 points 1 year ago (1 children)

Then the p2p network is really the “server” and the phone is still just a client. I’m also not sure that a p2p network could be queried very well because something would have to be able to produce aggregated and sorted results. It isn’t like pulling one file from a swarm. It would be like a blockchain and the phone would have to download the whole dataset from the p2p network before running queries on it.

What you are talking about sounds kind of like the Nostr protocol. It is a distributed social network trying to solve the same problem that ActivityPub is but in a slightly different way. All the events are cached on multiple relays and the client applications query those relays looking for information that gets aggregated and sorted on the client however it wants.

[–] [email protected] 2 points 1 year ago (2 children)

Yes, the proposal is something like Nostr, but the clients can also relay data on request if they're online. A little more decentralized.

Worth mentioning that the idea is not to make Lemmy abandon ActivityPub, but to allow further decentralisation.

There wouldn't be a need to keep all data like a blockchain to query all data since most sort by hot/recent. Something like Gossipsub would suffice for most users.

But whenever an user queries for old or specific data, the request could be directed to a relay that archives and sorts all data.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Now I think I see what you are saying. People have suggested that Lemmy needs a separate protocol to connect with other Lemmy instances to more efficiently synchronize. Gossipsub could do that. It would also be nice if each Lemmy instance only needed to keep a minimal amount of data at any one time to service the clients that connect to it while the rest exists in the swarm.

I still don’t think that you would want a phone to function as your server and your client, though. All that coordinating takes bandwidth and processing power. Phones are ill-equipped for that. Also, usually to p2p effectively you need to be able to make direct connections through firewalls. Opening your phone directly to the Internet would be a bad idea, plus I doubt any phone companies would let you do that. Without a direct connection, you would need to proxy your connection through some server somewhere and deal with bandwidth costs. Might as well just connect to a server as a client.

Maybe the final solution is software like Lemmy running with decentralized identities via the Nostr protocol that is federated out using Gossipsub.

[–] [email protected] 1 points 1 year ago

For what it is worth, I looked to see if anyone had done Nostr over Gossipsub and I came across a project called Gossip. Looks like they are trying to use the Nostr protocol in a psuedo-gossipsub way. That coupled with the proposed Nostr NIP 72 which would allow Lemmy-like communities could make this the solution you were looking for. Obviously these are in their infancy, but it may be an idea to follow.

[–] [email protected] 2 points 1 year ago (1 children)

“Could be”? I mean yes almost everything is possible but you’re talking about a completely different protocol.

[–] [email protected] 2 points 1 year ago

Not a completely different protocol when the changes are additions to the existing one. The same protocol would still exist and be supported.

[–] [email protected] 9 points 1 year ago (1 children)

as others have mentioned there are storage and battery concerns but also Lemmy works best when its consistently available. Then theres the whole roaming IP problem if youre moving on cell networks. Federated instances and communities often won’t be able to find you for updates.

[–] [email protected] 3 points 1 year ago

Roaming IP wouldn't be really a problem with libp2p, you can have a permanent address with a peer id.

[–] [email protected] 8 points 1 year ago (2 children)

IIRC Lemmy uses a massive amount of storage

[–] [email protected] 10 points 1 year ago

My instance is currently at 19GB after running for about 3 months.

[–] [email protected] 0 points 1 year ago* (last edited 1 year ago)

Most people don't come here to see archival stuff, so it wouldn't be so bad if the p2p network cached ephemerally (time limit or a size limit). Old content could still be reached on servers designed to cache old stuff.

[–] [email protected] 2 points 1 year ago

I think it would be, but not in the way you're thinking.

ActivityPub is based on servers with domain names and accessible IP addresses communicating with each other. It's mandatory based on the fundamental design of the standard.

So if you were running one of the phones that can run a straight linux distribution, and you connected it to a permanent internet connection as a web server and copy of lemmy with a domain name, then it's possible. But it's no longer a phone, it's a server with the form factor of a phone.

[–] [email protected] -2 points 1 year ago (3 children)

That's a terrible idea and you should never run any kind of service from your phone.

[–] [email protected] 4 points 1 year ago

Maybe not permanently. But for straight up tinkering to see if/how possible it is, it'd be a fun experience.

[–] [email protected] 1 points 1 year ago

I dunno. If you could run some distro like mobian on some phone with an 8 core processor, could be a decent choice for a little instance.

I think you'd want to use a phone with USB C then use a powered USB-C dock with wired ethernet, but get to square 0 and I bet you'd have something that could really sit there just serving for a long time. I'd be a little concerned with IO access since the internal MMC would be constantly hammered, but there are USB-C external drive enclosures you could easily use that for storage and not have to worry about mutilating your phone's mmc.

Part of me wants to try sometime just to prove it can be done.

[–] [email protected] 1 points 1 year ago

You can use old phones to run file servers...