Skip to content

Commit

Permalink
feat: use histogram (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyWh1te authored Aug 22, 2024
1 parent ee20da6 commit 17178ec
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 21 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 22.06.2024
1. Added DevOps independent consumer
2. Updated readme.md
3. Changed ```request_processing_seconds``` metric type from summary to histogram

## 21.06.2024
1. Added worker for each team

Expand Down
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
# Finding-forwarder
Service forwards findings from forta-local-node to telegram, opsGenia and discord

## How to use the template
1. Clone repository
## How to develop
1. Install go1.22.3+
2. cd root repository
3. make tools
4. make vendor
5. copy `sample.env` to `.env`
6. docker-compose up -d
7. make build
8. Run service ./bin/service
6. clone https://github.com/lidofinance/alerting-forta/
1. cd ethereum-steth
2. make steth
7. clone https://github.com/forta-network/forta-node/
1. cd forta-node
2. make containers
8. Go back to current project then docker-compose up -d

## Where I have to start to code my custom logic?
* [Register handler](./internal/app/server/routes.go)
* [Logic layer](./internal/pkg/telegram): /internal/pkg/your_package_name/. Just see an example with [User package](./internal/pkg/telegram)
* [Env](./internal/env/env.go)
* [Connecters](./internal/connectors) pg, logger, redis and etc...
* For external clients you have to create folder in ./internal/clients/<your_client_name>/client.go where your_client_name - is google_client, alchemy or internal client for private network.
### I dont need steth-bot. What I have to do?
1. comment service-ethereum-steth in docker-compose file
2. on your local host in your bot repo - ```yarn start```
3. Also, you have to provide the container name of your bot to FORTA-SOFTWARE by analogy with steth:
1. Container name for steth is **ethereum-steth** look docker-compose file
2. put bot's container name to the file forta-local-config.yml by analogy with steth
3. Consider that in app has programmed consumer for your team bot or use fallback consumer
(provider any name that not included in the list internal/utils/registry/registry.go)

### I want to develop finding-forwarder server or worker
1. comment forwarder-server or forwarder-worker in docker-compose file
2. provide env variable for application that it could connect to nats in docker

## Docs and rules
1. [App structure layout](./docs/structure.md)
2. [Code style](./docs/code_style.md)

## Current drivers or dependencies

1. Logger - [Logrus](https://github.com/sirupsen/logrus)
2. Mockery [Mockery](https://github.com/vektra/mockery)
3. Http router [go-chi](https://github.com/go-chi/chi)
4. Env reader [Viper](https://github.com/spf13/viper)
2. [Code style](./docs/code_style.md)
19 changes: 18 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
depends_on:
- service-forta-nats
- service-forta-json-rpc
- service-ethereum-steth

forwarder-server:
container_name: finding-forwarder-server
Expand Down Expand Up @@ -87,4 +88,20 @@ services:
- NATS_DEFAULT_URL=${NATS_DEFAULT_URL}
- BOT_CONTAINERS=${BOT_CONTAINERS}
ports:
- '8081:8080'
- '8081:8080'

service-ethereum-steth:
container_name: ethereum-steth
logging: *default-logging
image: monitoring/steth:latest
restart: unless-stopped
environment:
- APP_NAME=ethereum-steth
- INSTANCE=forta-local-host
- ETHEREUM_RPC_URL=http://forta-json-rpc:8545
- USE_FORTA_RPC_URL=false
- NODE_ENV=production
depends_on:
- service-forta-json-rpc
ports:
- '3000:3000'
3 changes: 2 additions & 1 deletion forta-local-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ localMode:
standalone:
enable: true
botContainers:
- host.docker.internal
- host.docker.internal
- ethereum-steth

0 comments on commit 17178ec

Please sign in to comment.