According to task description, there should be 3 services.
But the project consists of two different components. (See branch v2 for separate service implementation)
- Service (2 instances): A server that listens on a port and handles RPC calls.
- Collector (1 instance): A service that makes concurrent calls to the RPC services and gathers data from them.
- Go 1.22
- Docker(with compose)
Clone the repo:
git clone https://github.com/behnambm/data-collector.gitcd data-collectorYou'll need 3 separate terminal windows or tabs to run the services.
Run service 1:
make svc1Run service 2:
make svc2Run service 3:
make svc3After running Service 3, a database.sqlite file will be created to store the results.
You'll need 2 separate terminal windows or tabs to run the services.
make upmake svc3- Both approaches use the default configurations found in the
configsdirectory. You can modify these configurations as needed. - There are two docker files, the reason for that is the network instability in Iran. One builds the binary during build time, the other one just copies the binary from host.
- The docker files and compose are only written for service 1 & 2.
make test