To set up and run the block fetcher service locally, follow these steps:
- Ensure you have Docker and Docker Compose installed on your machine.
-
Clone the Repository:
git clone <repository-url> cd snapshotter-periphery-blockfetcher
-
Create a
.envFile:- Copy the
.env.examplefile to.envand fill in the necessary environment variables.
cp .env.example .env
- Copy the
-
Build and Start the Services:
- Use Docker Compose to build and start the services. The
localprofile will include the Redis service for local testing.
docker-compose --profile local up --build - Use Docker Compose to build and start the services. The
-
Access Logs:
- Logs are available in the
./logsdirectory. You can also view logs in real-time using:
docker-compose logs -f
- Logs are available in the
-
Shut Down the Services:
- To stop the services, use:
docker-compose down
- The
localprofile includes a Redis service for testing purposes. In production, ensure that your configuration points to an external Redis service. - Ensure that all necessary environment variables are set in the
.envfile for the application to function correctly.