eallion

大大的小蜗牛

机会总是垂青于有准备的人!
mastodon
github
twitter
steam
telegram
keybase
email

Introduction to the Federal Universe and Mastodon

@e5n.cc@eallion

Preface: The Fediverse Has No Barriers#

A_view_into_the_Fediverse

Don't try to understand it, feel it. — "Inception"

Fediverse (Fediverse = federation + universe) may seem profound and mysterious to new users, but just like this famous quote from "Inception," don't try to understand it, just use it! There are no barriers to using the Fediverse; it's very easy to get started—choose an open instance; register an account; follow its rules; and start using it! Don't like the rules of this instance? Just switch to another. An instance is generally a domain website.
There are no barriers to using the Fediverse! You only need an account from one instance to follow, comment, and like users and their posts on other instances. It doesn't matter if the domain names of these accounts are different; as long as the federation protocol is the same, they can communicate.
Is there a barrier to self-hosting an instance? As long as you can think of wanting to self-host an instance, then there are no barriers. There are many step-by-step tutorials online.
I self-hosted a Mastodon service in April 2017 and joined the Fediverse, and it has been over 7 years now. Later, for unknown reasons, I cleared this Mastodon (along with QQ Space, Weibo, Twitter, Facebook, etc.), and in 2023, I changed the domain name and publicly launched the instance e5n.cc, so I have some insights into the Fediverse and would like to share my experiences briefly.

╰(°▽°)╯: e5n = eallion's k8s notation; cc = abbreviation for Charles Chin.

An Example 🌰#

1. Phone Universe#

If you have a "China Mobile" phone number, you can call or text your friend's "China Unicom" phone number on their iPhone, and you can also call or text an "AT&T" phone number on an American friend's Samsung phone. As long as you know someone's phone number, and as long as the other party's phone and the carrier support the same communication protocol, you can call or text them.
Such a mobile communication network can be referred to as a "phone universe" or "mobile universe."

2. Email Universe#

Anyone who surfs the internet should have an email address. You can send emails from a QQ email to a Gmail email, to a NetEase 163 email, or to a Hotmail email. As long as the email accounts provided by the other party use the same email communication protocol, they can send and receive emails with each other.
Such an email communication network can be referred to as an "email universe."

3. Summary (Adapted from Wikipedia)#

Fediverse consists of a series of free software, with a group of interconnected servers (self-hosted or third-party hosted), providing web publishing (such as social media, microblogging, blogs, or websites) or file hosting functions together. Although each server operates independently, and there are many instances with diverse content, the servers can communicate with each other. Users can create different accounts on different servers (instances). These accounts can communicate across instance boundaries because the software running on the servers supports one or more communication protocols that adhere to open standards. 1 Users can publish text or other media files through accounts in the Fediverse, and they can also follow other users. 2 In some cases, users can publish or share data (such as audio, video, text files, etc.), making it open to all or part of the people and allowing them to collaboratively edit content (such as calendars and directories).

Fediverse_branches_1.2

Terminology#

