Skip to content

Fast middlewares for Flare (and Avax, and perhaps any other server too) nodes

License

Notifications You must be signed in to change notification settings

LightFTSO/flare-node-proxy

Repository files navigation

Flare Node Proxy

Delegate Github Twitter Telegram Security Linter

Description

This app works as a proxy with public Flare API providers in mind. It includes a middleware that blocks transactions to the PriceSubmitter contract by default. It doesn't modify, record, or do anything with the request other than rejecting transactions to the PriceSubmitter contract (0x1000000000000000000000000000000000000003).

It uses GoFiber's Proxy to forward requests to the specified endpoint, the requests should get there intact, and come back intact too. And it also uses goccy/go-json to make JSON marshalling/unmarshalling faster.

TODO

  • Handle proxy to websockets
  • Fix reading whitelist file from the current running directory, for some reason the watcher doesn't emit events
  • Implement expiration dates for whitelisted addresses

How to use

Start the application

go run app.go --monitor --port :3000 --endpoint http://localhost:9650 --watchlist "/path/to/whitelist/file.json"

Help

go run app.go --help

Use local container

# Clean packages
make clean-packages

# Generate go.mod & go.sum files
make requirements

# Generate docker image
make build

# Generate docker image with no cache
make build-no-cache

# Run the projec in a local container
make up

# Run local container in background
make up-silent

# Run local container in background with prefork
make up-silent-prefork

# Stop container
make stop

# Start container
make start

Production

docker build -t flare-node-proxy .
docker run -d -p 3000:3000 flare-node-proxy ./app -prod -monitor -endpoint http://localhost:9650

About

Fast middlewares for Flare (and Avax, and perhaps any other server too) nodes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published