kava-proxy-service

command module
v0.0.0-...-2473a21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 7 Imported by: 0

README

kava-proxy-service

L7 proxy that enables observability, routing, and scaling of kava APIs to the farthest reaches of the cosmos.

Usage

Service Workflows

Environment Variables

Many aspects of the service are configurable via environment variables, for example:

  • LOG_LEVEL - controls the amount of logs produced by the service, defaults to INFO, supported values in order from most verbose to least verbose are:

    • TRACE
    • DEBUG
    • INFO
    • ERROR
  • PROXY_BACKEND_HOST_URL_MAP - comma delimited list of HOSTNAME_TO_PROXY>BACKEND_PROXY_SERVER_FOR_HOSTNAME controls what backend server the proxy service will proxy a request to based on the hostname of the request. , is used as a separator between entries in the map, > is used as a separator within an entry to delimit between the hostname to proxy for and the backend to proxy to. At least one entry must be present. The same backend can be used as the proxy for multiple hostnames by creating one entry for each of the hostnames to proxy for. Example value:

PROXY_BACKEND_HOST_URL_MAP=evm.app.internal.testnet.us-east.production.kava.io>https://evmrpc.internal.testnet.proxy.kava.io,evm.data.internal.testnet.us-east.production.kava.io>https://evmrpcdata.internal.testnet.proxy.kava.io

For a full list of supported environment variables refer to the code and development environment file

Logging

The service logs to stdout using the json format, with logging configurable (via environment variables) at the following levels:

  • DEBUG
  • INFO
  • ERROR
kava-proxy-service-proxy-1  | {"level":"debug","time":"2023-03-02T19:30:18Z","caller":"/app/main.go:34","message":"initial config: {LogLevel:DEBUG}"}
kava-proxy-service-proxy-1  | {"level":"info","time":"2023-03-02T19:30:18Z","caller":"/app/main.go:37","message":"There and back again"}

Development

See Development.md.

Architecture

See architecture docs.

Feedback

For suggesting changes or reporting issues, please open a Github Issue.

Documentation

Overview

package main reads & validates configuration for the proxy service and if the config is valid starts and monitors an instance of the proxy service and any background routines

Directories

Path Synopsis
clients
database/postgres/migrations
when this package is loaded the package directory will be searched for any go or sql migration files and register for them to the proxy service to run https://bun.uptrace.dev/guide/migrations.html#go-based-migrations
when this package is loaded the package directory will be searched for any go or sql migration files and register for them to the proxy service to run https://bun.uptrace.dev/guide/migrations.html#go-based-migrations
package config provides functions and values for reading and validating kava proxy service configuration
package config provides functions and values for reading and validating kava proxy service configuration
package logging provides a JSON structured stdout level logger
package logging provides a JSON structured stdout level logger
package routines provides configuration and logic for running background routines such as metric compaction for aggregating and pruning proxied request metrics
package routines provides configuration and logic for running background routines such as metric compaction for aggregating and pruning proxied request metrics
package service provides functions and methods for creating and running the api of the proxy service
package service provides functions and methods for creating and running the api of the proxy service
batchmdw
The cache status header will be set to:
The cache status header will be set to:
cachemdw
Package cachemdw is responsible for caching EVM requests and provides corresponding middleware package can work with any underlying storage which implements simple cache.Cache interface
Package cachemdw is responsible for caching EVM requests and provides corresponding middleware package can work with any underlying storage which implements simple cache.Cache interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL