-
-
Notifications
You must be signed in to change notification settings - Fork 48
rsky-relay: Add com.atproto.sync.listHosts handler
#137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| hostname, | ||
| seq, | ||
| // TODO: Track status of hosts. | ||
| status: HostStatus::Active, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indigo does things like mark a host as offline if it fails repeated connection attempts, or mark hosts that are actually relays as banned. I couldn't find any logic in rsky-relay that did this, so for now this reports the same default value as indigo. This does mean rsky-relay is over-reporting which hosts it is actively connected to, but that can be fixed by someone more familiar with the stack.
| .into_iter() | ||
| .map(|(_, hostname, seq)| Host { | ||
| // TODO: Track host account counts. | ||
| account_count: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indigo updates its counter for a PDS host whenever an account is first observed on a PDS or is observed to move between PDSs. AFAICT rsky-relay doesn't have any tracking of which host a repo is on, so I haven't hooked this up to anything and it instead reports the same default value as indigo.
❯ curl "http://localhost:9000/xrpc/com.atproto.sync.listHosts?limit=10" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1034 100 1034 0 0 98k 0 --:--:-- --:--:-- --:--:-- 100k
{
"cursor": "10",
"hosts": [
{
"accountCount": 0,
"hostname": "reishi.us-east.host.bsky.network",
"seq": 229148683,
"status": "active"
},
{
"accountCount": 0,
"hostname": "scarletina.us-east.host.bsky.network",
"seq": 225800171,
"status": "active"
},
{
"accountCount": 0,
"hostname": "woodear.us-west.host.bsky.network",
"seq": 170959567,
"status": "active"
},
{
"accountCount": 0,
"hostname": "verpa.us-west.host.bsky.network",
"seq": 232327256,
"status": "active"
},
{
"accountCount": 0,
"hostname": "panthercap.us-east.host.bsky.network",
"seq": 222885971,
"status": "active"
},
{
"accountCount": 0,
"hostname": "milkcap.us-west.host.bsky.network",
"seq": 236909613,
"status": "active"
},
{
"accountCount": 0,
"hostname": "puffball.us-east.host.bsky.network",
"seq": 636838749,
"status": "active"
},
{
"accountCount": 0,
"hostname": "cortinarius.us-west.host.bsky.network",
"seq": 57424274,
"status": "active"
},
{
"accountCount": 0,
"hostname": "earthstar.us-east.host.bsky.network",
"seq": 222018566,
"status": "active"
},
{
"accountCount": 0,
"hostname": "truffle.us-east.host.bsky.network",
"seq": 226445298,
"status": "active"
}
]
}I was able to test successfully! |
afbase
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 - will wait to hear from one other dev before merge
Summary
This implements the
com.atproto.sync.listHostsendpoint.Related Issues
https://bsky.app/profile/rude1.blacksky.team/post/3loazssauks23
Changes
Checklist