Skip to content
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

Fix typos #103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
[![Twitter Follow](https://img.shields.io/twitter/follow/vocdoni.svg?style=social&label=Follow)](https://twitter.com/vocdoni)

<center>
<b>⚠ This project is currently a MVP and will be change ⚠</b>
<b>⚠ This project is currently a MVP and will be changed ⚠</b>
</center>

---

## Description

Census3 is an API service to create censuses for elections with holders of a single token or a combination of a some of them. The service creates a list of holder addresses and balances and keeps it updated in realtime, for every registered token. Then, allows to create a merkle tree census (compatible with [Vocdoni](https://vocdoni.io/)) with these holders, using its balances as vote weight.
Census3 is an API service to create censuses for elections with holders of a single token or a combination of some of them. The service creates a list of holder addresses and balances and keeps it updated in realtime, for every registered token. Then, allows to create a merkle tree census (compatible with [Vocdoni](https://vocdoni.io/)) with these holders, using its balances as vote weight.

#### Suported contract types
The service suports the following list of token types:
#### Supported contract types
The service supports the following list of token types:
* ERC20
* ERC721
* ERC1155 (*coming soon*)
Expand All @@ -39,7 +39,7 @@ The service suports the following list of token types:
#### About complex strategies
A strategy is a definition of a group of previously created tokens and how their scanned holders must be combined to create a census.
* Must support combinations of tokens which contains:
* A operator, which is a function associated with a tag (e.g. `AND`) that are used to combine token holders and define how to combine them.
* An operator, which is a function associated with a tag (e.g. `AND`) that are used to combine token holders and define how to combine them.
* Two token symbols (e.g. `BTC`), that identifies the token holders to combine.
* Must have the following format: `<token_symbol> <operator> <token_symbol>`, e.g. `BTC OR ETH`.
* Must support groups of combinations, e.g. `USDC AND (ETH OR (BTC AND DAI))`
Expand All @@ -48,7 +48,7 @@ A strategy is a definition of a group of previously created tokens and how their

## Documentation

1. [How to run the Census3 servive](#how-to-run-the-census3-api-service)
1. [How to run the Census3 service](#how-to-run-the-census3-api-service)
2. [Basic example](#basic-example)
3. [API definition](#api-defintion)

Expand Down Expand Up @@ -126,13 +126,13 @@ curl -X GET \
http://localhost:7788/api/tokens/0xFE67A4450907459c3e1FFf623aA927dD4e28c67a
```

3. When the API ends, and the token reaches `synced` status (`token.status.synced = true`), its time to create a new census based on the default token strategy. This strategy is created during the token registration and just contains the holders of this token. To create the census with token holders, you need to know the `token.defaultStrategy` (from token info endpoint):
3. When the API ends, and the token reaches `synced` status (`token.status.synced = true`), it's time to create a new census based on the default token strategy. This strategy is created during the token registration and just contains the holders of this token. To create the census with token holders, you need to know the `token.defaultStrategy` (from token info endpoint):
```sh
curl -X POST \
--json '{"strategyID": <strategyId>, "anonymous": true}" \
http://localhost:7788/api/censuses
```
4. The last request will return a `queueId` which identifies the census creation and publication processes on the API queue. It will be completed in background. We can check if the task is done, it raised an error or was succesfully completed:
4. The last request will return a `queueId` which identifies the census creation and publication processes on the API queue. It will be completed in background. We can check if the task is done, it raised an error or was successfully completed:
```sh
curl -X GET \
http://localhost:7788/censuses/queue/<queueId>
Expand All @@ -157,5 +157,5 @@ cd234ba75988e04e1e7a3234e48ff4033633142f
{"done":true,"error":null,"census":{"censusId":1,"strategyId":1,"merkleRoot":"73368af290f4d0dfcb25b12060184bb3e5ad4147c5e5949de6729800c3629509","uri":"ipfs://bafybeiehspu3xrpshzjcvexl52u756cwfjobcwjz7ol4as44zfpvnlchsu","size":644,"weight":"5180125781955736442164650279357953853238828163172892166520872906800","anonymous":true}}
```

### API Defintion
Check out the API endpoints definitions, accepted requests and expected responses in the [`./api` folder](./api).
### API Definition
Check out the API endpoints definitions, accepted requests and expected responses in the [`./api` folder](./api).
10 changes: 5 additions & 5 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ List of already added tokens.
}
```

> If `tags` is empty, it will be ommited.
> If `tags` is empty, it will be omited.

- ⚠️ errors:

Expand Down Expand Up @@ -131,7 +131,7 @@ Returns the information about the token referenced by the provided ID.
}
```

> If `tags` is empty, it will be ommited.
> If `tags` is empty, it will be omited.

- ⚠️ errors:

Expand Down Expand Up @@ -326,7 +326,7 @@ Returns the information of the snapshots related to the provided ID.

| HTTP Status | Message | Internal error |
|:---:|:---|:---:|
| 400 | `malformed census ID, it must be a integer` | 4001 |
| 400 | `malformed census ID, it must be an integer` | 4001 |
| 404 | `census not found` | 4006 |
| 500 | `error getting census information` | 5009 |
| 500 | `error encoding census` | 5017 |
Expand Down Expand Up @@ -371,7 +371,7 @@ Returns a list of censusID for the strategy provided.
| HTTP Status | Message | Internal error |
|:---:|:---|:---:|
| 204 | `-` | 4007 |
| 400 | `malformed census ID, it must be a integer` | 4001 |
| 400 | `malformed census ID, it must be an integer` | 4001 |
| 404 | `census not found` | 4006 |
| 500 | `error getting census information` | 5009 |
| 500 | `error encoding censuses` | 5018 |
| 500 | `error encoding censuses` | 5018 |
Loading