Adapted from: 《Introduction to the Fediverse》(Web Archive

Fediverse (fediverse)#

The collection of all federated services (Federated Server) is called the Fediverse.

Federated Services#

Refers to independently deployed services that can communicate with each other. The key point here is the ability to communicate; the functionality is irrelevant: social networks, microblogging, blogs, ordinary websites, file storage can all be included. Communication is standardized by federation protocols.

Federation Protocol#

The protocol (Protocol) for communication between different instances (Instance) in the Fediverse.

Instance (Instance)#

A federated service is called an instance. Some also refer to an instance as a Pod. Anyone can choose a federation protocol to write a brand new instance, but a more popular approach is to choose a Fediverse software to generate an instance.

Fediverse Software#

Software that facilitates others to quickly deploy new instances, which can be designed according to a certain federation protocol's API or can design a unique API.
The most famous software is: Mastodon.

Identity (Identity)#

An account registered on an instance is called an identity. In the following text, I will also use the term user, which is more familiar to everyone.

Protocol (Protocol)#

A set of agreed-upon standards. The same protocol means that communication is possible; even if two instances belong to different Fediverse software, as long as the protocols are the same, they can communicate. Therefore, the Fediverse is a very large concept.
The current mainstream protocol is the ActivityPub protocol used by Mastodon.

API (Application Programming Interface)#

In a Fediverse, the API refers to the methods left by an instance for other programs to communicate with that instance. A completely self-written instance needs to design its own API, while an instance generated by Fediverse software generally directly uses the API designed by the Fediverse software.

Regarding the difference between protocols and APIs: a protocol is just a standard, while an API is a specific implementation of a protocol. An API can fully comply with a protocol, partially comply with a protocol, or design an API outside of the protocol. To put it in another way: suppose all of humanity has a common moral standard, then this moral standard is the protocol, and the laws of various countries are the APIs. Is there a better analogy?

Examples of Federation Protocols#

Adapted from: 《Introduction to the Fediverse》(Web Archive

Common federation protocols include:

Zot or Zot/6 Protocol#

Provides decentralized network connections for independent websites, communication, identity (user) management, and permission control. This is a protocol that has only emerged in the last two years, but it seems that the website is no longer accessible; the Wikipedia entry on Fediverse provided an Internet Archive link when mentioning it.

Diaspora Protocol#

According to Wikipedia, it is a non-profit, user-owned, distributed social network; GitHub page describes it as a privacy-aware, distributed, open-source social network.
The only Fediverse software using this protocol should be diaspora*, which is used by them. This Fediverse software has 12.5k stars and 2.9k forks on GitHub, started in 2010, and has been actively developed for ten years, with 88 releases, but the version number has risen conservatively, only reaching 0.7.14.0.
As a side note, I found a list of all open-source social network services on their GitHub page, which records a lot of instances, their instance versions, the Fediverse software used, the protocols, the uptime of the services (percentage of time the service was not down), whether they support IPv6, network latency, whether registration is open, user numbers, and many other details. I tried searching for my own instance, and it can be found. This list is updated in a timely manner and is truly a treasure trove!

OStatus Protocol#

According to Wikipedia, this is a protocol specifically for federated microblogging, with Mastodon being one of the earliest to use this protocol.
This protocol is an older one, created around 2010. In January 2012, a W3C community group aimed to maintain and further develop this protocol, but it didn't last long; in July 2014, a Federated Social Web Working Group was formed, which directly created a new protocol that overshadowed the OStatus protocol.

ActivityPub Protocol#

This is the new protocol created by the Federated Social Web Working Group, which overshadowed the OStatus protocol.
According to Wikipedia, an issue #228 on GitHub: What are the differences between OStatus, pump.io, and ActivityPub and the final acknowledgments section of the ActivityPub protocol, this protocol is designed based on the pump.io API. It also fully absorbed the lessons learned from OStatus during its design, ultimately becoming a successful protocol.
I wonder if any experts can explain the specific differences and improvements between it and the OStatus protocol~ I haven't delved into it, but I know that ActivityPub is very powerful.
In September 2017, Mastodon began using the ActivityPub protocol; in January 2018, W3C recommended this protocol as a standard; in January 2019, Mastodon stopped supporting the previous OStatus protocol.

Adapted from: https://o3o.ca/@jiangshanghan/105966250069371678

On the page https://fediverse.party/en/portal/servers/, you can find instances of interest categorized.
Since some instance owners do not wish for their instances to be public, here are some relatively official or large open instances:

Original PlatformAlternativeLarge Instances
TwitterMastodonhttps://joinmastodon.org/servers
WeiboMisskeyhttps://misskey-hub.net/en/servers/
InstagramPixelfedhttps://pixelfed.org/servers
FacebookFriendicahttps://dir.friendica.social/servers
YoutubePeertubehttps://joinpeertube.org/instances
WritingWriteehttps://writee.org/

To avoid a situation similar to Alipay mocking Windows Phone users—"Why choose a 1% life?"—I personally recommend choosing instances of Mastodon and its fork versions that support the mainstream ActivityPub protocol in the Fediverse.
The official instance operated by Mastodon is: https://mastodon.social/
Misskey is also very popular and suitable for users interested in anime.

PS: Recommended Reading

Self-Hosting Instances#

The main barrier to self-hosting a Mastodon instance lies in server configuration; a 1C1G configuration is indeed very difficult to run a Mastodon instance (it can still be used after optimization), and even a 2C2G configuration needs some optimization. Currently, my personal instance e5n.cc runs on a 2C2G Tencent Cloud lightweight server, limiting 256M of PostgreSQL and 1 thread of Sidekiq tasks.

Another barrier is that the server should not be located in a local area network environment to communicate with other instances.

Mastodon's media file (images, videos, emojis, etc.) storage logic is to cache media files from users of other instances into its own instance, and the official instance by default (without modifications) does not support most HTML tags, so <img> tags cannot be used, requiring relatively large hard disk space for caching. A more cost-effective approach is to cache media files in S3 object storage. Currently, my personal instance is connected to 7 relay nodes, generating 3-5G of content per day, depending on whether the users you follow and the users on the relay are talkative and love to share images. In actual experience, the free 10G of Cloudflare R2 is not enough to cache media for 2 days.

I highly recommend this article 《How to Build a Mastodon Instance Using Docker (Part 1): Basic Setup》(Web Archive) which provides a step-by-step guide to deploying your own Mastodon instance using Docker. You don't need much technical knowledge; as long as you have successfully deployed a Docker application, you can smoothly deploy Mastodon. If you don't want to use Docker, you can also install Mastodon from source code, which is even easier, as the official documentation is very detailed: https://docs.joinmastodon.org/admin/install/.

My self-hosting costs:

  • Domain: e5n.cc ¥39.00/year
  • Server: Tencent Cloud lightweight Silicon Valley 2C2G ¥144.00/year
  • S3 Storage: Cloudflare R2 under $1.00/month

Highly recommended: If you only have a low-spec server and still want to join the Fediverse, you can try GoToSocial, which is developed in Go and based on the ActivityPub protocol. I have personally experienced it for a few months; it is very lightweight, and resource usage is even lower than Memos: Ref Status. The downside is that it does not come with a built-in front-end application (not really a downside), and you need to use third-party applications to post.

gotosocial_docker_stat

Interesting Ecosystem#

Long-term updates

Mastodon Timeline Embed Website#

Source code: idotj/mastodon-embed-feed-timeline GitHub Mirror

Embed a Mastodon timeline on your website to showcase posts. Very easy to set up, no dependencies, no trackers, WCAG compliant, and fully responsive.

The Digu page currently integrated into my blog is embedded using this tool.

Mastofeed#

Source code: fenwick67/mastofeed

ActivityPub feed => iframe embed.
Embed Mastodon feeds for blogs, etc.
On the official website https://www.mastofeed.com/, simply fill in your federation account information to generate a segment of <iframe> HTML code.

masto.js#

Source code: neet/masto.js

A universal Mastodon API JavaScript client. The ELK client uses masto.js.

  • 🌎 Universality: Suitable for Node.js, browsers, and Deno
  • 📦 Lightweight: Less runtime code, only 7kB+ when compressed
  • 📚 TypeScript: Written in TypeScript and provides type definitions
  • 🧪 Well-maintained: Actively maintained by a Fediverse enthusiast since 2018 with 99% test coverage using real Mastodon servers
Wildebeest - Fediverse Built on Cloudflare#

Source code: cloudflare/wildebeest

Wildebeest is an easy-to-deploy open-source server compatible with ActivityPub and Mastodon, fully built on Cloudflare's Supercloud. If you want to run your own server in the Fediverse, you can now do it entirely through Cloudflare.

The official Cloudflare blog introduces: 《Welcome to Wildebeest: The Fediverse on Cloudflare

Wildebeest is a server compatible with ActivityPub and Mastodon, aimed at allowing anyone to run their Fediverse server and identity on their own domain without retaining infrastructure, and with minimal setup and maintenance to get it running in minutes.

Wildebeest runs on Cloudflare's Supercloud, using Workers, Pages, Durable Objects, Queues, and the D1 database to store metadata and configuration information. It also employs Zero Trust Access for authentication and uses Images for media handling.

Mravatar#

Source code: HolgerHuo/Mravatar

A globally recognized avatar API for Mastodon, similar to Gravatar. Developed in Python, it can be self-hosted.

My avatar: https://mravatar.r669.live/avatar/@[email protected]

Mastodon-Driven Blog Comment System#

Original: Toot toot! Mastodon-powered Blog CommentsWeb Archive

The author introduces a fresh approach to using the Mastodon social network as website comments. Its biggest advantage is data openness, which won't be controlled by third parties, as Mastodon is an open, decentralized network service.

PS: 《Mastodon / GoToSocial as a Blog Comment System》- Korkabing Tang

Mastodon Token Generator#

Source code: takahashim/mastodon-access-token

Accessing the Mastodon API requires an Access_token, but since there is currently no direct user interface to obtain the Access_token on the Mastodon settings screen, we created a SPA (Single Page Application) site to obtain the Access_token from external sources. (However, if you create a mature application that third parties will also use, you should implement this mechanism within the application itself, so consider this as experimental only).
I previously wrote an article 《NeoDB Obtaining Access Token》, which can also use this tool to generate.

Deploying a Federated Instance with Just 6 Files#

Source code: rothgar/static-mastodon

The author of this article mentions that he deployed a Mastodon instance with 6 files. I tried it, and it really allows following him, but communication is not possible.
In reality, only 1 file is needed, but to make the instance look more complete, 6 files were used:

  • 2 files to create users
  • 2 files to pretend we are popular
  • 2 images for aesthetic purposes
.
├── .well-known
  └── webfinger    <- user discovery (optional)
├── banner.png      <- banner image (optional)
├── followers       <- how many followers (optional)
├── following       <- how many following (optional)
├── image.jpg       <- profile image (optional)
└── justin          <- user information

A Few Small Things#

"The best time to plant a tree was ten years ago; the second best time is now." The Fediverse is thriving; when do you think is the best time to join the Fediverse?

Why Meta's Threads Wants to Integrate with the Fediverse#

https://www.solidot.org/story?sid=77121

At the end of last year, Meta invited developers and representatives from the Fediverse to a dialogue meeting at its San Francisco office, with participants from the Threads team and the legal team. The scale of the Fediverse is still small, with microblogging service Mastodon having only a few million active users, while Threads, despite being launched for only 8 months, has already become a behemoth comparable to Godzilla compared to Mastodon. Although Meta announced at the launch of Threads that it would support the federation protocol ActivityPub, many people believed months later that Threads would never integrate ActivityPub to achieve interoperability with platforms like Mastodon. However, Meta is still pushing this plan, having announced a timeline for integration, which is currently in the first phase. Why would Meta, known for its walled garden approach, want to open up and interoperate? This question was on the minds of the participants. The response from Meta developers was that they believe this is a general direction for social media development. After Elon Musk's acquisition of Twitter, social media celebrities have increasingly felt uncomfortable with the fact that they own their followers on the platform; they want the ability to migrate freely. This viewpoint has some validity, but it is not very convincing. The representatives at the meeting believed: 1) Meta sees Twitter as an important and powerful part of the zeitgeist, and is interested in it; it emulates Google's strategy in response to Apple's iPhone, promoting an open competitor from which they can benefit; 2) Meta is concerned that regulation of social media will strengthen, so they built an absolutely open platform to eliminate controversies over censorship of conservative speech or antitrust issues; open means users can migrate freely and switch freely; 3) Differentiation, perhaps a sudden inspiration from a product manager; 4) Zuckerberg really hates Elon Musk and is doing everything possible to destroy Twitter/X.

NeoDB Major Updates from Last Year to Now#

https://neodb.social/announcement/

Personal tags have added annual statistics, filtering, and sorting; support for BoardGameGeek links, Letterboxd imports; ActivityPub has been enabled, allowing each user to have an @neodb.social identity interconnected with other Fediverse instances, whether registered via email or federated instances.

Further Reading#

Footnotes#

  1. Fed FAQ. Mastodon User Guide.(Original content archived on 2017-04-09).

  2. What on Earth is the fediverse and why does it matter?. New Atlas. [2021-10-10]. (Original content archived on 2021-02-25).

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.