Joystream / Joystream/joystream

Colossus state api re-factor

Open
#5,059 1 comment 0 reactions 0 assignees View on GitHub
colossus
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Evaluate need for state API endpoints:

- `/state/data-objects`
- Returns JSON array of all local data objects stored by node.
- Was previously used by v3.8.x nodes to determine if a node should try to fetch an object from remote node. But we switched using simpler "dumb" approach of just trying all nodes where object is expected to be available. Mainly because the response size was on order of several megabytes, and seemed wasteful. It would now only serve as a "diagnostic" endpoint.
- `/state/bags/{bagId}/data-objects`
- This is similar to /state/data-objects but performs a `gql` query on each request and a potentially slow `_.intersection()` on large array.
- `/state/data`
- Returns usage size of uploads,temp,pending folders
- On each request the stats are re-computed (lots of async fs i/o) seems wasteful and results should be cached

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.