One of the main features of MetaGame is a SourceCred leaderboard that ranks players based on their receipt of a “cred” token from SourceCred.
In our transition to ComposeDB, we are going to try to remove a caching layer that we are currently using which stores all the player profiles in a Hasura instance. In order to query ComposeDB and get back an appropriate list to generate the leaderboard, ComposeDB needs to know what player’s cred scores are.
I understand that given a DID, it is possible to retrieve streams that are controlled by that DID. To maintain the cred score, however, there would be some external process updating the scores once a day or so. That process would be operating with a DID:KEY, more than likely.
Can I associate the stream for the app with the users’ streams. I’d like to write something like:
query Leaderboard {
player(order_by: {cred: {score: asc}}, where: {cred: {organization: {_eq: "MetaGame"}}}) {
name
username
backgroundImageURL
cred: {
score
}
}
}
Where the user added the name
/ username
/ etc., and an app set cred.score
.
Or would I do something like have the user generate a CACAO permission giving the app the right to write their cred value? This requires a user interaction (plus regular refreshes) to add the player to the leaderboard, so it’s not ideal.