Skip to content

Commit 2936ae2

Browse files
committed
refactor: update docs and examples
1 parent 9fc458e commit 2936ae2

File tree

4 files changed

+39
-22
lines changed

4 files changed

+39
-22
lines changed

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Insight
22

3-
Insight is a blockchain data processing tool designed to fetch, process, and store on-chain data. It provides a solution for indexing blockchain data, facilitating efficient querying of transactions, logs through a simple API.
3+
Insight is a blockchain data processing tool designed to fetch, process, and store on-chain data. It provides a solution for indexing blockchain data, facilitating efficient querying of transactions and logs through a simple API.
44

55
Insight's architecture consists of five main components:
66
<img width="728" alt="architecture-diagram" src="https://github.com/user-attachments/assets/8ad19477-c18f-442e-a899-0f502a00bae6">
@@ -15,23 +15,23 @@ Insight's architecture consists of five main components:
1515

1616
5. **Orchestrator**: The Orchestrator is responsible for coordinating and managing the poller, failure recoverer, and committer. It initializes these components based on configuration settings and starts them concurrently, ensuring they run independently while waiting for all of them to complete their tasks.
1717

18-
Insight's modular architecture and configuration options allow for adaptation to various evm chains and use cases.
18+
Insight's modular architecture and configuration options allow for adaptation to various EVM chains and use cases.
1919

2020

2121
## Getting started
2222

2323
### Pre-requites
24-
1. Install Golang v1.23
25-
2. Run the DB scripts (change the db name)
26-
3. Create a clickhouse instance
24+
1. Golang v1.23
25+
2. Clickhouse instance (`docker-compose` includes it for local development)
2726

2827
### Usage
2928
To run insight and the associated API, follow these steps:
3029
1. Clone the repo
3130
```
3231
git clone https://github.com/thirdweb-dev/insight.git
3332
```
34-
2. Run the migration scripts here
33+
2. ~~Run the migration scripts here~~
34+
2. Apply the migrations from [here](internal/tools/)
3535
3. Create `config.yml` from `config.example.yml` and set the values by following the [config guide](#supported-configurations)
3636
4. Create `secrets.yml` from `secrects.example.yml` and set the needed credentials
3737
5. Build an instance
@@ -383,26 +383,37 @@ failureRecoverer:
383383
```
384384

385385
#### Storage
386-
This application has 3 kinds of strorage. Main, Staging and Orchestrator.
387-
Each of them takes similar configuration depending on the driver you want to use.
388-
386+
This application has 3 kinds of storage: `main`, `staging` and `orchestrator`.
387+
Each of them takes similar configuration, slightly depending on the driver you want to use.
389388
There are no defaults, so this needs to be configured.
390389

390+
For example, this can be a part of `config.yml`:
391391
```yaml
392392
storage:
393393
main:
394-
driver: "clickhouse"
395394
clickhouse:
396-
host: "localhost"
397395
port: 3000
398-
user: "admin"
399-
password: "admin"
400396
database: "base"
401-
disableTLS: false
397+
disableTLS: true
402398
staging:
403-
driver: "memory"
404-
memory:
405-
maxItems: 1000000
399+
clickhouse:
400+
port: 3000
401+
database: "staging"
406402
orchestrator:
407-
driver: "memory"
403+
memory:
404+
maxItems: 10000
405+
```
406+
With the corresponding `secrets.yml`:
407+
```yaml
408+
storage:
409+
main:
410+
clickhouse:
411+
host: localhost
412+
user: admin
413+
password: password
414+
staging:
415+
clickhouse:
416+
host: localhost
417+
username: admin
418+
password: password
408419
```

configs/config.example.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ storage:
3333
main:
3434
clickhouse:
3535
port: 9440
36-
database: "base"
36+
database: "default"
37+
disableTLS: true
3738
staging:
3839
clickhouse:
3940
port: 9440
40-
database: "staging"
41+
database: "default"
42+
disableTLS: true
4143
orchestrator:
4244
memory:
4345
maxItems: 10000

configs/secrets.example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ storage:
66
clickhouse:
77
host: localhost
88
username: admin
9-
password: admin
9+
password: password
1010
staging:
1111
clickhouse:
1212
host: localhost
1313
username: admin
14-
password: admin
14+
password: password

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ services:
1717
- "9440:9000"
1818
volumes:
1919
- clickhouse_data:/var/lib/clickhouse
20+
environment:
21+
CLICKHOUSE_DB: default
22+
CLICKHOUSE_USER: admin
23+
CLICKHOUSE_PASSWORD: password
2024
ulimits:
2125
nofile:
2226
soft: 262144

0 commit comments

Comments
 (0)