You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ docker-compose.yaml file for automatic deployment of a database).
28
28
29
29
### Configuration
30
30
31
-
The configuration is read from a `toml` file. Config file can be specified using the command line parameter `--config`, e.g., `./flare-ftso-indexer --config config.toml`.
31
+
The configuration is read from a `toml` file. Config file can be specified using the command line parameter `--config`, e.g., `./flare-cchain-indexer --config config.toml`.
32
32
The default config file name is `config.toml`.
33
33
Use [`config.example.toml`](config.example.toml) as the single config template. It includes full mode/indexer/db/chain/logger/timeout examples and comments.
34
34
@@ -37,6 +37,14 @@ Use [`config.example.toml`](config.example.toml) as the single config template.
37
37
-`indexer.mode = "fsp"`: use this when running as part of the FSP provider stack. Required FSP transactions/logs are hardcoded and auto-applied, so you do not need to specify `[[indexer.collect_transactions]]` or `[[indexer.collect_logs]]` in config (you can still add extra entries; they are merged and deduplicated). FSP startup also does selective indexing for required reward-epoch metadata windows instead of blindly indexing full historical ranges, which makes startup significantly faster. In this mode, `indexer.start_index` and `db.history_drop` are ignored; retention is derived from `indexer.history_epochs`.
38
38
-`indexer.mode = "full"`: use this for a generic C-chain indexer. In this mode you should define what to index via `[[indexer.collect_transactions]]` and `[[indexer.collect_logs]]`.
39
39
40
+
#### Contract addressing
41
+
42
+
Contracts in `[[indexer.collect_transactions]]` and `[[indexer.collect_logs]]` can be specified either by `contract_address = "0x..."` or by `contract_name = "FlareSystemsManager"`. When a name is provided, the indexer resolves it to an address at startup via the on-chain ContractRegistry, so addresses that differ across networks (or change between deployments) do not need to be hardcoded in config. FSP mode's built-in collectors all use name-based resolution.
43
+
44
+
#### Startup and history (full mode)
45
+
46
+
The behavior described in this section applies to **full mode** only. FSP mode derives its start block and retention from `indexer.history_epochs`, and ignores both `indexer.start_index` and `db.history_drop`.
47
+
40
48
If the C chain indexer has been previously run and there is existing data in the database,
41
49
subsequent runs will resume indexing from after the last indexed block. Only when starting with an
42
50
empty database will the indexer have to decide where to start. Normally this will be based on the
@@ -71,8 +79,8 @@ go run ./cmd/indexer --config config.toml
71
79
or build and run the binaries with
72
80
73
81
```bash
74
-
go build -o flare-ftso-indexer ./cmd/indexer
75
-
./flare-ftso-indexer --config config.toml
82
+
go build -o flare-cchain-indexer ./cmd/indexer
83
+
./flare-cchain-indexer --config config.toml
76
84
```
77
85
78
86
### Health endpoint
@@ -113,7 +121,7 @@ go tool cover -html=coverage.out
113
121
114
122
### Benchmarks
115
123
116
-
File `benchmarks/songbird_test.go` contains a benchmark test for indexing the FTSO protocol on the Songbird network. It processes 10,000 blocks and analyzes them. The test configuration is specified in `benchmarks/config_banchmark.toml`. To run the benchmark (replacing 10x with any desired number of repetitions), use:
124
+
File `benchmarks/songbird_test.go` contains a benchmark test for indexing the FTSO protocol on the Songbird network. It processes 10,000 blocks and analyzes them. The test configuration is specified in `benchmarks/config_benchmark.toml`. To run the benchmark (replacing 10x with any desired number of repetitions), use:
117
125
118
126
```bash
119
127
go test -benchmem -run=^$ -benchtime 10x -bench ^BenchmarkBlockRequests$ ./benchmarks
Copy file name to clipboardExpand all lines: config.example.toml
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,10 @@ stop_index = 0 # stop block; set 0 to index indefinitely
5
5
history_epochs = 0# FSP mode only: 0=last 2 hours, >0=number of reward epochs to keep/index from
6
6
num_parallel_req = 100# number of parallel requests to the chain
7
7
batch_size = 1000# the number of blocks that will be pushed to a database in a batch (should be divisible by num_parallel_req)
8
-
log_range = 10#the size of the interval of blocks used to request logs in each request; suggested value is log_range = batch_size / num_parallel_req; note that a blockchain node might have an upper bound on this
8
+
log_range = 1024#max blocks per eth_getLogs request; set to your RPC's getLogs cap (typically 100-10000)
9
9
new_block_check_millis = 1000# interval for checking for new blocks
10
10
confirmations = 1# number of confirmations for latest block queries
11
11
no_new_blocks_delay_warning = 60# max allowed delay between consecutive processed blocks before warning; 0 disables warning
0 commit comments