server

package
v0.0.0-...-ed9f5fe Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//以太坊节点
	Net string

	//邮箱
	EmailUser     string // 邮箱账号
	EmailPassword string //注意,此处为授权码、不是密码
	EmailHost     string //smtp地址及端口
	EmailTo       string //接收者,内容可重复,邮箱之间用;隔开
	EmailToLock   sync.RWMutex
)
View Source
var EmailSlice []ETHEmail

Functions

func InitCache

func InitCache()

func ReadAddressList

func ReadAddressList()

func ReadFile

func ReadFile(filename string) (*[]string, error)

func ReadTokenList

func ReadTokenList()

func SendMail

func SendMail(user, password, host, to, subject, body, mailType string) error

发送邮件的逻辑函数

Types

type BlockNumberResp

type BlockNumberResp struct {
	JsonRPC string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  string `json:"result"`
}

type ETHEmail

type ETHEmail struct {
	From         string
	To           string
	Value        string
	TxType       string
	TokenAddress string
}

type ETHTxResult

type ETHTxResult struct {
	Difficulty      string            `json:"difficulty"`
	ExtraData       string            `json:"extraData"`
	GasLimit        string            `json:"gasLimit"`
	GasUsed         string            `json:"gasUsed"`
	Hash            string            `json:"hash"`
	LogsBloom       string            `json:"logsBloom"`
	Miner           string            `json:"miner"`
	MixHash         string            `json:"mixHash"`
	Nonce           string            `json:"nonce"`
	Number          string            `json:"number"`
	ParentHash      string            `json:"parentHash"`
	ReceiptsRoot    string            `json:"receiptsRoot"`
	Sha3Uncles      string            `json:"sha3Uncles"`
	Size            string            `json:"size"`
	StateRoot       string            `json:"stateRoot"`
	Timestamp       string            `json:"timestamp"`
	TotalDifficulty string            `json:"totalDifficulty"`
	Txs             []TransactionData `json:"transactions"`
	TxRoot          string            `json:"transactionsRoot"`
	Uncles          []string          `json:"uncles"`
}

type ReceiptData

type ReceiptData struct {
	BlockHash         string   `json:"blockHash"`
	BlockNumber       string   `json:"blockNumber"`
	ContractAddress   string   `json:"contractAddress"`
	CumulativeGasUsed string   `json:"cumulativeGasUsed"`
	From              string   `json:"from"`
	GasUsed           string   `json:"gasUsed"`
	Logs              []TxLogs `json:"logs"`
	LogsBloom         string   `json:"logsBloom"`
	Status            string   `json:"status"`
	To                string   `json:"to"`
	TxHash            string   `json:"transactionHash"`
	TxIndex           string   `json:"transactionIndex"`
}

type Transaction

type Transaction struct {
	JsonRPC string      `json:"jsonrpc"`
	Id      int64       `json:"id"`
	Result  ETHTxResult `json:"result"`
}

type TransactionData

type TransactionData struct {
	Time  int64  `json:"time"`
	From  string `json:"from"`
	To    string `json:"to"`
	Value string `json:"value"`
	Hash  string `json:"hash"`
}

type TransactionReceipt

type TransactionReceipt struct {
	JsonRPC string      `json:"jsonrpc"`
	Id      int64       `json:"id"`
	Result  ReceiptData `json:"result"`
}

type TxLogs

type TxLogs struct {
	Address     string   `json:"address"`
	Topics      []string `json:"topics"`
	Data        string   `json:"data"`
	BlockNumber string   `json:"blockNumber"`
	TxHash      string   `json:"transactionHash"`
	TxIndex     string   `json:"transactionIndex"`
	BlockHash   string   `json:"blockHash"`
	LogIndex    string   `json:"logIndex"`
	Removed     bool     `json:"removed"`
}

Jump to

Keyboard shortcuts

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