riskctrl

package
v0.0.0-...-14f7c6b Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package riskctrl do the audit job and send warning emails when finds illegal situations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig() (err error)

CheckConfig check config

func InitCrossChainBridge

func InitCrossChainBridge()

InitCrossChainBridge init bridge

func InitEmailConfig

func InitEmailConfig()

InitEmailConfig init email config

func SetConfig

func SetConfig(config *RiskConfig)

SetConfig set config

func Work

func Work()

Work start risk control work

Types

type EmailConfig

type EmailConfig struct {
	Server   string
	Port     int
	From     string
	FromName string
	Password string `json:"-"`
	To       []string
	Cc       []string
}

EmailConfig email config

type RiskConfig

type RiskConfig struct {
	SrcChain   *tokens.ChainConfig
	SrcToken   *tokens.TokenConfig
	SrcGateway *tokens.GatewayConfig

	DestChain   *tokens.ChainConfig
	DestToken   *tokens.TokenConfig
	DestGateway *tokens.GatewayConfig

	Email *EmailConfig

	InitialDiffValue         float64
	MaxAuditBalanceDiffValue float64
	MaxAuditSupplyDiffValue  float64
	MinWithdrawReserve       float64
}

RiskConfig risk config

func GetConfig

func GetConfig() *RiskConfig

GetConfig get config

func LoadConfig

func LoadConfig(configFile string) *RiskConfig

LoadConfig load config

Jump to

Keyboard shortcuts

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