Skip to content

Repository files navigation

dnproto

This project started as a toolset for debugging and working with atproto. Things like resolving handles, downloading repos, parsing repos, etc. Eventually it turned into a PDS implementation.

Nowadays I spend most of my time working on the Rust version -> rustproto.

(Note: dnproto is an independent, community-driven project and is not affiliated with, sponsored by, or endorsed by Bluesky Social, PBC.)

 

Source code

CAR repo encoding and decoding:

MST data structure:

PDS implementation:

Listening to a firehose:

General Bluesky WS calls:

 

Using the command line tool (Windows)

The following steps show how to use the command line tool on Windows in PowerShell. Requires .NET 10.

To get started, change into the root directory and build.

dotnet build

Next, change into the scripts directory, and list the files:

cd powershell
ls

Most of the files in this directory represent one "command" of the tool. Here are some that I call most often:

# resolve actor info and retrieve did, did doc
.\ResolveActorInfo.ps1 -actor <handle or did>

# get plc dir history for actor
.\GetPlcHistory.ps1 -actor <handle or did>

# download the user's repo and store in the data directory
.\GetRepo.ps1 -actor <handle or did>

# print stats for the downloaded repo
.\PrintRepoStats.ps1 -actor <handle or did>

# print records for the downloaded repo
.\PrintRepoRecords.ps1 -actor <handle or did>

# print posts for the downloaded repo
.\PrintRepoPosts.ps1

# log in to the account. stores session locally
.\CreateSession.ps1 -actor <handle or did> -password <password>

# get unread count for logged in session
.\GetUnreadCount.ps1

# create new post for logged in session
.\CreatePost.ps1 -text "hello world"

# log out of account
.\DeleteSession.ps1 -actor <handle or did>

 

The data directory

When you are using the command line tool, it uses a local directory to store cached data. By default, it uses the "data" directory in the repo. You can change this in the _Defaults.ps1 file.

 

Debugging a user

When someone is having issues with their account, I like to run the following commands:

  • ResolveActorInfo - just check their DID, DID doc, etc
  • GetPdsInfo - lists things on their PDS
  • GetPlcHistory - checks their PLC history - make sure that the account isn't active in multiple places
  • StartFirehoseConsumer - make sure you can connect to their PDS (I've seen this fail)
  • DescribeRepo - check that it looks ok

Also you can query the DID for moderation labels:

https://mod.bsky.app/xrpc/com.atproto.label.queryLabels?uriPatterns=USERS_DID

 

Linux Support

Is Linux supported? Yes! I run my dnproto PDS on Linux.

About

tools for working with atproto

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages