Finding-Forwarder is a service suite designed to fetch blockchain data, process it, and forward important findings to various notification channels such as Telegram, OpsGenie, and Discord. The suite consists of two main components:
- Feeder: Fetches the latest blockchain data at regular intervals and publishes it to a specific NATS topic.
- Forwarder: Listens to findings from bots, applies quorum and filtering, and forwards critical information to the appropriate notification channels.
This solution serves as an alternative to OpenZeppelin Defender and Forta, providing features such as guaranteed message delivery and findings processing based on quorum.
- Feeder: Fetches blockchain data and publishes it to a NATS topic.
- Forwarder: Receives findings from various bots, processes them, and forwards them to notification channels.
- Configuration: Contains details on how to set up and configure the Finding-Forwarder system.
- notification.prod.sample.yaml: Dynamic notification config
The following graphic represents how the infrastructure is set up on a single virtual machine. In practice, there are three such machines, and quorum is collected 2 out of 3 based on Redis.
+-----------------------------+
| Blockchain |
| (Source of block data) |
+--------------+--------------+
|
v
+-----------------------------+
| Feeder |
| Fetches blockchain data and |
| publishes to NATS topic |
| (e.g., blocks.mainnet.l1) |
+--------------+--------------+
|
v
+-----------------------------+
| NATS Server |
| Manages data communication |
| between components |
+--------------+--------------+
|
v
+-----------------------------+
| Bots |
| Subscribed to block data, |
| process findings and send |
| them to findings.<team>.<bot>|
+--------------+--------------+
|
v
+-----------------------------+
| Forwarder |
| Listens to findings topics, |
| applies quorum and filters, |
| and forwards notifications |
| to configured channels like |
| Telegram, Discord, OpsGenie.|
+--------------+--------------+
|
v
+-----------------------------+
| Redis (Quorum Storage) |
| Ensures that findings are |
| processed only after quorum |
| is reached (e.g., 2 out of 3|
| forwarders must agree). |
| Prevents duplicate sending |
| and ensures consistency. |
+-----------------------------+
- Feeder continuously fetches the latest blockchain data and publishes it to a specific NATS topic.
- Bots subscribe to this topic, process the block data, and send their findings to topics like
findings.<team_name>.<bot_name>. - Forwarder Instances: Forwarders listen to findings topics, process the data, and check for quorum.
- Forwarders use Redis to store quorum-related data, ensuring that findings are only processed after the quorum (e.g., 2 out of 3 forwarders) is reached.
- This mechanism also prevents duplicate sending, as only one instance will proceed once the quorum condition is satisfied.
- Redis helps maintain state consistency, ensuring reliable and fault-tolerant processing of findings across the distributed setup.
To set up a local development environment for Finding-Forwarder, follow these steps:
-
Prerequisites:
- Install
go1.23.1+ - Clone the repository:
git clone <your-repo-url> - Navigate to the root of the repository:
cd finding-forwarder
- Install
-
Install Tools and Dependencies:
make tools make vendor
-
Environment Setup:
-
Copy the
sample.envfile to.env:cp sample.env .env
-
Configure your environment variables as needed. Below is an explanation of the available environment variables:
Variable Description Default Value READ_ENV_FROM_SHELLWhether to read environment variables from the shell (useful for container setups). falseSOURCESource name for identifying where the forwarder is running. localENVThe environment mode of the application. localAPP_NAMEName of the application. finding_forwarderPORTPort on which the application will run. 8080LOG_FORMATLog format ( simpleorjson).simpleLOG_LEVELLog level (e.g., debug,info,warn,error).debugBLOCK_TOPICNATS topic for the Feeder to publish blockchain data. blocks.mainnet.l1NATS_DEFAULT_URLURL for connecting to the NATS server. http://service-forta-nats:4222REDIS_ADDRESSAddress for connecting to the Redis instance. redis:6379REDIS_DBRedis database index to use. 0QUORUM_SIZEThe number of confirmations required before forwarding a message. 1JSON_RPC_URLURL for connecting to the Ethereum JSON-RPC endpoint. https://eth.drpc.org
-
-
Building and Running Bots:
- Clone the Testing Forta Bots repository:
git clone https://github.com/lidofinance/testing-forta-bots/
- Navigate to the
botsdirectory and then into the specific bot you want to build, for example:cd testing-forta-bots/bots/ethereum-steth-v2 - Build the Docker image for the bot:
make generate-docker
- After building the bot, return to the Finding-Forwarder project directory:
- You can now add environment variables for the bot either directly in the
.envfile or pass them through thedocker-compose.ymlfile.
- Clone the Testing Forta Bots repository:
-
Start Services Using Docker Compose:
docker-compose up -d
- comment forwarder-server or forwarder-worker in docker-compose file
- provide env variable for application that it could connect to nats in docker
- provide some bot for your purposes or run bot on local machine not in docker container

