service

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestContextBatchStateToStringMap = map[RequestContextBatchState]string{
		BATCHRUNNING:   "running",
		BATCHCOMPLETED: "completed",
	}
	StringToRequestContextBatchStateMap = map[string]RequestContextBatchState{
		"running":   BATCHRUNNING,
		"completed": BATCHCOMPLETED,
	}
)
View Source
var (
	RequestContextStateToStringMap = map[RequestContextState]string{
		RUNNING:   "running",
		PAUSED:    "paused",
		COMPLETED: "completed",
	}
	StringToRequestContextStateMap = map[string]RequestContextState{
		"running":   RUNNING,
		"paused":    PAUSED,
		"completed": COMPLETED,
	}
)

Functions

This section is empty.

Types

type CompactRequest

type CompactRequest struct {
	RequestContextID           tmbytes.HexBytes
	RequestContextBatchCounter uint64
	Provider                   sdk.AccAddress
	ServiceFee                 sdk.Coins
	RequestHeight              int64
}

type GenesisState

type GenesisState struct {
	Params            Params                    `json:"params"`             // service params
	Definitions       []ServiceDefinition       `json:"definitions"`        // service definitions
	Bindings          []ServiceBinding          `json:"bindings"`           // service bindings
	WithdrawAddresses map[string]sdk.AccAddress `json:"withdraw_addresses"` // withdraw addresses
	RequestContexts   map[string]RequestContext `json:"request_contexts"`   // request contexts
}

type Params

type Params struct {
	MaxRequestTimeout    int64         `json:"max_request_timeout"`
	MinDepositMultiple   int64         `json:"min_deposit_multiple"`
	ServiceFeeTax        sdk.Dec       `json:"service_fee_tax"`
	SlashFraction        sdk.Dec       `json:"slash_fraction"`
	ComplaintRetrospect  time.Duration `json:"complaint_retrospect"`
	ArbitrationTimeLimit time.Duration `json:"arbitration_time_limit"`
	TxSizeLimit          uint64        `json:"tx_size_limit"`
}

type RequestContext

type RequestContext struct {
	ServiceName        string                   `json:"service_name"`
	Providers          []sdk.AccAddress         `json:"providers"`
	Consumer           sdk.AccAddress           `json:"consumer"`
	Input              string                   `json:"input"`
	ServiceFeeCap      sdk.Coins                `json:"service_fee_cap"`
	Timeout            int64                    `json:"timeout"`
	SuperMode          bool                     `json:"super_mode"`
	Repeated           bool                     `json:"repeated"`
	RepeatedFrequency  uint64                   `json:"repeated_frequency"`
	RepeatedTotal      int64                    `json:"repeated_total"`
	BatchCounter       uint64                   `json:"batch_counter"`
	BatchRequestCount  uint16                   `json:"batch_request_count"`
	BatchResponseCount uint16                   `json:"batch_response_count"`
	BatchState         RequestContextBatchState `json:"batch_state"`
	State              RequestContextState      `json:"state"`
	ResponseThreshold  uint16                   `json:"response_threshold"`
	ModuleName         string                   `json:"module_name"`
}

type RequestContextBatchState

type RequestContextBatchState byte
const (
	BATCHRUNNING   RequestContextBatchState = 0x00 // running
	BATCHCOMPLETED RequestContextBatchState = 0x01 // completed
)

func RequestContextBatchStateFromString

func RequestContextBatchStateFromString(str string) (RequestContextBatchState, error)

func (RequestContextBatchState) Format

func (state RequestContextBatchState) Format(s fmt.State, verb rune)

func (RequestContextBatchState) Marshal

func (state RequestContextBatchState) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (RequestContextBatchState) MarshalJSON

func (state RequestContextBatchState) MarshalJSON() ([]byte, error)

Marshals to JSON using string

func (RequestContextBatchState) String

func (state RequestContextBatchState) String() string

func (*RequestContextBatchState) Unmarshal

func (state *RequestContextBatchState) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*RequestContextBatchState) UnmarshalJSON

func (state *RequestContextBatchState) UnmarshalJSON(data []byte) error

Unmarshals from JSON

type RequestContextState

type RequestContextState byte
const (
	RUNNING   RequestContextState = 0x00 // running
	PAUSED    RequestContextState = 0x01 // paused
	COMPLETED RequestContextState = 0x02 // completed
)

func RequestContextStateFromString

func RequestContextStateFromString(str string) (RequestContextState, error)

func (RequestContextState) Format

func (state RequestContextState) Format(s fmt.State, verb rune)

func (RequestContextState) Marshal

func (state RequestContextState) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (RequestContextState) MarshalJSON

func (state RequestContextState) MarshalJSON() ([]byte, error)

Marshals to JSON using string

func (RequestContextState) String

func (state RequestContextState) String() string

func (*RequestContextState) Unmarshal

func (state *RequestContextState) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*RequestContextState) UnmarshalJSON

func (state *RequestContextState) UnmarshalJSON(data []byte) error

Unmarshals from JSON

type ServiceBinding

type ServiceBinding struct {
	ServiceName  string         `json:"service_name"`
	Provider     sdk.AccAddress `json:"provider"`
	Deposit      sdk.Coins      `json:"deposit"`
	Pricing      string         `json:"pricing"`
	Available    bool           `json:"available"`
	DisabledTime time.Time      `json:"disabled_time"`
}

type ServiceDefinition

type ServiceDefinition struct {
	Name              string         `json:"name"`
	Description       string         `json:"description"`
	Tags              []string       `json:"tags"`
	Author            sdk.AccAddress `json:"author"`
	AuthorDescription string         `json:"author_description"`
	Schemas           string         `json:"schemas"`
}

Jump to

Keyboard shortcuts

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