common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddressZero some transactions do not have To address, use this address instead
	AddressZero = "0x0000000000000000000000000000000000000000"
	// DefaultIpc the default ipc path
	DefaultIpc = "/home/blockform/.ethereum/geth.ipc"
	// DefaultDbPath default database path, a folder then prefix
	DefaultDbPath = "/home/blockform/account-indexer-db/geth_indexer_leveldb"
	// NumMaxTransaction if number of transaction is more than this, just return +10000 to the client
	NumMaxTransaction = 10000
	// DefaultCleanInterval In minute
	DefaultCleanInterval = 5
	// DefaultBlockTTL In hour
	DefaultBlockTTL = 4
	// DefaultWatcherInterval in minute
	DefaultWatcherInterval = 5
	// DefaultOOSThreshold in second
	DefaultOOSThreshold = 300
	// DefaultHTTPPort default http port
	DefaultHTTPPort = 3000
	// DefaultNumBatch default number of init batch
	DefaultNumBatch = 8
)

Variables

This section is empty.

Functions

func Contains

func Contains(arr []string, item string) bool

Contains check if a slice contains a string

func MarshallTime

func MarshallTime(t *big.Int) []byte

MarshallTime marshall unix time to byte array

func MarshallTime2

func MarshallTime2(tm time.Time) []byte

MarshallTime2 time to byte array

func StrToTime

func StrToTime(str string) (time.Time, error)

StrToTime supports converting unix and iso8601 format to a time

func StrToUnixTimeInt

func StrToUnixTimeInt(str string) (*big.Int, error)

StrToUnixTimeInt unmarshall a unix time in string to unix time in big int

func UnmarshallIntToTime

func UnmarshallIntToTime(value *big.Int) time.Time

UnmarshallIntToTime unmarshall a unix time to time

func UnmarshallTime

func UnmarshallTime(value []byte) time.Time

UnmarshallTime unmarshall a time in byte array to time

func UnmarshallTimeToInt

func UnmarshallTimeToInt(value []byte) *big.Int

UnmarshallTimeToInt unmarshall a time in byte array to unix

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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