server

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EigenDADisperserRPCFlagName          = "eigenda-disperser-rpc"
	EthRPCFlagName                       = "eigenda-eth-rpc"
	SvcManagerAddrFlagName               = "eigenda-svc-manager-addr"
	EthConfirmationDepthFlagName         = "eigenda-eth-confirmation-depth"
	StatusQueryRetryIntervalFlagName     = "eigenda-status-query-retry-interval"
	StatusQueryTimeoutFlagName           = "eigenda-status-query-timeout"
	DisableTlsFlagName                   = "eigenda-disable-tls"
	ResponseTimeoutFlagName              = "eigenda-response-timeout"
	CustomQuorumIDsFlagName              = "eigenda-custom-quorum-ids"
	SignerPrivateKeyHexFlagName          = "eigenda-signer-private-key-hex"
	PutBlobEncodingVersionFlagName       = "eigenda-put-blob-encoding-version"
	DisablePointVerificationModeFlagName = "eigenda-disable-point-verification-mode"
	// Kzg flags
	G1PathFlagName             = "eigenda-g1-path"
	G2TauFlagName              = "eigenda-g2-tau-path"
	CachePathFlagName          = "eigenda-cache-path"
	MaxBlobLengthFlagName      = "eigenda-max-blob-length"
	MemstoreFlagName           = "memstore.enabled"
	MemstoreExpirationFlagName = "memstore.expiration"
	// S3 flags
	S3BucketFlagName          = "s3.bucket"
	S3EndpointFlagName        = "s3.endpoint"
	S3AccessKeyIDFlagName     = "s3.access-key-id"     // #nosec G101
	S3AccessKeySecretFlagName = "s3.access-key-secret" // #nosec G101
)
View Source
const (
	ListenAddrFlagName = "addr"
	PortFlagName       = "port"
)
View Source
const (
	GetRoute = "/get/"
	PutRoute = "/put/"

	DomainFilterKey   = "domain"
	CommitmentModeKey = "commitment_mode"
)
View Source
const BytesPerSymbol = 31
View Source
const EnvVarPrefix = "EIGENDA_PROXY"
View Source
const MaxCodingRatio = 8

Variables

View Source
var (
	ListenAddrFlag = &cli.StringFlag{
		Name:    ListenAddrFlagName,
		Usage:   "server listening address",
		Value:   "127.0.0.1",
		EnvVars: prefixEnvVars("ADDR"),
	}
	PortFlag = &cli.IntFlag{
		Name:    PortFlagName,
		Usage:   "server listening port",
		Value:   3100,
		EnvVars: prefixEnvVars("PORT"),
	}
)
View Source
var (
	ErrNotFound = errors.New("not found")
)
View Source
var Flags []cli.Flag

Flags contains the list of configuration options available to the binary.

View Source
var MaxSRSPoints = math.Pow(2, 28)

Functions

func CLIFlags added in v1.2.0

func CLIFlags(envPrefix string) []cli.Flag

func CheckRequired

func CheckRequired(ctx *cli.Context) error

func LoadStoreRouter added in v1.3.0

func LoadStoreRouter(cfg CLIConfig, ctx context.Context, log log.Logger) (*store.Router, error)

func ReadCommitmentMode added in v1.2.0

func ReadCommitmentMode(r *http.Request) (commitments.CommitmentMode, error)

func WithLogging

func WithLogging(handleFn func(http.ResponseWriter, *http.Request) error, log log.Logger) func(http.ResponseWriter, *http.Request)

WithLogging is a middleware that logs the request method and URL.

func WithMetrics

func WithMetrics(handleFn func(http.ResponseWriter, *http.Request) error, m metrics.Metricer) func(http.ResponseWriter, *http.Request) error

WithMetrics is a middleware that records metrics for the route path.

Types

type CLIConfig

type CLIConfig struct {
	S3Config      store.S3Config
	EigenDAConfig Config
	MetricsCfg    opmetrics.CLIConfig
}

func ReadCLIConfig

func ReadCLIConfig(ctx *cli.Context) CLIConfig

func (CLIConfig) Check

func (c CLIConfig) Check() error

type Config added in v1.2.0

type Config struct {
	S3Config store.S3Config

	ClientConfig clients.EigenDAClientConfig

	// The blob encoding version to use when writing blobs from the high level interface.
	PutBlobEncodingVersion codecs.BlobEncodingVersion

	// ETH vars
	EthRPC               string
	SvcManagerAddr       string
	EthConfirmationDepth int64

	// KZG vars
	CacheDir string

	G1Path string
	G2Path string

	MaxBlobLength string

	G2PowerOfTauPath string

	// Memstore Config params
	MemstoreEnabled        bool
	MemstoreBlobExpiration time.Duration
	// contains filtered or unexported fields
}

func ReadConfig added in v1.2.0

func ReadConfig(ctx *cli.Context) Config

NewConfig parses the Config from the provided flags or environment variables.

func (*Config) Check added in v1.2.0

func (cfg *Config) Check() error

Check ... verifies that configuration values are adequately set

func (*Config) GetMaxBlobLength added in v1.2.0

func (c *Config) GetMaxBlobLength() (uint64, error)

func (*Config) VerificationCfg added in v1.2.0

func (c *Config) VerificationCfg() *verify.Config

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(host string, port int, router *store.Router, log log.Logger, m metrics.Metricer) *Server

func (*Server) Endpoint

func (svr *Server) Endpoint() string

func (*Server) GetMemStats added in v1.3.0

func (svr *Server) GetMemStats() *store.Stats

func (*Server) GetS3Stats added in v1.3.0

func (svr *Server) GetS3Stats() *store.Stats

func (*Server) HandleGet

func (svr *Server) HandleGet(w http.ResponseWriter, r *http.Request) error

func (*Server) HandlePut

func (svr *Server) HandlePut(w http.ResponseWriter, r *http.Request) error

func (*Server) Health

func (svr *Server) Health(w http.ResponseWriter, r *http.Request) error

func (*Server) Port added in v1.1.1

func (svr *Server) Port() int

func (*Server) Start

func (svr *Server) Start() error

func (*Server) Stop

func (svr *Server) Stop() error

func (*Server) WriteBadRequest

func (svr *Server) WriteBadRequest(w http.ResponseWriter, msg string)

func (*Server) WriteInternalError

func (svr *Server) WriteInternalError(w http.ResponseWriter, err error)

func (*Server) WriteNotFound

func (svr *Server) WriteNotFound(w http.ResponseWriter, msg string)

func (*Server) WriteResponse

func (svr *Server) WriteResponse(w http.ResponseWriter, data []byte)

Jump to

Keyboard shortcuts

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