sidecar

package
v0.0.0-...-d9a1657 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNatsURL            = "ns://127.0.0.1:4222"
	DefaultNatsQueueName      = "enats"
	DefaultNatsEndpointPrefix = "web3.rpc.request"
	DefaultClientURL          = "ws://127.0.0.1:8545"
	DefaultDataDir            = "./data"
	DefaultRpcHistorySize     = 7200
)

Variables

View Source
var (
	DefaultRpcDenyList = []string{"admin_.*"}
)

Functions

This section is empty.

Types

type Option

type Option func(opts *Options) error

func ClientId

func ClientId(id string) Option

func ClientUrl

func ClientUrl(url string) Option

func DataDir

func DataDir(path string) Option

func NatsEndpointPrefix

func NatsEndpointPrefix(prefix string) Option

func NatsUrl

func NatsUrl(url string) Option

func RpcDenyList

func RpcDenyList(deny []string) Option

func RpcHistorySize

func RpcHistorySize(size int) Option

type Options

type Options struct {
	NatsUrl            string
	NatsQueueName      string
	NatsEndpointPrefix string

	ClientUrl string
	ClientId  string

	DataDir string

	RpcDenyList    []string
	RpcHistorySize int
}

func GetDefaultOptions

func GetDefaultOptions() Options

type Sidecar

type Sidecar struct {
	Options Options
	// contains filtered or unexported fields
}

func NewSidecar

func NewSidecar(log *zap.Logger, options ...Option) (*Sidecar, error)

func (*Sidecar) Init

func (s *Sidecar) Init() error

func (*Sidecar) Run

func (s *Sidecar) Run(ctx context.Context) error

func (*Sidecar) RunSession

func (s *Sidecar) RunSession(ctx context.Context, session *web3.Session) error

Jump to

Keyboard shortcuts

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