Skip to content

Commit eaaa92b

Browse files
committed
v0.3.0
1 parent 57452d0 commit eaaa92b

3 files changed

Lines changed: 52 additions & 28 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ jobs:
6666
You will need to set up the database for the indexer, check the docs for more information.
6767
When you have the database running run the cmd to create the database and the user.
6868
```bash
69-
go run cmd/setup.go create-db --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --new-db-name gnoland --chain-name gnoland
70-
go run cmd/setup.go create-user --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --user writer --privilege writer
69+
indexer setup create-db --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --new-db-name gnoland --chain-name gnoland
70+
indexer setup create-user --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --user writer --privilege writer
7171
```
7272
7373
From here you can run the indexer using live or historic mode
7474
```bash
75-
./indexer live --config config.yml
76-
./indexer historic --config config.yml --from-height 1000 --to-height 2000
75+
./indexer run live --config config.yml
76+
./indexer run historic --config config.yml --from-height 1000 --to-height 2000
7777
```
7878
7979
For more information check the docs.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.0] - 2025-11-10
9+
10+
In this release there are some fixes and improvements. The live process should work properly now and the REST API has some new routes. CLI commands are now combined with the ones from the setup cli. Some processes have been improved to use less memory.
11+
12+
### Added
13+
14+
- The REST API has some new routes. The API can now return last block height, last number(x) of blocks, last x transactions. [789c24b](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/789c24b18881cd33758677f8b878aff7bb42f9dc)
15+
16+
### Changed
17+
18+
- The CLI commands are now combined all together so the cmd/setup.go is removed and the users can now only download the main cli and initiate everything they needs for the indexer to work. [805513b](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/805513b20fdd4f452e8d6f5ad6d56d318e78d5d9)
19+
- Changed the data and query operators to use mutex and store any data they process/collect directly into the type they need to return. There shouldn't be any major preformance difference but it should alocate less memory. [89e5b6d](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/89e5b6d103710970cbe69c02865bb4b0727649b3)
20+
21+
### Fixed
22+
23+
- When Indexer started to run in live mode without any previous data it should start tho prcess the data from frist block height. But instead it tried to query block height 0. [3517e5a](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/3517e5aec32a21d70f43b0595d842841098a4c47)
24+
825
## [0.2.1] - 2025-10-06
926

1027
Not really much of a change just added dockerignore file, small changes to the release.yml so it pushes the api also.

docs/setup.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,32 @@ The important thing to setup is the database connections. The indexer can do goo
4242
However if you are planning to add a lot of services a top of the database maybe increase it. The docker compose is
4343
set to 500 connections.
4444

45-
For creating all of the necessary tables and types you can use the setup.go file in the cmd directory.
46-
The cmd has two commands to create the database and the user:
45+
For creating all of the necessary tables and types you can use the indexer executable and the setup command.
46+
The cmd has 3 commands to create the database and the user:
4747

4848
```bash
49-
collection of tools to set up and manage the database for the gnoland indexer.
49+
A collection of tools to set up and manage the database for the gnoland indexer.
5050

5151
Usage:
52-
setup [command]
52+
indexer setup [command]
5353

5454
Available Commands:
55-
completion Generate the autocompletion script for the specified shell
56-
create-db Create a new database named gnoland
57-
create-user Create a new user for the database
58-
help Help about any command
55+
create-config Generate a config with default values.
56+
create-db Create a new database named gnoland
57+
create-user Create a new user for the database
5958

6059
Flags:
6160
-h, --help help for setup
61+
62+
6263
```
6364

6465
To use all of these commands you will need a user with admin privileges.
6566
In the example below the user is postgres you will be asked for the password.
6667
To create the database you can use the following command:
6768

6869
```bash
69-
go run cmd/setup.go create-db --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --new-db-name gnoland --chain-name gnoland
70+
indexer setup create-db --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --new-db-name gnoland --chain-name gnoland
7071
```
7172

7273
To create the users for the database you can use the following command.
@@ -76,7 +77,7 @@ The privilege level can be "reader" or "writer". The reader should have only the
7677
The writer should have the select, insert, update and privileges.
7778

7879
```bash
79-
go run cmd/setup.go create-user --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --user writer --privilege writer
80+
indexer setup create-user --db-host localhost --db-port 5432 --db-user postgres --db-name postgres --ssl-mode disable --user writer --privilege writer
8081
```
8182

