Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://gitlab.com/jik.wtf/skysail
Rust Implementation of the Authenticated Transport Protocol
https://gitlab.com/jik.wtf/skysail
atp distributed social network distributed systems dweb
Last synced: about 2 months ago
JSON representation
Rust Implementation of the Authenticated Transport Protocol
- Host: gitlab.com
- URL: https://gitlab.com/jik.wtf/skysail
- Owner: jik.wtf
- Created: 2022-11-08T18:09:35.061Z (about 2 years ago)
- Default Branch: main
- Last Synced: 2024-11-16T22:56:23.277Z (about 2 months ago)
- Topics: atp, distributed social network, distributed systems, dweb
- Stars: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# skysail - now compiling to WebAssembly!
This is a Rust library designed for use with the AT Protocol and open social platforms like Bluesky. Although currently in a developmental phase, this library aims to be robust and modular, ensuring ease of development with simple demonstrations ready to go out-of-the-box.
The following milestones will need to be completed before a crate can be released on crates.io
- [ ] Dynamically generate types from Lexicon schema definitions
- [ ] Comprehensive testing, which has not recieved the attention it probably should have
- [ ] Add basic usage examples
- [x] Compile to WASM![bsky.png](https://i.ibb.co/FXH0ZtJ/image.png)
## Usage
### Run the development server
**Update October 2023:**
*This likely is not the best way to learn about atproto. On the TODO list is adding a "hello-world" example which interacts with the production Big Graph Service (BGS) deployed by Bluesky PBC.*Clone the atproto repo and checkout the latest branch known to work with this crate:
```
git clone -n https://github.com/bluesky-social/atproto/
cd atproto
git checkout b530a13d09ba8ad4bd600707f94728b14ce62a56
```
### Set up a JavaScript environment:
```
npm install --global yarn
yarn install --frozen-lockfile
yarn build
```
### Start Personal Data Server, and DID:PLC Server
```
cd packages/dev-env
yarn run start
```
Which should drop you at the following prompt:
```
[ v0.0.1 | created by Bluesky ]Initializing...
[2582] 👤 DID Placeholder server started http://localhost:2582
[2583] 🌞 Personal Data server started http://localhost:2583
(node:676724) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Test environment generated.
Type .help if you get lost
>```
## Build and run rust-atp
In a different terminal session, clone and build this repo:
```
git clone https://gitlab.com/jmcasey/skysail
cd skysail
cargo build
```Unfortunately due to schema changes and a less-than-working code generator, the library is not currently compatible with the live network. Fixing this is my second priority behind completing the code generator. (And this is a personal portfolio projects, no guarantees)
When working, the program creates a new ATP user, receiving a [DID Document](https://www.w3.org/TR/did-core/). Then it will start a session with the PDS, create a new post, and fetch the post to print to the screen. Check out `main.rs` for details on what calls are being made.
## Known Issues
- atproto is under active, daily development. **Things will change.**
- Regular updates to ATP Lexicons will break this library until the code generator is working. Please see the `codegen` branch where effort is currently being focused.
- Not all methods are implemented, most aren't.
- Warnings as far as the eye can see. Mostly for unused variables.
- Hardcoded values: Suitable for testing, but will be prioritised for removal.
- Silliness `with reqwest::Client`:
- Currently each method call has it's own HTTP request/response code, this will be refactored.
- Some methods return sensible ATP objects, others return JSON, yet others return raw `reqwest::Responses`.
- Need to consider what is best, what the developer expects, and what best supports ATP schemas/conventions in the future.
- Crate conventions, efficiencies, naming, etc.
- Should `await`s be exposed to the user of this crate? Unsure on best DX practices.
- ~~Are there a usable DID and CBOR crates available already?~~ Yes! We use them now. :)