MvProxy is a reverse proxy specifically designed for Mavryk nodes, offering a range of features that enhance node performance, security, and manageability.
- Rate limit
- Block IPs
- Blocklist routes
- Cache
- CORS
- GZIP
- Metrics
- Redis
Make sure that your Mavryk Node is running and set its host address in the mavryk_host configuration.
If you want to test only MvProxy without a real Mavryk Node, you can simulate a Mavryk Node with our flextesa.sh script. Make sure that you have a docker.
./flextesa.shIf you want custom configurations, create a file named as mvproxy.yaml in the same directory of the binary. This file will be created if you don't create it.
Then, just download the binary and run it:
./mvproxyFinally, test it with:
curl http://localhost:8080/chains/main/blocks/head/headerHere a default mvproxy.yaml file:
allow_routes:
enabled: true
values:
- GET/chains/.*/blocks
- GET/chains/.*/chain_id
- GET/chains.*/checkpoint
- GET/chains/.*/invalid_blocks
- GET/chains.*/invalid_blocks.*
- GET/chains/.*/is_bootstrapped
- GET/chains.*/mempool/filter
- GET/chains/.*/mempool/monitor_operations
- GET/chains/.*/mempool/pending_operations
- GET/config/network/user_activated_protocol_overrides
- GET/config/network/user_activated_upgrades
- GET/config/network/dal
- GET/describe.*
- GET/errors
- GET/monitor.*
- GET/network/greylist/ips
- GET/network/greylist/peers
- GET/network/self
- GET/network/stat
- GET/network/version
- GET/network/versions
- GET/protocols
- GET/protocols.*
- GET/protocols.*/environment
- GET/version
- POST/chains/.*/blocks/.*/helpers
- POST/chains/.*/blocks/.*/script
- POST/chains/.*/blocks/.*/context/contracts.*/big_map_get
- POST/injection/operation
cache:
disabled_routes:
- GET/monitor/.*
- GET/chains/.*/mempool
- GET/chains/.*/blocks.*head
enabled: true
size_mb: 100
ttl: 5
cors:
enabled: true
allow_headers:
- '*'
allow_origins:
- '*'
allow_methods:
- GET
- POST
- OPTIONS
deny_ips:
enabled: false
values: []
deny_routes:
enabled: true
values:
- GET/workers.*
- GET/worker.*
- GET/stats.*
- GET/chains/.*/blocks/.*/helpers/baking_rights
- GET/chains/.*/blocks/.*/helpers/endorsing_rights
- GET/helpers/baking_rights
- GET/helpers/endorsing_rights
- GET/chains/.*/blocks/.*/context/contracts(/?)$
- GET/chains/.*/blocks/.*/context/raw/bytes
- POST/injection/block
- POST/injection/protocol
dev_mode: false
gc:
optimize_memory_store: true
percent: 100
gzip:
enabled: true
host: 0.0.0.0:8080
load_balancer:
ttl: 600
logger:
bunch_size: 1000
pool_interval_seconds: 1
metrics:
enabled: true
host: 0.0.0.0:9000
pprof: false
rate_limit:
enabled: false
max: 300
minutes: 1
redis:
enabled: false
host: ""
mavryk_host:
- 127.0.0.1:8732
mavryk_host_retry: ""You can also configure or overwrite MvProxy with environment variables, using the same structure:
MVPROXY_DEV_MODEis a flag to enable dev features like pretty logger.MVPROXY_HOSTis the host of the proxy.MVPROXY_MAVRYK_HOSTare the hosts of the mavryk nodes.MVPROXY_MAVRYK_HOST_RETRYis the host used when finding a 404 or 410. It's recommended use full or archive nodes.MVPROXY_REDIS_HOSTis the host of the redis.MVPROXY_REDIS_ENABLEis a flag to enable redis.MVPROXY_LOAD_BALANCER_TTLis the time to live to keep using the same node by user IP.MVPROXY_LOGGER_BUNCH_SIZEis the bunch size of the logger.MVPROXY_LOGGER_POOL_INTERVAL_SECONDSis the pool interval of the logger.MVPROXY_CACHE_ENABLEDis the flag to cache enable cache.MVPROXY_CACHE_DISABLED_ROUTESis the variable with the routes to cache.MVPROXY_CACHE_SIZE_MBis the size of the cache in megabytes.MVPROXY_CACHE_TTLis the time to live in seconds for cache.MVPROXY_RATE_LIMIT_ENABLEDis a flag to enable rate limiting.MVPROXY_RATE_LIMIT_MINUTESis the minutes of the period of rate limiting.MVPROXY_RATE_LIMIT_MAXis the max of requests permitted in a period.MVPROXY_DENY_IPS_ENABLEDis a flag to block IP addresses.MVPROXY_DENY_IPS_VALUESis the IP Address that will be blocked on the proxy.MVPROXY_DENY_ROUTES_ENABLEDis a flag to block the Mavryk node's routes.MVPROXY_DENY_ROUTES_VALUESis the Mavryk nodes routes that will be blocked on the proxy.conf.MVPROXY_ALLOW_ROUTES_ENABLEDis a flag to allow the Mavryk node's routes.MVPROXY_ALLOW_ROUTES_VALUESis the Mavryk nodes routes that will be allowed on the proxy.conf.MVPROXY_METRICS_ENABLEDis the flag to enable metrics.MVPROXY_METRICS_PPROFis the flag to enable pprof.MVPROXY_METRICS_HOSTis the host of the prometheus metrics and pprof (if enabled).MVPROXY_CORS_ENABLEDis the flag to enable cors.MVPROXY_GZIP_ENABLEDis the flag to enable gzip.MVPROXY_GC_OPTIMIZE_MEMORY_STOREis a flag to optimize GC when it's using storage as memory allocations instead of redis.MVPROXY_GC_PERCENTis the percent of the garbage collector.