forked from 0xProject/rpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add multiple rate limited auth tokens
- Loading branch information
Showing
12 changed files
with
291 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,3 @@ | |
|
||
.idea | ||
|
||
config.json | ||
config_* | ||
|
||
prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"metrics": { | ||
"port": 9090 | ||
}, | ||
"port": 4000, | ||
"gateways": [ | ||
{ | ||
"configFile": "/app/config_holesky.json", | ||
"name": "Holesky gateway" | ||
}, | ||
{ | ||
"configFile": "/app/config_sepolia.json", | ||
"name": "Sepolia gateway" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "Holesky", | ||
"proxy": { | ||
"path": "holesky", | ||
"upstreamTimeout": "1s" | ||
}, | ||
"healthChecks": { | ||
"interval": "20s", | ||
"timeout": "1s", | ||
"failureThreshold": 2, | ||
"successThreshold": 1 | ||
}, | ||
"targets": [ | ||
{ | ||
"name": "ChainSafe", | ||
"connection": { | ||
"http": { | ||
"url": "https://lodestar-holeskyrpc.chainsafe.io/" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Tenderly", | ||
"connection": { | ||
"http": { | ||
"url": "https://holesky.gateway.tenderly.co" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "Sepolia", | ||
"proxy": { | ||
"path": "sepolia", | ||
"upstreamTimeout": "1s" | ||
}, | ||
"healthChecks": { | ||
"interval": "20s", | ||
"timeout": "1s", | ||
"failureThreshold": 2, | ||
"successThreshold": 1 | ||
}, | ||
"targets": [ | ||
{ | ||
"name": "ChainSafe", | ||
"connection": { | ||
"http": { | ||
"url": "https://lodestar-sepoliarpc.chainsafe.io" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Tenderly", | ||
"connection": { | ||
"http": { | ||
"url": "https://sepolia.gateway.tenderly.co" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
services: | ||
rpc-gateway: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- 8080:4000 # Main port | ||
- 9090:9090 # Metrics port | ||
volumes: | ||
- ./config.json:/app/config.json:ro | ||
- ./config_sepolia.json:/app/config_sepolia.json:ro | ||
- ./config_holesky.json:/app/config_holesky.json:ro | ||
environment: | ||
- GATEWAY_TOKEN_MAP={"token1":{"name":"token1","numOfRequestPerSec":10},"token2":{"name":"token2","numOfRequestPerSec":20}} | ||
user: nobody | ||
entrypoint: ["/app/rpc-gateway", "--config", "/app/config.json", "--auth"] | ||
networks: | ||
- app-network | ||
|
||
prometheus: | ||
image: prom/prometheus:v2.44.0 | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
ports: | ||
- "9091:9090" # Changed to 9091 on the host | ||
networks: | ||
- app-network | ||
|
||
grafana: | ||
image: grafana/grafana:latest | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- grafana-storage:/var/lib/grafana | ||
environment: | ||
- GF_SECURITY_ADMIN_PASSWORD=admin | ||
depends_on: | ||
- rpc-gateway | ||
networks: | ||
- app-network | ||
|
||
volumes: | ||
grafana-storage: | ||
|
||
networks: | ||
app-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.