internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GrpcPort          int      `mapstructure:"grpc-port"`
	GrpcHost          string   `mapstructure:"grpc-host"`
	HttpPort          int      `mapstructure:"http-port"`
	HttpHost          string   `mapstructure:"http-host"`
	AllowedOrigins    []string `mapstructure:"allowed-origins"`
	CaptchaHost       string   `mapstructure:"captcha-host"`
	CaptchaSecret     string   `mapstructure:"captcha-secret"`
	CaptchaMinScore   float64  `mapstructure:"captcha-min-score"`
	Web3Provider      string   `mapstructure:"web3-provider"`
	PrivateKey        string   `mapstructure:"private-key"`
	FundingAmount     string   `mapstructure:"funding-amount"`
	GasLimit          uint64   `mapstructure:"gas-limit"`
	IpLimitPerAddress int      `mapstructure:"ip-limit-per-address"`
	ChainId           int64    `mapstructure:"chain-id"`
}

Config for the faucet server.

type Server

type Server struct {
	faucetpb.UnimplementedFaucetServer
	// contains filtered or unexported fields
}

Server capable of funding requests for faucet ETH via gRPC and REST HTTP.

func NewServer

func NewServer(cfg *Config) (*Server, error)

NewServer initializes the server from configuration values.

func (*Server) RequestFunds

func (s *Server) RequestFunds(
	ctx context.Context, req *faucetpb.FundingRequest,
) (*faucetpb.FundingResponse, error)

RequestFunds from an Ethereum faucet. Requires a valid captcha response.

func (*Server) Start

func (s *Server) Start()

Start a faucet server by serving a gRPC connection, an http JSON server, and a rate limiter.

Jump to

Keyboard shortcuts

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