8283
## Running the indexer
@@ -86,25 +87,23 @@ The indexer can be ran in 2 modes: live and historic.
8687
Now when you have the database running you can actually run the indexer. The indexer has a lot of flags that can be used to configure it:
8788

8889
```bash
89-
A blockchain indexer for Gnoland that processes blocks and transactions.
90+
Run the indexer in either live or historic mode.
9091

9192
Usage:
92-
indexer [command]
93+
indexer run [command]
9394

9495
Available Commands:
95-
completion Generate the autocompletion script for the specified shell
96-
help Help about any command
9796
historic Run the indexer in historic mode
9897
live Run the indexer in live mode
9998

10099
Flags:
101100
-e, --compress-events compress events
102101
-c, --config string config file path (default "config.yml")
103-
-h, --help help for indexer
102+
-h, --help help for run
104103
-m, --max-req-per-window int max requests per window (default 10000000)
105104
-r, --rate-limit-window duration rate limit window (default 1m0s)
106105
-t, --timeout duration timeout (default 20s)
107-
-v, --version version for indexer
106+
108107
```
109108

110109
Compress events doesn't work at the moment so do not use it!
@@ -114,6 +113,14 @@ The max request per window is rated to the max request that can be made to the R
114113
The timeout is the timeout for the RPC requests. The default is 20 seconds. You can set it to lower if you want.
115114

116115
The config file is needed to configure the indexer. You can use the config.yml.example file as a template.
116+
Or use the create-config command to create a config file with default values.
117+
118+
```bash
119+
indexer setup create-config --config config.yml
120+
```
121+
122+
The config file is a YAML file that contains the configuration for the indexer.
123+
117124
```yaml
118125
# Example config file for the indexer
119126

@@ -169,7 +176,7 @@ exponential_backoff: 2s
169176
170177
To run the indexer in historic mode you can use the following command:
171178
```bash
172-
indexer historic --config config.yml --from-height 1000 --to-height 2000
179+
indexer run historic --config config.yml --from-height 1000 --to-height 2000
173180
```
174181
The from height is the starting height of the block to index. The to height is the ending height of the block to index.
175182
The indexer will index the blocks from the from height to the to height inclusive. You can also add the other flags
@@ -185,7 +192,7 @@ It can also be useful if you want to index blockchain partially and work with da
185192
or partial scan of the chain where you want to index from a certain height to a certain height.
186193

187194
Usage:
188-
indexer historic [flags]
195+
indexer run historic [flags]
189196

190197
Flags:
191198
-f, --from-height uint starting block height (default 1)
@@ -202,7 +209,7 @@ Global Flags:
202209
203210
To run the indexer in live mode you can use the following command:
204211
```bash
205-
indexer live --config config.yml
212+
indexer run live --config config.yml
206213
```
207214
Live mode flags:
208215
```bash
@@ -214,7 +221,7 @@ However if you do not need previous data, you can run the live mode with the ski
214221
Afterwards you can run live mode normal without the skip-db-check flag.
215222

216223
Usage:
217-
indexer live [flags]
224+
indexer run live [flags]
218225

219226
Flags:
220227
-h, --help help for live
@@ -258,16 +265,16 @@ Like mentioned above you can use the docker-compose.yml file to setup the databa
258265
If you plan to run the indexer over docker you can use this commands:
259266
```bash
260267
# Live mode with custom config
261-
docker run gnoland-indexer live --config /path/to/config.yml --skip-db-check
268+
docker run gnoland-indexer run live --config /path/to/config.yml --skip-db-check
262269
263270
# Historic mode
264-
docker run gnoland-indexer historic --from-height 1000 --to-height 2000
271+
docker run gnoland-indexer run historic --from-height 1000 --to-height 2000
265272
266273
# Show all available commands
267274
docker run gnoland-indexer --help
268275
269276
# Show help for specific command
270-
docker run gnoland-indexer live --help
277+
docker run gnoland-indexer run live --help
271278
```
272279
273280
You can also run the indexer with something like systemd:
@@ -277,7 +284,7 @@ Description=Gnoland Indexer
277284
After=network.target
278285
279286
[Service]
280-
ExecStart=/path/to/indexer live --config /path/to/config.yml
287+
ExecStart=/path/to/indexer run live --config /path/to/config.yml
281288
Restart=always
282289
RestartSec=5
283290
User=$USER

0 commit comments

Comments
 (0)