chainserver

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NAME        string = "0x06fdde03"
	SYMBOL      string = "0x95d89b41"
	DECIMALS    string = "0x313ce567"
	TOTALSUPPLY string = "0x18160ddd"

	BalanceOfPerfix = "0x70a08231000000000000000000000000"
)
View Source
var (
	Success          = 0
	ErrJSON          = -41201
	ErrNoTransaction = -41203
	ErrNoTxByHash    = -41204
	ErrData          = -41205
	ErrNoBlock       = -41206
	ErrtTx           = -41207
	ErrNoBlockHeight = -41208
)

Functions

This section is empty.

Types

type ChainBlock

type ChainBlock struct {
	Height           uint64              `json:"height"`
	PrevHash         string              `json:"prevHash"`
	Hash             string              `json:"hash"`
	Transactions     []*ChainTransaction `json:"transactions"`
	Root             string              `json:"root"`
	SnapRoot         string              `json:"snaproot"`
	Version          uint64              `json:"version"`
	Timestamp        uint64              `json:"timestamp"`
	UsedTime         uint64              `json:"usedtime"`
	Miner            string              `json:"miner"`
	Difficulty       *big.Int            `json:"difficulty"`
	GlobalDifficulty *big.Int            `json:"globaldifficulty"`
	Nonce            uint64              `json:"nonce"`
	GasLimit         uint64              `json:"gasLimit"`
	GasUsed          uint64              `json:"gasUsed"`
}

type ChainTransaction

type ChainTransaction struct {
	Version uint64 `json:"Version"`
	Type    uint8  `json:"Type"`
	From    string `json:"From"`
	To      string `json:"To"`
	Amount  uint64 `json:"Amount"`
	Nonce   uint64 `json:"Nonce"`

	GasLimit  uint64 `json:"GasLimit"`
	GasFeeCap uint64 `json:"GasFeeCap"`
	GasPrice  uint64 `json:"GasPrice"`

	Input     string `json:"Input"`
	Signature string `json:"Signature"`

	GasUsed  uint64 `json:"GasUsed"`
	BlockNum uint64 `json:"BlockNum"`
}

Transaction

type Server

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

func NewServer

func NewServer(bc blockchain.Blockchains, ip_port, grpcip string) *Server

func (*Server) RunServer

func (s *Server) RunServer()

func (*Server) ServerHandler

func (s *Server) ServerHandler(ctx *fasthttp.RequestCtx)

server handler

type TransactionReceipt

type TransactionReceipt struct {
	BlockHash         common.Hash    `json:"blockHash"`
	BlockNumber       string         `json:"blockNumber"`
	ContractAddress   common.Address `json:"contractAddress"`
	CumulativeGasUsed string         `json:"cumulativeGasUsed"`
	From              common.Address `json:"from"`
	GasUsed           string         `json:"gasUsed"`
	Logs              []*types.Log   `json:"logs"`
	LogsBloom         types.Bloom    `json:"logsBloom"`
	Status            string         `json:"status"`
	To                common.Address `json:"to"`

	TransactionHash  common.Hash `json:"transactionHash"`
	TransactionIndex string      `json:"transactionIndex"`

	Root common.Hash `json:"root"`
}

Jump to

Keyboard shortcuts

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