service

package
v0.0.0-...-6704d28 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS = 0
	FAIL    = 1
)
View Source
const (
	NodeInfoTable   = "node_info"
	NodeSourceTable = "node_source"
	NodeTaskTable   = "node_task_%v"
)
View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeSource

type NodeSource struct {
	Id          int64     `json:"id" gorm:"column:id"`
	BlockChain  int64     `json:"blockChain" gorm:"column:block_chain"` // 公链code
	TxHash      string    `json:"txHash" gorm:"column:tx_hash"`
	BlockHash   string    `json:"blockHash" gorm:"column:block_hash"`
	BlockNumber string    `json:"blockNumber" gorm:"column:block_number"`
	SourceType  int       `json:"sourceType" gorm:"column:source_type"` // 任务类型 1: 交易 2:区块 3.收据
	CreateTime  time.Time `json:"createTime" gorm:"column:create_time"`
}

type Server

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

func NewServer

func NewServer(dbConfig *config.TaskDb, chConfig map[int64]*config.ClickhouseDb, blockChain []int64, log *xlog.XLog) *Server

func (*Server) AddNodeSource

func (s *Server) AddNodeSource(source *NodeSource) error

func (*Server) AddNodeSourceList

func (s *Server) AddNodeSourceList(sources []*NodeSource) error

func (*Server) Error

func (s *Server) Error(c *gin.Context, path string, err string)

func (*Server) GetActiveNodes

func (s *Server) GetActiveNodes(c *gin.Context)

func (*Server) GetActiveNodesFromDB

func (s *Server) GetActiveNodesFromDB() ([]string, error)

func (*Server) PushBlockTask

func (s *Server) PushBlockTask(c *gin.Context)

func (*Server) PushReceiptTask

func (s *Server) PushReceiptTask(c *gin.Context)

func (*Server) PushReceiptsTask

func (s *Server) PushReceiptsTask(c *gin.Context)

func (*Server) PushSyncTxTask

func (s *Server) PushSyncTxTask(c *gin.Context)

func (*Server) PushTxTask

func (s *Server) PushTxTask(c *gin.Context)

func (*Server) PushTxsTask

func (s *Server) PushTxsTask(c *gin.Context)

func (*Server) QueryTxFromCh

func (s *Server) QueryTxFromCh(blockChain int64, txHash string) (*Tx, error)

func (*Server) Success

func (s *Server) Success(c *gin.Context, resp interface{}, path string)

type Tx

type Tx struct {
	Id          int64  `json:"id" gorm:"column:id"`
	TxHash      string `json:"hash" gorm:"column:hash"`
	TxTime      string `json:"txTime" gorm:"column:tx_time"`
	TxStatus    string `json:"txStatus" gorm:"column:tx_status"`
	BlockNumber string `json:"blockNumber" gorm:"column:block_number"`
	FromAddr    string `json:"from" gorm:"column:from_addr"`
	ToAddr      string `json:"to" gorm:"column:to_addr"`
	Value       string `json:"value" gorm:"column:value"`
	Fee         string `json:"fee" gorm:"column:fee"`
	GasPrice    string `json:"gasPrice" gorm:"column:gas_price"`
	MaxPrice    string `json:"maxFeePerGas" gorm:"column:max_fee_per_gas"`
	GasLimit    string `json:"gas" gorm:"column:gas"`
	GasUsed     string `json:"gasUsed" gorm:"column:gas_used"`
	BaseFee     string `json:"baseFeePerGas" gorm:"column:base_fee_per_gas"`
	PriorityFee string `json:"maxPriorityFeePerGas" gorm:"column:max_priority_fee_per_gas"`
	InputData   string `json:"input" gorm:"column:input_data"`
	BlockHash   string `json:"blockHash" gorm:"column:block_hash"`

	TransactionIndex string `json:"transactionIndex" gorm:"column:transaction_index"`
	Type             string `json:"type" gorm:"column:tx_type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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