kvasir

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxQuery = "tm.event = 'Tx' AND wasm-wasm_request.id EXISTS AND wasm-wasm_request.contract EXISTS"
	// EventChannelCapacity is a buffer size of channel between node and this program
	EventChannelCapacity = 2000
)

Variables

View Source
var (
	DefaultKvasirHome string
)

Global instances.

Functions

func GetEventValues

func GetEventValues(log []abci.Event, evType string, evKey string) (res []string)

GetEventValues returns the list of all values in the given log with the given type and key.

func ImportKeyHexCommand

func ImportKeyHexCommand() *cobra.Command

func Main

func Main()

func NewClient

func NewClient(projectId, projectSecret string) *http.Client

func SubmitReport

func SubmitReport(c *Context, l *Logger, keyIndex int64, reports []ReportMsgWithKey)

SubmitReport TODO: rework

Types

type Config

type Config struct {
	ChainID           string   `mapstructure:"chain-id"`  // ChainID of the target chain
	NodeURI           string   `mapstructure:"node"`      // Remote RPC URI of OdinChain node to connect to
	Validator         string   `mapstructure:"validator"` // The validator address that I'm responsible for
	ValidatorAccAddr  string   `mapstructure:"validator-acc"`
	GasPrices         string   `mapstructure:"gas-prices"`          // Gas prices of the transaction
	LogLevel          string   `mapstructure:"log-level"`           // Log level of the logger
	Executor          string   `mapstructure:"executor"`            // Executor name and URL (example: "Executor name:URL")
	BroadcastTimeout  string   `mapstructure:"broadcast-timeout"`   // The time that Yoda will wait for tx commit
	RPCPollInterval   string   `mapstructure:"rpc-poll-interval"`   // The duration of rpc poll interval
	MaxTry            uint64   `mapstructure:"max-try"`             // The maximum number of tries to submit a report transaction
	MaxReport         uint64   `mapstructure:"max-report"`          // The maximum number of reports in one transaction
	MetricsListenAddr string   `mapstructure:"metrics-listen-addr"` // Address to listen on for prometheus metrics
	Contracts         []string `mapstructure:"contracts"`
	IPFS              string   `mapstructure:"ipfs"`
	IPFSProjectID     string   `mapstructure:"ipfs_project_id"` // For Infura IPFS usage, leave empty otherwise
	IPFSProjectSecret string   `mapstructure:"ipfs_project_secret"`
	GRPC              string   `mapstructure:"grpc"`
}

type Context

type Context struct {
	// contains filtered or unexported fields
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(level log.Option) *Logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, c *Context, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) With

func (l *Logger) With(keyvals ...interface{}) *Logger

type ReportMsgWithKey

type ReportMsgWithKey struct {
	// contains filtered or unexported fields
}

type Request

type Request struct {
	ChosenValidators []string  `json:"chosen_validators"`
	Metadata         string    `json:"metadata"`
	PartsReceived    uint32    `json:"parts_received"`
	PartsRequested   uint32    `json:"parts_requested"`
	Payed            sdk.Coins `json:"payed"`
	RequestHeight    uint64    `json:"request_Height"`
	RequestID        uint64    `json:"request_id"`
	Sender           string    `json:"sender"`
	Status           string    `json:"status"`
}

type RequestKey

type RequestKey struct {
	ContractAddress string
	RequestID       uint64
}

type RequestVerification

type RequestVerification struct {
	ChainID   string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"`
	RequestID uint64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	Contract  string `protobuf:"varint,4,opt,name=contract,json=externalId,proto3,casttype=ExternalID" json:"contract,omitempty"`
}

func NewRequestVerification

func NewRequestVerification(
	chainID string,
	validator sdk.ValAddress,
	requestID uint64,
	contract string,
) RequestVerification

func (RequestVerification) GetSignBytes

func (msg RequestVerification) GetSignBytes() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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