Documentation
¶
Overview ¶
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Constants
- Variables
- func ConfigureInitialRewardConfig(app *application.Lux) (*rewardmanager.InitialRewardConfig, error)
- func CopyCustomVM(app *application.Lux, subnetName string, vmPath string) error
- func CreateCustomSidecar(sc *models.Sidecar, app *application.Lux, blockchainName string, ...) (*models.Sidecar, error)
- func CreateCustomSubnetConfig(app *application.Lux, subnetName string, genesisPath, vmPath string) ([]byte, *models.Sidecar, error)
- func CreateEVMGenesis(chainID *big.Int, allocations core.GenesisAlloc, timestamps map[string]uint64) map[string]interface{}
- func CreateEVMGenesisWithParams(app *application.Lux, params SubnetEVMGenesisParams, ...) ([]byte, error)
- func CreateEvmConfig(app *application.Lux, subnetName string, genesisPath string, evmVersion string) ([]byte, *models.Sidecar, error)
- func CreateEvmSidecar(sc *models.Sidecar, app *application.Lux, blockchainName string, ...) (*models.Sidecar, error)
- func GetFeeConfig(config params.ChainConfig, app *application.Lux) (params.ChainConfig, statemachine.StateDirection, error)
- func GetLatestLuxByProtocolVersion(app *application.Lux, rpcVersion int, url string) (string, error)
- func GetRPCProtocolVersion(app *application.Lux, vmType models.VMType, vmVersion string) (int, error)
- func GetVMBinaryProtocolVersion(vmBinaryPath string) (int, error)
- func PrecompileToUpgradeString(p Precompile) string
- func PromptInterop(app *application.Lux, vmType models.VMType, version string, chainID uint64, ...) (bool, error)
- func PromptSubnetEVMVersion(app *application.Lux, vmType models.VMType, version string) (string, error)
- func PromptTokenSymbol(app *application.Lux, state statemachine.StateType, token string) (string, error)
- func PromptVMType(app *application.Lux, useSubnetEVM bool, useCustom bool) (models.VMType, error)
- type AllowList
- type DefaultsKind
- type Precompile
- type SubnetEVMGenesisParams
Constants ¶
const ( LowGasLimit = uint64(12_000_000) MediumGasLimit = uint64(15_000_000) HighGasLimit = uint64(20_000_000) LowTargetGas = uint64(1_500_000) MediumTargetGas = uint64(2_000_000) HighTargetGas = uint64(5_000_000) NoDynamicFeesGasLimitToTargetGasFactor = uint64(10) )
Gas limits
const ( EvmDebugConfig = `{"log-level": "debug"}` EvmNonDebugConfig = `{"log-level": "info"}` )
EVM configuration constants
const ( NativeMint = "Native Minting" ContractAllowList = "Contract Deployment Allow List" TxAllowList = "Transaction Allow List" FeeManager = "Manage Fee Settings" RewardManager = "RewardManagerConfig" )
Variables ¶
var ( Difficulty = big.NewInt(0) // This is the current c-chain gas config StarterFeeConfig = fees.DefaultFeeConfig PrefundedEwoqAddress = common.HexToAddress("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC") PrefundedEwoqPrivate = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" )
var ErrNoLuxVersion = errors.New("unable to find a compatible node version")
var OneLux = big.NewInt(1_000_000_000) // 1 LUX = 1e9 nLUX
Units
Functions ¶
func ConfigureInitialRewardConfig ¶
func ConfigureInitialRewardConfig(app *application.Lux) (*rewardmanager.InitialRewardConfig, error)
func CopyCustomVM ¶
func CopyCustomVM(app *application.Lux, subnetName string, vmPath string) error
func CreateCustomSidecar ¶
func CreateCustomSidecar( sc *models.Sidecar, app *application.Lux, blockchainName string, vmVersion string, ) (*models.Sidecar, error)
CreateCustomSidecar creates a sidecar for custom VMs
func CreateEVMGenesis ¶
func CreateEVMGenesis(chainID *big.Int, allocations core.GenesisAlloc, timestamps map[string]uint64) map[string]interface{}
CreateEVMGenesis creates a new EVM genesis configuration
func CreateEVMGenesisWithParams ¶
func CreateEVMGenesisWithParams( app *application.Lux, params SubnetEVMGenesisParams, warpInfo *interchain.WarpInfo, addWarpRegistryToGenesis bool, proxyContractOwner string, rewardBasisPoints uint64, useACP99 bool, ) ([]byte, error)
CreateEVMGenesisWithParams creates EVM genesis with extended parameters
func CreateEvmConfig ¶
func CreateEvmSidecar ¶
func CreateEvmSidecar( sc *models.Sidecar, app *application.Lux, blockchainName string, vmVersion string, tokenSymbol string, deployInterop bool, sovereign bool, useACP99 bool, ) (*models.Sidecar, error)
CreateEvmSidecar creates a sidecar for EVM-based blockchains
func GetFeeConfig ¶
func GetFeeConfig(config params.ChainConfig, app *application.Lux) ( params.ChainConfig, statemachine.StateDirection, error, )
func GetRPCProtocolVersion ¶
func GetVMBinaryProtocolVersion ¶
GetVMBinaryProtocolVersion returns the protocol version for the VM binary
func PrecompileToUpgradeString ¶
func PrecompileToUpgradeString(p Precompile) string
func PromptInterop ¶
func PromptInterop(app *application.Lux, vmType models.VMType, version string, chainID uint64, interop bool) (bool, error)
PromptInterop prompts for interoperability configuration
func PromptSubnetEVMVersion ¶
func PromptSubnetEVMVersion(app *application.Lux, vmType models.VMType, version string) (string, error)
PromptSubnetEVMVersion prompts for Subnet EVM version
func PromptTokenSymbol ¶
func PromptTokenSymbol(app *application.Lux, state statemachine.StateType, token string) (string, error)
PromptTokenSymbol prompts for token symbol
func PromptVMType ¶
PromptVMType prompts the user to select a VM type
Types ¶
type AllowList ¶
type AllowList struct {
AdminAddresses []common.Address
ManagerAddresses []common.Address
EnabledAddresses []common.Address
}
AllowList represents an allow list configuration
func GenerateAllowList ¶
func GenerateAllowList( app *application.Lux, config AllowList, action string, vmVersion string, ) (AllowList, bool, error)
GenerateAllowList prompts the user to configure an allow list
type DefaultsKind ¶
type DefaultsKind int
DefaultsKind represents the type of defaults to use for VM configuration
const ( // NoDefaults means no default configuration will be applied NoDefaults DefaultsKind = iota // TestDefaults means test-friendly defaults will be applied TestDefaults // ProductionDefaults means production-ready defaults will be applied ProductionDefaults )
func PromptDefaults ¶
func PromptDefaults(app *application.Lux, defaultsKind DefaultsKind, vmType models.VMType) (DefaultsKind, error)
PromptDefaults prompts the user for default configuration
type Precompile ¶
type Precompile string
type SubnetEVMGenesisParams ¶
type SubnetEVMGenesisParams struct {
UseDefaults bool
Interop bool
UseWarp bool
UseExternalGasToken bool
}
SubnetEVMGenesisParams contains parameters for Subnet EVM genesis
func PromptSubnetEVMGenesisParams ¶
func PromptSubnetEVMGenesisParams( app *application.Lux, params SubnetEVMGenesisParams, vmType models.VMType, version string, chainID uint64, symbol string, interop bool, ) (*SubnetEVMGenesisParams, error)
PromptSubnetEVMGenesisParams prompts for Subnet EVM genesis parameters