server

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 2

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
	GRPCDebug                 bool
	AdminPort                 int
	DebuggerPort              int
	RESTPort                  int
	RESTDebug                 bool
	HTTPHeaders               []utils.HTTPHeader
	BlockTime                 time.Duration
	ServicePublicKey          crypto.PublicKey
	ServicePrivateKey         crypto.PrivateKey
	ServiceKeySigAlgo         crypto.SignatureAlgorithm
	ServiceKeyHashAlgo        crypto.HashAlgorithm
	GenesisTokenSupply        cadence.UFix64
	TransactionExpiry         uint
	StorageLimitEnabled       bool
	MinimumStorageReservation cadence.UFix64
	StorageMBPerFLOW          cadence.UFix64
	TransactionFeesEnabled    bool
	EVMEnabled                bool
	TransactionMaxGasLimit    uint64
	ScriptGasLimit            uint64
	Persist                   bool
	Snapshot                  bool
	// ContractRemovalEnabled configures possible removal of contracts.
	ContractRemovalEnabled bool
	// DBPath is the path to the Badger database on disk.
	DBPath string
	// DBGCInterval is the time interval at which to garbage collect the Badger value log.
	DBGCInterval time.Duration
	// DBGCDiscardRatio is the ratio of space to reclaim during a Badger garbage collection run.
	DBGCDiscardRatio float64
	// LivenessCheckTolerance is the time interval in which the server must respond to liveness probes.
	LivenessCheckTolerance time.Duration
	// Whether to deploy some extra Flow contracts when emulator starts
	WithContracts bool
	// Enable simple monotonically increasing address format (e.g. 0x1, 0x2, etc)
	SimpleAddressesEnabled    bool
	SkipTransactionValidation bool
	// Host listen on for the emulator servers (REST/GRPC/Admin)
	Host string
	//Chain to emulation
	ChainID flowgo.ChainID
	//Redis URL for redis storage backend
	RedisURL string
	//Sqlite URL for sqlite storage backend
	SqliteURL string
	// CoverageReportingEnabled enables/disables Cadence code coverage reporting.
	CoverageReportingEnabled bool
	// RPCHost is the address of the access node to use when using a forked network.
	RPCHost string
	// StartBlockHeight is the height at which to start the emulator.
	StartBlockHeight uint64
}

Config is the configuration for an emulator server.

type EmulatorServer

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

EmulatorServer is a local server that runs a Flow Emulator instance.

The server wraps an emulated emulator instance with the Access API gRPC handlers.

func NewEmulatorServer

func NewEmulatorServer(logger *zerolog.Logger, conf *Config) *EmulatorServer

NewEmulatorServer creates a new instance of a Flow Emulator server.

func (*EmulatorServer) AccessAdapter added in v0.50.0

func (s *EmulatorServer) AccessAdapter() *adapters.AccessAdapter

func (*EmulatorServer) Emulator added in v0.50.0

func (s *EmulatorServer) Emulator() emulator.Emulator

func (*EmulatorServer) Listen added in v0.40.0

func (s *EmulatorServer) Listen() error

Listen starts listening for incoming connections.

After this non-blocking function executes we can treat the emulator server as ready.

func (*EmulatorServer) Start

func (s *EmulatorServer) Start()

Start starts the Flow Emulator server.

This is a blocking call that listens and starts the emulator server.

func (*EmulatorServer) Stop

func (s *EmulatorServer) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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