conf

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists added in v0.6.0

func Exists(cpPath string) bool

func GenerateAndUpdateConfigFile added in v0.6.0

func GenerateAndUpdateConfigFile(cpRepoPath string, multiAddress, nodeName string, port int) error

func GetRpcByNetWorkName added in v0.6.0

func GetRpcByNetWorkName() (string, error)

func InitConfig

func InitConfig(cpRepoPath string, standalone bool) error

Types

type API

type API struct {
	Port             int
	MultiAddress     string
	Domain           string
	NodeName         string
	WalletWhiteList  string
	WalletBlackList  string
	Pricing          Pricing  `toml:"pricing"`
	AutoDeleteImage  bool     `toml:"AutoDeleteImage"`
	ClearLogDuration int      `toml:"ClearLogDuration"`
	PortRange        []string `toml:"PortRange"`
}

type CONTRACT

type CONTRACT struct {
	UpgradeName       string
	SwanToken         string `toml:"SWAN_CONTRACT"`
	CpAccountRegister string `toml:"REGISTER_CP_CONTRACT"`

	JobCollateral     string `toml:"SWAN_COLLATERAL_CONTRACT"`
	JobManager        string `toml:"SWAN_JOB_CONTRACT"`
	JobManagerCreated uint64 `toml:"JobManagerCreated"`

	TaskRegister           string `toml:"REGISTER_TASK_CONTRACT"`
	ZkCollateral           string `toml:"ZK_COLLATERAL_CONTRACT"`
	Sequencer              string `toml:"SEQUENCER_CONTRACT"`
	EdgeTaskPayment        string `toml:"EDGE_TASK_PAYMENT"`
	EdgeTaskPaymentCreated uint64 `toml:"EdgeTaskPaymentCreated"`

	JobCollateralUbiZero string `toml:"SWAN_COLLATERAL_UBI_ZERO_CONTRACT"`
	ZkCollateralUbiZero  string `toml:"ZK_COLLATERAL_UBI_ZERO_CONTRACT"`
}

type ComputeNode

type ComputeNode struct {
	API      API
	UBI      UBI
	LOG      LOG
	HUB      HUB
	MCS      MCS
	Registry Registry
	RPC      RPC
	CONTRACT CONTRACT `toml:"CONTRACT,omitempty"`
}

ComputeNode is a compute node config

func GetConfig

func GetConfig() *ComputeNode

type HUB

type HUB struct {
	BalanceThreshold float64
	OrchestratorPk   string
	VerifySign       bool
}

type LOG

type LOG struct {
	CrtFile string
	KeyFile string
}

type MCS

type MCS struct {
	ApiKey     string
	BucketName string
	Network    string
}

type Pricing added in v1.0.0

type Pricing bool

func (*Pricing) UnmarshalTOML added in v1.0.0

func (p *Pricing) UnmarshalTOML(data interface{}) error

type RPC

type RPC struct {
	SwanChainRpc string `toml:"SWAN_CHAIN_RPC"`
}

type Registry

type Registry struct {
	ServerAddress string
	UserName      string
	Password      string
}

type UBI

type UBI struct {
	UbiEnginePk     string
	EnableSequencer bool
	AutoChainProof  bool
	SequencerUrl    string
	EdgeUrl         string
	VerifySign      bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