-
Notifications
You must be signed in to change notification settings - Fork 79
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
53 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## torii reference | ||
|
||
### Name | ||
|
||
torii - An automatic indexer and networking layer for a world contract. | ||
|
||
### USAGE | ||
|
||
```sh | ||
torii [OPTIONS] | ||
``` | ||
|
||
### DESCRIPTION | ||
|
||
Starts the indexer and graphql/gRPC API endpoints. The indexer queries the provided Starknet RPC endpoint for transaction blocks and listens for transactions belonging to the world contract. Transactions may consist of component/system registrations, entity state updates, system calls, and events. The data is then parsed and stored in a local sqlite database. | ||
|
||
The graphql and gRPC API endpoints run in tandem with the indexer. The endpoints can be consumed by client applications and provides custom queries unique to your world contract. | ||
|
||
#### Database URL | ||
|
||
Torii uses a sqlite database to store indexed data. The database can be stored either in-memory or persistently on the filesystem. The in-memory database is ephermal and only lasts as long as the indexer is running. This is a fast and simple way to start the indexer for development/testing. Presistent storage should be used in production, it uses the local filesystem for storage. | ||
|
||
Note: If using in-memory db, after a period of inactivity the memory will be garbage collected and queries will result in errors. Workaround is starting `katana` with `--block-time` or use persistent database. | ||
|
||
```sh | ||
# Persistent database storage using file indexer.db | ||
torii --database-url sqlite:indexer.db | ||
``` | ||
|
||
### OPTIONS | ||
|
||
#### General Options | ||
|
||
`-w, --world` | ||
Address of the world contract to index | ||
|
||
`--rpc` | ||
Starknet RPC endpoing to use [default: http//localhost:5050] | ||
|
||
`-m, --manifest <MANIFEST>` | ||
Specify a local manifest to initialize from | ||
|
||
`-d, --database-url <DATABASE_URL>` | ||
Database URL (read more above) [default: sqlite::memory:] | ||
|
||
`-s, --start-block <START_BLOCK>` | ||
Specify a block to start indexing from, ignored if stored head exists [default: 0] | ||
|
||
`-h, --help` | ||
Print help | ||
|
||
`-V, --version` | ||
Print version |