Documentation
¶
Index ¶
- func DetectRemoteChainID(url string) (flowgo.ChainID, error)
- type Config
- type EmulatorServer
- func (s *EmulatorServer) AccessAdapter() *adapters.AccessAdapter
- func (s *EmulatorServer) AddToGroup(group *graceland.Group)
- func (s *EmulatorServer) Emulator() emulator.Emulator
- func (s *EmulatorServer) Listen() error
- func (s *EmulatorServer) Start()
- func (s *EmulatorServer) Stop()
- func (s *EmulatorServer) UseRestMiddleware(middleware func(http.Handler) http.Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
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
// ForkHost is the gRPC access node address to fork from (host:port).
ForkHost string
// ForkHeight is the height at which to start the emulator when forking.
ForkHeight uint64
// CheckpointPath is the path to the checkpoint folder to use when starting the network on top of existing state.
// StateHash should be provided as well.
CheckpointPath string
// StateHash is the state hash to use when starting the network on top of existing state.
// CheckpointPath should be provided as well.
StateHash string
// ComputationReportingEnabled enables/disables Cadence computation reporting.
ComputationReportingEnabled bool
// ScheduledTransactionsEnabled enables an experimental feature for scheduling transactions.
ScheduledTransactionsEnabled bool
// SetupEVMEnabled enables the EVM setup for the emulator, defaults to true.
SetupEVMEnabled bool
// SetupVMBridgeEnabled enables the VM bridge setup for the emulator, defaults to true.
SetupVMBridgeEnabled bool
}
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) AddToGroup ¶ added in v1.3.0
func (s *EmulatorServer) AddToGroup(group *graceland.Group)
Start starts the Flow Emulator server.
This is a blocking call that listens and starts the emulator server.
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()
func (*EmulatorServer) Stop ¶
func (s *EmulatorServer) Stop()
func (*EmulatorServer) UseRestMiddleware ¶ added in v1.4.0
func (s *EmulatorServer) UseRestMiddleware(middleware func(http.Handler) http.Handler)
Click to show internal directories.
Click to hide internal directories.