-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,76 @@ | ||
# carbonable-indexer-rs | ||
|
||
Indexer Carbonable in Rust | ||
|
||
Pre-requisite | ||
--- | ||
## Pre-requisite | ||
|
||
Install [just](https://github.com/casey/just#installation). This is a more convenient task runner. | ||
Install [docker](https://docs.docker.com/engine/install) | ||
Install [rust](https://www.rust-lang.org/tools/install) | ||
|
||
To install project and its dependencies. | ||
|
||
```shell | ||
$ just install | ||
``` | ||
|
||
**Everytime `${env}` is asked, default is testnet so you wille have to tell env only for mainnet** | ||
|
||
|
||
### Deployment | ||
|
||
To testnet | ||
|
||
```shell | ||
$ just deploy | ||
$ just deploy | ||
``` | ||
|
||
Or mainnet | ||
|
||
```shell | ||
$ just deploy mainnet | ||
``` | ||
|
||
### Description | ||
|
||
Indexer has 3 main commands : | ||
|
||
- migration (just migrate // cd /srv/www && ./carbonable-migration) | ||
- seeding (just run_seeding // cd /srv/www && ./carbonable-indexer --only-seed) | ||
- indexing (just run_indexer // cd /srv/www && ./carbonable-indexer --only-index) | ||
|
||
|
||
Base onchain contract address can be found under `data/{env}.data.json` | ||
|
||
|
||
--- | ||
|
||
If at some time you need to **reindex data** or **re-seed** application (e.g contract address have changed) | ||
|
||
```shell | ||
$ just ssh ${env} | ||
$ just ssh {env_name} //(ex : mainnet-blue) | ||
$ cd srv/www | ||
$ ./carbonable-migration refresh | ||
$ ./carbonable-indexer --only-seed | ||
$ ./carbonable-indexer seed | ||
$ exit | ||
$ just restart_indexer ${env} | ||
$ just restart_indexer {env_name} | ||
``` | ||
|
||
|
||
### Utils | ||
|
||
List all available commands with documentation | ||
|
||
```shell | ||
$ just --list | ||
``` | ||
|
||
|
||
Write migration: | ||
|
||
```shell | ||
$ cargo install sea-orm-cli | ||
$ cd packages | ||
$ sea-orm-cli migrate generate ${name_of_the_migration} | ||
``` | ||
|
||
Full reset database | ||
|
||
Full reset database | ||
```shell | ||
$ just reset && just run_seeding && just run_indexer | ||
``` |