···2233Welcome to the repository for the official Bluesky PDS (Personal Data Server). This repository includes container images and documentation designed to assist technical people with self-hosting a Bluesky PDS.
4455+We're testing federation in a separate sandbox network. Checkout [SANDBOX.md](https://github.com/bluesky-social/pds/blob/main/SANDBOX.md) for an overview of the sandbox network.
66+77+We do not currently support PDS federation on the production network.
88+59## FAQ
610711### What is Bluesky?
···2842881. Enter the URL of your PDS (e.g. `https://example.com/`)
2852891. Create an account
2862901. Create a post
291291+292292+Checkout [SANDBOX.md](https://github.com/bluesky-social/pds/blob/main/SANDBOX.md) for an overview of participating in the sandbox network.
287293288294## PDS environment variables
289295
+125
SANDBOX.md
···11+# Sandbox Guide
22+33+Welcome to the atproto federation sandbox!
44+55+This is a completely separate network from our production services that allows us to test out the federation architecture and wire protocol.
66+77+**🐉 Beware of dragons!**
88+99+This hasn’t been production tested yet. It seems to work pretty well, but who knows what’s lurking under the surface. Have patience with us as we prep for federation.
1010+1111+On that note, please give us feedback either in [Issues](https://github.com/bluesky-social/atproto/issues) (actual bugs) or [Discussions](https://github.com/bluesky-social/atproto/discussions) (higher-level questions/discussions) on the [atproto repo](https://github.com/bluesky-social/atproto).
1212+1313+### Sandbox Rules
1414+1515+Please checkout the [Sandbox Rules](LINK_ME) before we get started. The gist is: this network is meant to test the technical underpinnings of federation. If you turn up technical problems for us, then you’re doing a great job. If you cause problems for us otherwise, we will defederate from you and will not give an explanation.
1616+1717+Do not:
1818+1919+- post content that requires active moderation or violates the [Bluesky Community Guidelines](https://blueskyweb.xyz/support/community-guidelines)
2020+- advertise your service as being “Bluesky” or “production atproto network” - this is a sandbox and is meant for technical users
2121+- create a service with more than 1000 accounts on it
2222+- mirror sandbox did:plcs to production
2323+2424+### Routine wipes
2525+2626+As part of the sandbox, we will be doing routine wipes of all network data.
2727+2828+We expect to perform wipes on a weekly or bi-weekly basis, though we reserve the right to do a wipe at any point.
2929+3030+When we wipe data, we will be wiping it on all services (BGS, App View, PLC). We will also mark any existing DIDs as “invalid” & will refuse to index those accounts in the next epoch of the network to discourage users from attempting to “rollover” their accounts across wipes.
3131+3232+# The Sandbox Network
3333+3434+This is a parallel network to production Bluesky where we can test out the federation architecture and wire protocol.
3535+3636+You can check out a high-level view of federation [here](https://blueskyweb.xyz/blog/5-5-2023-federation-architecture).
3737+3838+You can dive deeper into atproto [here](https://atproto.com/docs).
3939+4040+## Network Services
4141+4242+We are running three services: PLC, BGS, Bluesky App View
4343+4444+### PLC
4545+4646+**Hostname:** `plc.bsky-sandbox.dev`
4747+4848+**Code:** https://github.com/bluesky-social/did-method-plc
4949+5050+PLC is the default DID provider for the network. DIDs are the root of your identity in the network. Sandbox PLC functions exactly the same as production PLC, but it is run as a separate service with a separate dataset. The DID resolution client in the self-hosted PDS package is set up to talk the correct PLC service.
5151+5252+### BGS
5353+5454+**Hostname:** `bgs.bsky-sandbox.dev`
5555+5656+**Code:** https://github.com/bluesky-social/indigo/tree/main/bgs
5757+5858+BGS (Big Graph Service) is the firehose for the entire network. It collates data from PDSs & rebroadcasts them out on one giant websocket.
5959+6060+BGS has to find out about your server somehow, so when we do any sort of write, we ping BGS with `com.atproto.sync.requestCrawl` to notify it of new data. This is done automatically in the self-hosted PDS package.
6161+6262+If you’re familiar with the Bluesky production firehose, you can subscribe to the BGS firehose in the exact same manner, the interface & data should be identical
6363+6464+### Bluesky App View
6565+6666+**Hostname:** `api.bsky-sandbox.dev`
6767+6868+**Code:** https://github.com/bluesky-social/atproto/tree/main/packages/bsky
6969+7070+The Bluesky App View aggregates data from across the network to service the Bluesky microblogging application. It consumes the firehose from the BGS, processing it into serviceable views of the network such as feeds, post threads, and user profiles. It functions as a fairly traditional web service.
7171+7272+When you request a Bluesky-related view from your PDS (`getProfile` for instance), your PDS will actually proxy the request up to App View.
7373+7474+Feel free to experiment with running your own App View if you like!
7575+7676+# The PDS
7777+7878+The PDS (personal data server) is where users host their social data such as posts, profiles, likes, and follows. The goal of the sandbox is to federate many PDS together, so we hope you’ll run your own.
7979+8080+We’re not actually running a Bluesky PDS in sandbox. All of the team’s sandbox accounts are self-hosted.
8181+8282+The PDS that you’ll be running is much of the same code that is running on the Bluesky production PDS. Notably, all of the in-pds-appview code has been torn out. You can see the actual PDS code that you’re running on the [atproto/simplify-pds](https://github.com/bluesky-social/atproto/pull/1198) branch.
8383+8484+### Getting started
8585+8686+For complete instructions on getting your PDS set up, check out the [README](https://github.com/bluesky-social/pds/blob/main/README.md).
8787+8888+To access your account, you’ll log in with the client of your choice in the exact same way that you log into production Bluesky, for instance the [Bluesky web client](https://bsky.app/). When you do so, please provide the url of *your PDS* as the service that you wish to log in to.
8989+9090+Invites on your PDS are required by default - to generate your first invite code, please run:
9191+9292+```bash
9393+# PDS_HOSTNAME & PDS_ADMIN_PASSWORD both come from your pds.env file
9494+9595+curl -X POST https://<PDS_HOSTNAME>/xrpc/com.atproto.server.createInviteCode \
9696+ -u "admin:<PDS_ADMIN_PASSWORD>" \
9797+ -H "Content-Type: application/json" \
9898+ -d '{"useCount": 1}'
9999+```
100100+101101+### Auto-updates
102102+103103+We’ve included Watchtower in the PDS distribution. Every day at midnight PST, this will check our GitHub container registry to see if there is a new version of the PDS container & update it on your service.
104104+105105+This will allow us to rapidly iterate on protocol changes, as we’ll be able to push them out to the network on a daily basis.
106106+107107+When we do routine network wipes, we will be pushing out a database migration to participating PDS that wipes content and accounts.
108108+109109+You are within your rights to disable Watchtower auto-updates, but we strongly encourage their use and will not be providing support if you decide not to run the most up-to-date PDS distribution.
110110+111111+## Odds & Ends & Warnings & Reminders
112112+113113+🧪 Experiment & have fun!
114114+115115+🤖 Run [feed generators](https://github.com/bluesky-social/feed-generator). They should work the exact same way as production - be sure to adjust your env to listen to Sandbox BGS!
116116+117117+🌈 Feel free to run your own AppView or BGS - although it’s a bit more involved & we’ll be providing limited support for this.
118118+119119+👤 Your PDS will provide your handle by default. Custom domain handles should work exactly the same in sandbox as they do on production Bluesky.
120120+121121+⚠️ If you follow the self-hosted PDS setup instructions, you’ll have private key material in your env file - be careful about sharing that!
122122+123123+📣 This is a sandbox version of a **public broadcast protocol** - please do not share sensitive information.
124124+125125+🤝 Help each other out! Respond to issues & discussions, chat in Matrix/Discord, etc.