Skip to content

Commit

Permalink
Merge branch 'main' into testdrive
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Feb 14, 2023
2 parents 6f3ef5d + 9c7d27f commit 9406962
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TODO: explain future plan to leverage CRDTs for rollback checkpoints.

## Accessing the Data

_Scrolls_ doesn't provide any custom client for accesing the data, it relies on the fact that the canonical clients of the selected backends are ubiquitous, battle-tested and relatively easy to use. By knowing the structure of the stored keys/values, a developer should be able to query the data directly from Redis.
_Scrolls_ doesn't provide any custom client for accessing the data, it relies on the fact that the canonical clients of the selected backends are ubiquitous, battle-tested and relatively easy to use. By knowing the structure of the stored keys/values, a developer should be able to query the data directly from Redis.

TODO: reference specs for each key/value

Expand Down Expand Up @@ -223,14 +223,14 @@ Assuming you're using Redis as a storage backend (only one available ATM), we re
{b'2548228522837ea580bc55a3e6a09479deca499b5e7f3c08602a1f3191a178e7:20', b'04086c503512833c7a0c11fc85f7d0f0422db9d14b31275b3d4327c40c6fd73b:25'}
```

The Redis operation being used is `smembers` which return the list of members of a set stored under a particular key. In this case, we query by the value `c1.addr1w8tqqyccvj7402zns2tea78d42etw520fzvf22zmyasjdtsv3e5rz`, where `c1` is the key prefix specified in the config for our particular collection and `addr1w8tqqyccvj7402zns2tea78d42etw520fzvf22zmyasjdtsv3e5rz` is the address we're intereted in querying. The response from redis is the list of UTXOs (in the format `{tx-hash}:{output-index}`) that are associated with that particular address.
The Redis operation being used is `smembers` which return the list of members of a set stored under a particular key. In this case, we query by the value `c1.addr1w8tqqyccvj7402zns2tea78d42etw520fzvf22zmyasjdtsv3e5rz`, where `c1` is the key prefix specified in the config for our particular collection and `addr1w8tqqyccvj7402zns2tea78d42etw520fzvf22zmyasjdtsv3e5rz` is the address we're interested in querying. The response from redis is the list of UTXOs (in the format `{tx-hash}:{output-index}`) that are associated with that particular address.

### How do I read the data using NodeJS?

TODO

### What is "swarm mode"?

Swarm mode is a way to speed up the process of rebuidling collection from scratch by splitting the tasks into concurrent instances of the _Scrolls_ daemon by partitioning the history of the chain into smaller fragments.
Swarm mode is a way to speed up the process of rebuilding collection from scratch by splitting the tasks into concurrent instances of the _Scrolls_ daemon by partitioning the history of the chain into smaller fragments.

![swarm mode diagram](assets/swarm.svg)
7 changes: 6 additions & 1 deletion src/reducers/addresses_by_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ impl Reducer {
address: Address,
output: &mut super::OutputPort,
) -> Result<(), gasket::error::Error> {
let full_address = address.to_bech32().or_panic()?;
// exit early since we don't care about Byron
if matches!(address, Address::Byron(_)) {
return Ok(());
}

let full_address = address.to_string();
let stake_address = any_address_to_stake_bech32(address);

let stake_address = match stake_address {
Expand Down

0 comments on commit 9406962

Please sign in to comment.