Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup #1

Merged
merged 8 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
push:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- "Cargo.toml"
- "Cargo.lock"
jobs:
security_audit:
runs-on: zondax-runners
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: zondax-runners
steps:
- name: Install dependencies
run: |
run: |
sudo apt-get update
sudo apt-get install -y curl protobuf-compiler build-essential

Expand All @@ -25,7 +25,7 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: build
run: |
run: |
protoc --version
cargo build --all-features

Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: zondax-runners
steps:
- name: Install dependencies
run: |
run: |
sudo apt-get update
sudo apt-get install -y curl protobuf-compiler build-essential

Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: zondax-runners
steps:
- name: Install dependencies
run: |
run: |
sudo apt-get update
sudo apt-get install -y curl protobuf-compiler build-essential

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- 5432:5432
steps:
- name: Install dependencies
run: |
run: |
sudo apt-get update
sudo apt-get install -y curl protobuf-compiler build-essential pkg-config libssl-dev

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ benchmarks: download-checksum
compose:
docker compose -f contrib/docker-compose.yaml up

compose-build:
docker compose -f contrib/docker-compose.yaml up --build -d
docker compose -f contrib/docker-compose.yaml logs -f --tail 100

test: download-checksum
cargo test save_block -- --nocapture
cargo test block_tests -- --nocapture
2 changes: 1 addition & 1 deletion README.earthly.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Install earthly from [here](https://earthly.dev/get-earthly)

## Running

If you have WARP access, you can speed up your builds by defining:
If you have WARP access, you can speed up your builds by defining:

```bash
export EARTHLY_BUILDKIT_HOST=tcp://buildkit.zondax.dev:8372
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ The project is composed of 2 entities : the `indexer` and the `server`. They are

- the `indexer`: This component establishes a connection to the Namada node via RPC and collects blocks and transactions. It then stores this data in a PostgreSQL database. The indexer operates independently of the server and can be initiated on its own.

- the `server`: This is a JSON-based server that facilitates querying of blocks and transactions using unique identifiers. It also provides additional useful endpoints, such as `/blocks/latest`. A comprehensive list of all endpoints, along with their descriptions, is available in the documentation.
- the `server`: This is a JSON-based server that facilitates querying of blocks and transactions using unique identifiers. It also provides additional useful endpoints, such as `/blocks/latest`. A comprehensive list of all endpoints, along with their descriptions, is available in the documentation.

These services require a connection to a [postgres](https://www.postgresql.org/) database. Support for [OpenTelemetry](https://opentelemetry.io/) has also been added.


## Documentation

You can find more information about the indexer in the [`./docs`](./docs/) folder.
Expand All @@ -36,27 +35,33 @@ $ make install-deps
### Start developping

Start the docker database :

```
$ make postgres
```

You will need to use this command if you want to avoid issues with protoc.

```
$ make run
```

## Telemetry

Run jaeger in background

```
$ docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest
```

Start the indexer

```
$ RUST_LOG=trace cargo run --bin indexer
```

View spans

```
$ firefox http://localhost:16686/
```
1 change: 1 addition & 0 deletions config/Settings.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ host = "localhost"
user = "postgres"
password = "wow"
dbname = "blockchain"
port=5432
# Optional field to configure a timeout if database connection
# fails.
connection_timeout = 20
Expand Down
8 changes: 4 additions & 4 deletions contrib/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '3'
version: "3"
services:
postgres:
image: postgres:14
container_name: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: wow
POSTGRES_DB: blockchain
POSTGRES_DB: blockchain
ports:
- "5432:5432"

Expand All @@ -30,8 +30,8 @@ services:
- RUST_LOG="namadexer=debug"
- INDEXER_CONFIG_PATH=/app/config/Settings.toml
volumes:
- ../config:/app/config
- ${PWD}/checksums.json:/app/checksums.json
- ../config:/app/config
- ${PWD}/checksums.json:/app/checksums.json
ports:
- "30303:30303"
depends_on:
Expand Down
15 changes: 7 additions & 8 deletions contrib/helm/indexer-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ deployment:
# Mount path for Volumes
volumeMounts:
app-setting:
mountPath: /app/config
mountPath: /app/config

service:
enabled: true
Expand All @@ -65,7 +65,7 @@ configMap:
Settings.toml: |
log_level = "info"
network = "public-testnet-14"

[database]
host = "database url"
user = "postgres"
Expand All @@ -74,21 +74,20 @@ configMap:
# Optional field to configure a timeout if database connection
# fails.
connection_timeout = 20


[server]
serve_at = "0.0.0.0"
port = 30303

[indexer]
tendermint_addr = "tendermint namada node url"

[jaeger]
enable = false
host = "localhost"
port = 6831

[prometheus]
host = "0.0.0.0"
port = 9000

13 changes: 6 additions & 7 deletions contrib/helm/server-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ configMap:
Settings.toml: |
log_level = "info"
network = "public-testnet-14"

[database]
host = "database url"
user = "postgres"
Expand All @@ -75,21 +75,20 @@ configMap:
# Optional field to configure a timeout if database connection
# fails.
connection_timeout = 20


[server]
serve_at = "0.0.0.0"
port = 30303

[indexer]
tendermint_addr = "tendermint namada node url"

[jaeger]
enable = false
host = "localhost"
port = 6831

[prometheus]
host = "0.0.0.0"
port = 9000

13 changes: 6 additions & 7 deletions contrib/prometheus-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
version: '3.8'
version: "3.8"
services:

# services for monitoring
# comment services below if you don't need monitoring
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
ports:
- '9090:9090'
- "9090:9090"
network_mode: "host"
volumes:
- ../monitoring/prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.external-url=http://localhost:9090'
- "--config.file=/etc/prometheus/prometheus.yml"
- "--web.external-url=http://localhost:9090"

grafana:
image: grafana/grafana:latest
container_name: grafana
user: "472:472"
restart: always
ports:
- '3000:3000'
- "3000:3000"

network_mode: "host"
volumes:
Expand All @@ -48,7 +47,7 @@ services:
container_name: cadvisor
restart: always
ports:
- '8080:8080'
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
Expand Down
12 changes: 6 additions & 6 deletions docs/01-index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Documentation

This is the documentation for the Namada Indexer.
This is the documentation for the Namada Indexer.

* [overview](./02-overview.md)
* [indexer](./03-indexer.md)
* [server](./04-server.md)
* [deployment](./05-deployment.md)
* [telemetry](./06-telemetry.md)
- [overview](./02-overview.md)
- [indexer](./03-indexer.md)
- [server](./04-server.md)
- [deployment](./05-deployment.md)
- [telemetry](./06-telemetry.md)
Loading
Loading