I took a look at Bluesky’s repos, as I finally got an invite a few days ago. I’ve been interested in decentralised social networks for almost a decade now and ATProtocol is look very promising!
There’s not much official doco on how to get a dev environment up so here’s a quick way to get things running locally.
There are a few repos involved so it’s maybe best to make folder to clone them into:
mkdir bluesky
git clone https://github.com/bluesky-social/did-method-plc
git clone https://github.com/bluesky-social/atproto
Then clone my fork with just one change, a docker-compose file for Postgres (or add my changes to your fork of Indigo)
git clone https://github.com/irab/indigo
You’ll first need to have docker-desktop/colima and docker-compose installed and then jump into the indigo directory:
brew install docker-compose
cd indigo
docker-compose up
This will spin up a local Postgres server. The SQL scripts just create the DBs and add the bsky user and permissions. If there are issues with the database or your containers, run the follow to get a fresh environment:
docker-compose down --volumes
rm -rf ./postgres-data
docker-compose up
Then you need to follow the non-postgres instructions in HACKING.md, which is mostly repeated below but with some additional install/make steps.
There’ll be a few pop-ups like this, just click allow:
Open a second terminal and go into the did-method-plc
repo:
cd ../did-method-plc
# If you don't have node or yarn installed correctly
brew install volta
volta install node
volta install yarn
# If you don't have pino-pretty
npm install -g pino-pretty
yarn install
make run-dev-plc
Open up a third terminal and go into the atproto repo directory:
cd atproto
yarn install
make build
make run-dev-pds
You should have three terminals running:
Open up a fourth terminal, in the indigo
directory:
make build
make run-dev-bgs
Open up a fifth terminal, also in the indigo
directory:
make run-dev-labelmaker
Open up a sixth terminal, also in the indigo
directory and push some data through with fakermaker
:
# setup and create initial accounts; 100 by default
mkdir data/fakermaker/
export GOLOG_LOG_LEVEL=info
go run ./cmd/fakermaker/ gen-accounts > data/fakermaker/accounts.json
# create or update profiles for all the accounts
go run ./cmd/fakermaker/ gen-profiles
# create follow graph between accounts
go run ./cmd/fakermaker/ gen-graph
# create posts, including mentions and image uploads
go run ./cmd/fakermaker/ gen-posts
# create more interactions, such as likes, between accounts
go run ./cmd/fakermaker/ gen-interactions
# lastly, read-only queries, including timelines, notifications, and post threads
go run ./cmd/fakermaker/ run-browsing
You should now have most of core Bluesky service up and running locally.
Now I’m off to take a look at the new feed generator!