Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tufanbarisyildirim committed Jan 22, 2024
1 parent edb1f5f commit 6d6dafb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Check

on:
push:
branches: [main]
branches: [ main ]
pull_request:
branches: [main]
branches: [ main ]

jobs:

Expand Down
1 change: 1 addition & 0 deletions GRANTS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# rpc.ag grants

Grants and all other details will be listed here.
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ observability by using rpc.ag as the homepage of DApp blockchain infrastructure.
providers.

## Architecture

The architecture of the RPC aggregator with load balancing is shown in the following flowchart:

```mermaid
Expand All @@ -31,7 +32,6 @@ flowchart LR

if you are curious about details


## Short-Term TODO

- [x] Implement rate limiting
Expand All @@ -56,7 +56,7 @@ if you are curious about details
- [ ] Include information on how to use the RPC Aggregator.
- [ ] Build an uptime page for transparency and accountability.
- [ ] Show fastest & most available node providers with uptime history
- [ ] Show average ping time with ability of filtering by provider and region
- [ ] Show average ping time with ability of filtering by provider and region

### Phase 2: Prometheus Exporter and Grafana Dashboards

Expand All @@ -69,7 +69,6 @@ if you are curious about details
- Integrate the monitoring system with the uptime page to display real-time health and performance metrics.
- Allow users to subscribe alerts for downtime or performance issues.


### Phase 4: Become the home page of blockchain infrastructure

- Yes.
Expand Down Expand Up @@ -97,27 +96,31 @@ request with your changes. Be sure to include unit tests and adhere to the proje
Makefile Overview
-----------------

This project uses a Makefile to manage different actions related to the project, including building, running, testing, checking, creating a Docker image, running a Docker container, and cleaning. The following is a brief overview of each target in the Makefile:

- `build`: builds the project using the `go build` command and generates the binary file in the `bin/` directory
- `run`: runs the binary file generated by the `build` target and passes the configuration file as an argument
- `runp`: runs the binary file generated by the `build` target with a private configuration file located in the `_private/` directory
- `test`: tests the project using the `go test` command
- `check`: runs various checks on the project, including verifying the module dependencies, building, vetting, and linting the code
- `image`: builds a Docker image of the project using the `docker build` command
- `run-docker`: runs a Docker container of the project using the `docker run` command and maps port 8080
- `clean`: removes the binary file and the `bin/` directory
This project uses a Makefile to manage different actions related to the project, including building, running, testing,
checking, creating a Docker image, running a Docker container, and cleaning. The following is a brief overview of each
target in the Makefile:

- `build`: builds the project using the `go build` command and generates the binary file in the `bin/` directory
- `run`: runs the binary file generated by the `build` target and passes the configuration file as an argument
- `runp`: runs the binary file generated by the `build` target with a private configuration file located in
the `_private/` directory
- `test`: tests the project using the `go test` command
- `check`: runs various checks on the project, including verifying the module dependencies, building, vetting, and
linting the code
- `image`: builds a Docker image of the project using the `docker build` command
- `run-docker`: runs a Docker container of the project using the `docker run` command and maps port 8080
- `clean`: removes the binary file and the `bin/` directory

Usage
-----

1. Build the project using the `make build` command
2. Run the project using the `make run` or `make runp` command
3. Test the project using the `make test` command
4. Check the project using the `make check` command
5. Build a Docker image of the project using the `make image` command
6. Run a Docker container of the project using the `make run-docker` command
7. Clean the project using the `make clean` command
1. Build the project using the `make build` command
2. Run the project using the `make run` or `make runp` command
3. Test the project using the `make test` command
4. Check the project using the `make check` command
5. Build a Docker image of the project using the `make image` command
6. Run a Docker container of the project using the `make run-docker` command
7. Clean the project using the `make clean` command

Note: Some Makefile targets require the `go`, `docker`, `staticcheck`, and `golint` commands to be installed.

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3.8'

volumes:
prometheus_data: {}
grafana_data: {}
prometheus_data: { }
grafana_data: { }

services:
aggregator:
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import "github.com/valyala/fasthttp"
// Middleware chainable fasthttp middleware func
type Middleware func(next fasthttp.RequestHandler) fasthttp.RequestHandler

//Apply process multiple middleware
// Apply process multiple middleware
func Apply(h fasthttp.RequestHandler, m ...Middleware) fasthttp.RequestHandler {
for i := len(m) - 1; i >= 0; i-- {
h = m[i](h)
}
return h
}

//Onion Onion style middleware
// Onion Onion style middleware
func Onion(m ...Middleware) Middleware {
return func(next fasthttp.RequestHandler) fasthttp.RequestHandler {
return Apply(next, m...)
Expand Down
4 changes: 2 additions & 2 deletions monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ global:
alerting:
alertmanagers:
- static_configs:
- targets: []
- targets: [ ]
scheme: http
timeout: 10s
api_version: v1
Expand All @@ -17,4 +17,4 @@ scrape_configs:
metrics_path: /metrics
scheme: http
static_configs:
- targets: ['aggregator:9000']
- targets: [ 'aggregator:9000' ]

0 comments on commit 6d6dafb

Please sign in to comment.