config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSupplierConfigUnmarshalYAML          = sdkerrors.Register(types.ModuleName, 2100, "config reader cannot unmarshal yaml content")
	ErrSupplierConfigInvalidServiceId       = sdkerrors.Register(types.ModuleName, 2101, "invalid serviceId in supplier config")
	ErrSupplierConfigNoEndpoints            = sdkerrors.Register(types.ModuleName, 2102, "no endpoints defined for serviceId in supplier config")
	ErrSupplierConfigInvalidEndpointConfig  = sdkerrors.Register(types.ModuleName, 2103, "invalid endpoint config in supplier config")
	ErrSupplierConfigInvalidRPCType         = sdkerrors.Register(types.ModuleName, 2104, "invalid rpc type in supplier config")
	ErrSupplierConfigInvalidURL             = sdkerrors.Register(types.ModuleName, 2105, "invalid endpoint url in supplier config")
	ErrSupplierConfigEmptyContent           = sdkerrors.Register(types.ModuleName, 2106, "empty supplier config content")
	ErrSupplierConfigInvalidStake           = sdkerrors.Register(types.ModuleName, 2107, "invalid stake amount in supplier config")
	ErrSupplierConfigInvalidOwnerAddress    = sdkerrors.Register(types.ModuleName, 2108, "invalid owner address in supplier config")
	ErrSupplierConfigInvalidOperatorAddress = sdkerrors.Register(types.ModuleName, 2109, "invalid operator address in supplier config")
)

Functions

This section is empty.

Types

type SupplierStakeConfig

type SupplierStakeConfig struct {
	OwnerAddress    string
	OperatorAddress string
	StakeAmount     sdk.Coin
	Services        []*sharedtypes.SupplierServiceConfig
}

SupplierStakeConfig is the structure describing the parsed supplier stake config.

func ParseSupplierConfigs

func ParseSupplierConfigs(ctx context.Context, configContent []byte) (*SupplierStakeConfig, error)

ParseSupplierServiceConfig parses the stake config file into a SupplierServiceConfig.

type YAMLServiceEndpoint

type YAMLServiceEndpoint struct {
	PubliclyExposedUrl string            `yaml:"publicly_exposed_url"`
	RPCType            string            `yaml:"rpc_type"`
	Config             map[string]string `yaml:"config,omitempty"`
}

YAMLServiceEndpoint is the structure describing a single service endpoint in the service section of the stake config file.

type YAMLStakeConfig

type YAMLStakeConfig struct {
	OwnerAddress           string              `yaml:"owner_address"`
	OperatorAddress        string              `yaml:"operator_address"`
	StakeAmount            string              `yaml:"stake_amount"`
	Services               []*YAMLStakeService `yaml:"services"`
	DefaultRevSharePercent map[string]float32  `yaml:"default_rev_share_percent"`
}

YAMLStakeConfig is the structure describing the supplier stake config file.

type YAMLStakeService

type YAMLStakeService struct {
	ServiceId       string                `yaml:"service_id"`
	RevSharePercent map[string]float32    `yaml:"rev_share_percent"`
	Endpoints       []YAMLServiceEndpoint `yaml:"endpoints"`
}

YAMLStakeService is the structure describing a single service entry in the stake config file.

Jump to

Keyboard shortcuts

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