etc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TablePrefix = "etc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                      int64                `xorm:"id bigint autoincr pk"`
	Address                 string               `xorm:"address char(40) notnull unique index"`             //账户地址
	Type                    int                  `xorm:"type tinyint notnull default '0'"`                  //账户类型
	DeadAccount             int                  `xorm:"dead_account smallint notnull default '0' "`        //死账户
	Balance                 math.HexOrDecimal256 `xorm:"balance decimal(30,0) notnull default '0'"`         //账户余额
	Creator                 string               `xorm:"creator char(40) notnull default ''"`               //合约部署者
	ContractCreateTimestamp int64                `xorm:"contract_create_timestamp int notnull default '0'"` //合约创建时间
	MinerCount              int                  `xorm:"miner_count int notnull default '0'"`               //矿工挖到的块数
	MinerUncleCount         int                  `xorm:"miner_uncle_count int notnull default '0'"`         //矿工挖到的叔块数量
	BirthTimestamp          int64                `xorm:"birth_timestamp int notnull default '0' "`          //账户第一次出现的时间
	LastActiveTimestamp     int64                `xorm:"last_active_timestamp int notnull default '0'"`     //账户上次活跃时间
}

func (Account) TableName

func (t Account) TableName() string

type Balance

type Balance struct {
	ID        int64                `xorm:"id  bigint  autoincr pk"`
	Address   string               `xorm:"address char(40) notnull"`                  //账户地址
	Balance   math.HexOrDecimal256 `xorm:"balance decimal(30,0) notnull default '0'"` //账户余额
	Timestamp int64                `xorm:"timestamp int "`
}

func (Balance) TableName

func (t Balance) TableName() string

type Block

type Block struct {
	ID                     int64                `xorm:"id bigint autoincr pk"`
	Height                 int64                `xorm:"height int notnull unique index"`
	Hash                   string               `xorm:"hash char(64) notnull index"`
	ParentHash             string               `xorm:"parent_hash char(64) notnull"`
	SHA3Uncles             string               `xorm:"sha3_uncles char(64) notnull"`
	Nonce                  string               `xorm:"nonce char(16) notnull"`
	MixHash                string               `xorm:"mix_hash char(64) notnull"`
	Miner                  string               `xorm:"miner char(40) not null"`
	PoolName               string               `xorm:"pool_name varchar(50) notnull index default ''"`
	Timestamp              int64                `xorm:"timestamp int notnull index"`
	ExtraData              string               `xorm:"extra_data varchar(64) notnull"`
	LogsBloom              string               `xorm:"logs_bloom varchar(512) notnull"`
	TransactionRoot        string               `xorm:"transactions_root char(64) notnull"`
	StateRoot              string               `xorm:"state_root char(64) notnull"`
	ReceiptsRoot           string               `xorm:"receipts_root char(64) notnull"`
	GasUsed                int64                `xorm:"gas_used bigint notnull"`
	GasLimit               int64                `xorm:"gas_limit bigint notnull"`
	Difficulty             math.HexOrDecimal256 `xorm:"difficulty decimal(38,0) notnull"`
	TotalDifficulty        math.HexOrDecimal256 `xorm:"total_difficulty decimal(38,0) notnull"`
	RealDifficulty         float64              `xorm:"real_difficulty double notnull"`
	Size                   int64                `xorm:"size int notnull"`
	UncleLen               int                  `xorm:"uncle_len tinyint notnull"`
	TransactionLen         int                  `xorm:"tx_len int notnull"`
	ContractTransactionLen int                  `xorm:"contract_tx_len int notnull"`
	BlockReward            math.HexOrDecimal256 `xorm:"block_reward decimal(30,0) notnull"`
	BlockUncleReward       uint64               `xorm:"block_uncle_reward bigint notnull"`
}

func (Block) TableName

func (t Block) TableName() string

type Meta

type Meta struct {
	ID          int64     `xorm:"id bigint autoincr pk"`
	Name        string    `xorm:"name varchar(255) notnull unique"`
	LastID      int64     `xorm:"last_id bigint notnull"`
	Count       int64     `xorm:"count bigint notnull"`
	CreatedTime time.Time `xorm:"created_time created notnull"`
	UpdatedTime time.Time `xorm:"updated_time updated notnull"`
}

func (Meta) TableName

func (t Meta) TableName() string

type StatisticsDay

type StatisticsDay struct {
	ID                   int64                `xorm:"id bigint autoincr pk"`
	Timestamp            int64                `xorm:"timestamp int notnull unique index"`
	BlockNum             int64                `xorm:"block_num bigint notnull default '0'"`
	BlockChainNum        int64                `xorm:"block_chain_num bigint notnull default '0'"`
	BlockUncleNum        int64                `xorm:"block_uncle_num bigint notnull default '0'"`
	BlockSizeSum         int64                `xorm:"block_size_sum bigint notnull default '0'"`
	BlockSizeAvg         float64              `xorm:"block_size_avg double notnull default '0'"`
	BlockTimeSpent       float64              `xorm:"block_time_spent double notnull default '0'"`
	DifficultySum        float64              `xorm:"difficulty_sum double notnull default '0'"`
	ForkNum              int                  `xorm:"fork_number int notnull default '0'"`
	TxRate               float64              `xorm:"tx_rate double notnull default '0'"`
	TxCount              int                  `xorm:"tx_count int notnull default '0'"`
	TxValueSum           float64              `xorm:"tx_value_sum Decimal(30,0) notnull default '0'"`
	TxValueAvg           float64              `xorm:"tx_value_avg Decimal(30,4) notnull default '0'"`
	TxGasLimitAvg        float64              `xorm:"tx_gaslimit_avg double notnull default '0'"`
	TxGasUsedAvg         float64              `xorm:"tx_gasused_avg double notnull default '0'"`
	TxGasPriceAvg        float64              `xorm:"tx_gasprice_avg double notnull default '0'"`
	Miner                int                  `xorm:"miner int  notnull default '0'"`
	NewMiner             int                  `xorm:"new_miner int  notnull default '0'"`
	TotalMinerUpToNow    int64                `xorm:"total_miner_uptonow bigint notnull default '0'"`
	TxFeeAvg             float64              `xorm:"tx_fee_avg decimal(30,4) notnull default '0'"`
	BlockGaslimitAvg     float64              `xorm:"block_gaslimit_avg double notnull default '0'"`
	BlockGasusedAvg      float64              `xorm:"block_gasused_avg double notnull default '0'"`
	BlockFeeAvg          float64              `xorm:"block_fee_avg double notnull default '0'"`
	BlockRewardAvg       float64              `xorm:"block_reward_avg double notnull default '0'"`
	ReferenceUncleReward float64              `xorm:"block_reference_rwd double notnull default '0'"`
	UncleGasLimitAvg     float64              `xorm:"uncle_gaslimit_avg double notnull default '0'"`
	UncleGasusedAvg      float64              `xorm:"uncle_gasused_avg double notnull default '0'"`
	UncleRewardAvg       float64              `xorm:"uncle_reward_avg double notnull default '0'"`
	NewAddressCount      int64                `xorm:"new_address_count int  notnull default '0'"`
	TotalAddressUpToNow  int64                `xorm:"total_address_uptonow int  notnull default '0'"`
	ActiveAddressCount   int64                `xorm:"active_address_count int  notnull default '0'"`
	TxAddressCntAvg      float64              `xorm:"tx_address_cnt_avg double notnull default '0'"`
	TxAddressValueAvg    float64              `xorm:"tx_address_value_avg decimal(30,4) notnull default '0'"`
	TotalCoin            math.HexOrDecimal256 `xorm:"total_coin decimal(38,0) notnull default '0'"`
	Price                float64              `xorm:"price double notnull default '0'"`
	MarketValue          float64              `xorm:"market_value double notnull default '0'"`
	StoreRate            float64              `xorm:"store_rate double notnull default '0'"`
	RatioOfMarketValue   float64              `xorm:"ratio_of_market_value double notnull default '0'"`
	ContractTxNum        int64                `xorm:"contract_tx_num int  notnull default '0'"`
}

func (StatisticsDay) TableName

func (t StatisticsDay) TableName() string

type StatisticsDayBlock

type StatisticsDayBlock struct {
	ID                       int64                `xorm:"id bigint autoincr pk"`
	Timestamp                int64                `xorm:"timestamp int notnull unique index"`
	BlockCount               int64                `xorm:"block_count bigint notnull default '0'"`
	BlockSizeSum             int64                `xorm:"block_size_sum bigint notnull default '0'"`
	BlockSizeAvg             float64              `xorm:"block_size_avg decimal(38,4) notnull default '0'"`
	BlockTimeSpent           float64              `xorm:"block_time_spent decimal(38,4) notnull default '0'"`
	DifficultySum            float64              `xorm:"difficulty_sum decimal(38,4) notnull default '0'"`
	ForkNumber               int                  `xorm:"fork_number int notnull default '0'"`
	MinerCount               int                  `xorm:"miner_count int notnull default '0'"`
	TotalMinerCount          int64                `xorm:"total_miner_count bigint notnull default '0'"`
	BlockGasLimitAvg         float64              `xorm:"block_gas_limit_avg decimal(38,4) notnull default '0'"`
	BlockGasUsedAvg          float64              `xorm:"block_gas_used_avg decimal(38,4) notnull default '0'"`
	BlockFeeAvg              float64              `xorm:"block_fee_avg decimal(38,4) notnull default '0'"`
	BlockRewardAvg           float64              `xorm:"block_reward_avg decimal(38,4) notnull default '0'"`
	BlockRefereneceRewardAvg float64              `xorm:"block_reference_reward_avg decimal(38,4) notnull default '0'"`
	UncleGasLimitAvg         float64              `xorm:"uncle_gas_limit_avg decimal(38,4) notnull default '0'"`
	UncleGasUsedAvg          float64              `xorm:"uncle_gas_used_avg decimal(38,4) notnull default '0'"`
	UncleRewardAvg           float64              `xorm:"uncle_reward_avg decimal(38,4) notnull default '0'"`
	Supply                   math.HexOrDecimal256 `xorm:"supply decimal(38,0) notnull default '0'"`
	MinerFeeMid              int64                `xorm:"miner_fee_mid bigint notnull default '0'"`
}

CREATE TABLE `eth_calc_daily` (

`id`                   INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`date`                 datetime         NOT NULL COMMENT '日期',
`block_size_sum`       INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '区块链总体积',
`block_size_avg`       DOUBLE           NOT NULL DEFAULT '0' COMMENT '区块体积平均大小',
`difficulty_sum`       DOUBLE           NOT NULL DEFAULT '0' COMMENT '全网算力',
`block_time_spent`     DOUBLE           NOT NULL DEFAULT '0' COMMENT '区块产生时间',
`tx_rate`              DOUBLE           NOT NULL DEFAULT '0' COMMENT '交易速率',
`tx_count`             INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '交易次数',
`tx_value_sum`         DECIMAL(30,0)    NOT NULL DEFAULT '0' COMMENT '交易金额',
`tx_value_avg`         DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '交易金额平均值',
`tx_gaslimit_avg`      DOUBLE           NOT NULL DEFAULT '0' COMMENT '交易gaspro',
`tx_gasused_avg`       DOUBLE           NOT NULL DEFAULT '0' COMMENT '交易gasused',
`tx_gasprice_avg`      DOUBLE           NOT NULL DEFAULT '0' COMMENT '交易gasprice',
`miner`                INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已获奖励矿工数量',
`tx_fee_avg`           DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '交易矿工费平均值',
`block_gaslimit_avg`   DOUBLE           NOT NULL DEFAULT '0' COMMENT '区块gaslimit平均值',
`block_gasused_avg`    DOUBLE           NOT NULL DEFAULT '0' COMMENT '区块gasused平均值',
`block_profit_avg`     DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '区块矿工总收益平均值',
`block_fee_avg`        DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '区块交易费平均值',
`block_reward_avg`     DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '区块奖励平均值',
`uncle_gaslimit_avg`   DOUBLE           NOT NULL DEFAULT '0' COMMENT '叔块gaslimit平均值',
`uncle_gasused_avg`    DOUBLE           NOT NULL DEFAULT '0' COMMENT '叔块gasused平均值',
`uncle_reward_avg`     DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '叔块矿工总收益平均值',
`new_address_count`    INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '每日新增账户数',
`total_address_uptonow`INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '每日总的账户'
`active_address_count` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '日活',
`tx_address_cnt_avg`   DOUBLE           NOT NULL DEFAULT '0' COMMENT '每日参与交易的交易地址的交易次数的平均值',
`tx_address_value_avg` DECIMAL(30,4)    NOT NULL DEFAULT '0' COMMENT '每日参与交易的交易地址的交易金额的平均值',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_date` (`date`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

func (StatisticsDayBlock) TableName

func (t StatisticsDayBlock) TableName() string

type StatisticsDayTokenTransaction

type StatisticsDayTokenTransaction struct {
	ID                         int64                `xorm:"id bigint autoincr pk"`
	Timestamp                  int64                `xorm:"timestamp int notnull unique(IDX_eth_token_address)"`
	TokenAddress               string               `xorm:"token_address char(40) notnull unique(IDX_eth_token_address)"`
	Count                      int64                `xorm:"count int notnull default '0'"`
	ValueSum                   math.HexOrDecimal256 `xorm:"value_sum decimal(38,0) notnull default '0'"`
	ValueAvg                   float64              `xorm:"value_avg decimal(38,4) notnull default '0'"`
	StoreRate                  float64              `xorm:"store_rate decimal(38,4) notnull default '0'"`
	MarketValueRatio           float64              `xorm:"market_value_ratio decimal(38,4) notnull default '0'"`
	AddressCount               int64                `xorm:"address_count int notnull default '0'"`
	TotalAddressCount          int64                `xorm:"total_address_count int notnull default '0'"`
	ActiveAddressCount         int64                `xorm:"active_address_count int notnull default '0'"`
	AddressTransactionCountAvg float64              `xorm:"address_tx_count_avg decimal(38,4) notnull default '0'"`
	AddressTransactionValueAvg float64              `xorm:"address_tx_value_avg decimal(38,4) notnull default '0'"`
}

func (StatisticsDayTokenTransaction) TableName

func (t StatisticsDayTokenTransaction) TableName() string

type StatisticsDayTransaction

type StatisticsDayTransaction struct {
	ID                         int64                `xorm:"id bigint autoincr pk"`
	Timestamp                  int64                `xorm:"timestamp int notnull unique index"`
	Count                      int                  `xorm:"count int notnull default '0'"`
	Rate                       float64              `xorm:"rate decimal(38,4) notnull default '0'"`
	ValueSum                   math.HexOrDecimal256 `xorm:"value_sum decimal(38,0) notnull default '0'"`
	ValueAvg                   float64              `xorm:"value_avg decimal(38,4) notnull default '0'"`
	GasLimitAvg                float64              `xorm:"gas_limit_avg decimal(38,4) notnull default '0'"`
	GasUsedAvg                 float64              `xorm:"gas_used_avg decimal(38,4) notnull default '0'"`
	GasPriceAvg                float64              `xorm:"gas_price_avg decimal(38,4) notnull default '0'"`
	FeeAvg                     float64              `xorm:"fee_avg decimal(38,4) notnull default '0'"`
	AddressCount               int64                `xorm:"address_count int notnull default '0'"`
	TotalAddressCount          int64                `xorm:"total_address_count int notnull default '0'"`
	ActiveAddressCount         int64                `xorm:"active_address_count int  notnull default '0'"`
	SleepAddressCount          int64                `xorm:"sleep_address int notnull default '0'"`
	AddressTransactionCountAvg float64              `xorm:"address_tx_count_avg decimal(38,4) notnull default '0'"`
	AddressTransactionValueAvg float64              `xorm:"address_tx_value_avg decimal(38,4) notnull default '0'"`
	ContractTransactionCount   int64                `xorm:"contract_tx_count int notnull default '0'"`
	StoreRate                  float64              `xorm:"store_rate decimal(38,4) notnull default '0'"`
	MarketValueRatio           float64              `xorm:"market_value_ratio decimal(38,4) notnull default '0'"`
	SizeAvg                    float64              `xorm:"size_avg decimal(38,4) notnull default '0'"`
	SizeFeeAvg                 float64              `xorm:"size_fee_avg decimal(38,4) notnull default '0'"`
	FreshRate                  float64              `xorm:"fresh_rate decimal(38,4) notnull default '0'"`
}

func (StatisticsDayTransaction) TableName

func (t StatisticsDayTransaction) TableName() string

type Token

type Token struct {
	ID            int64  `xorm:"id bigint autoincr pk"`
	TokenAddress  string `xorm:"token_address char(40) notnull unique index"`
	DecimalLength int64  `xorm:"decimal_len int notnull"`
	Name          string `xorm:"name varchar(128) notnull"`
	Symbol        string `xorm:"symbol varchar(128) notnull"`
	TotalSupply   string `xorm:"total_supply varchar(128) null"` // follows attribute temerally can't obtain
	Owner         string `xorm:"owner char(40) notnull"`
	Timestamp     int64  `xorm:"timestamp int notnull index"`
}

func (Token) TableName

func (t Token) TableName() string

type TokenAccount

type TokenAccount struct {
	ID                  int64                `xorm:"id bigint autoincr pk"`
	Address             string               `xorm:"address char(40) notnull unique(IDX_eth_token_address)"` //账户地址
	TokenAddress        string               `xorm:"token_address char(40) notnull unique(IDX_eth_token_address)"`
	Balance             math.HexOrDecimal256 `xorm:"balance decimal(38,0) notnull default '0'"`     //账户余额
	BirthTimestamp      int64                `xorm:"birth_timestamp int notnull default '0' "`      //账户第一次出现的时间
	LastActiveTimestamp int64                `xorm:"last_active_timestamp int notnull default '0'"` //账户上次活跃时间
}

func (TokenAccount) TableName

func (t TokenAccount) TableName() string

type TokenTransaction

type TokenTransaction struct {
	ID                     int64                `xorm:"id bigint autoincr pk"`
	BlockHeight            int64                `xorm:"block_height int index"`
	ParentTransactionHash  string               `xorm:"parent_hash char(64) notnull index"`
	ParentTransactionIndex int64                `xorm:"parent_tx_index smallint notnull"`
	From                   string               `xorm:"from char(40) notnull index"`
	To                     string               `xorm:"to char(40) notnull index"`
	Value                  math.HexOrDecimal256 `xorm:"value decimal(38,0) notnull"`
	Timestamp              int64                `xorm:"timestamp int notnull index"`
	TokenAddress           string               `xorm:"token_address char(40) notnull"`
	LogIndex               int64                `xorm:"log_index int notnull"`
}

func (TokenTransaction) TableName

func (t TokenTransaction) TableName() string

type Transaction

type Transaction struct {
	ID                    int64                `xorm:"id bigint autoincr pk"`
	Hash                  string               `xorm:"hash char(64) notnull index"`
	BlockHeight           int64                `xorm:"block_height int index"`
	From                  string               `xorm:"from char(40) notnull index"`
	To                    string               `xorm:"to char(40) notnull index"`
	ContractAddress       string               `xorm:"contract_address char(40) notnull index"`
	Value                 math.HexOrDecimal256 `xorm:"value decimal(30,0) notnull"`
	Timestamp             int64                `xorm:"timestamp int notnull index"`
	Gas                   int64                `xorm:"gas bigint notnull"`
	GasPrice              int64                `xorm:"gas_price bigint notnull"`
	GasUsed               int64                `xorm:"gas_used bigint notnull"`
	CumulativeGasUsed     int64                `xorm:"cumulative_gas_used bigint notnull"`
	Nonce                 int                  `xorm:"nonce int notnull"`
	TransactionBlockIndex int                  `xorm:"tx_block_index smallint notnull"`
	Status                uint                 `xorm:"status tinyint notnull"`
	Type                  int                  `xorm:"type tinyint notnull"`
	Root                  string               `xorm:"root char(64) notnull"`
	ChainID               int                  `xorm:"chain_id int notnull"`
	LogLen                int                  `xorm:"log_len int notnull"`
	ReplayProtected       bool                 `xorm:"replay_protected tinyint notnull"`
}

func (Transaction) TableName

func (t Transaction) TableName() string

type Uncle

type Uncle struct {
	ID              int64                `xorm:"id bigint autoincr pk"`
	Height          int64                `xorm:"height int notnull index"`
	Hash            string               `xorm:"hash char(64) notnull index"`
	BlockHeight     int64                `xorm:"block_height int notnull index"`
	ParentHash      string               `xorm:"parent_hash char(64) notnull"`
	Sha3uncles      string               `xorm:"sha3_uncles char(64) notnull"`
	Nonce           string               `xorm:"nonce char(16) notnull"`
	MixHash         string               `xorm:"mix_hash char(64) notnull"`
	Miner           string               `xorm:"miner char(40) not null"`
	PoolName        string               `xorm:"pool_name varchar(50) notnull default ''"`
	Timestamp       int64                `xorm:"timestamp int notnull index"`
	ExtraData       string               `xorm:"extra_data varchar(64) notnull"`
	LogsBloom       string               `xorm:"logs_bloom varchar(512) notnull"`
	TransactionRoot string               `xorm:"transactions_root char(64) notnull"`
	StateRoot       string               `xorm:"state_root char(64) notnull"`
	ReceiptsRoot    string               `xorm:"receipt_root char(64) notnull"`
	GasUsed         int64                `xorm:"gas_used bigint notnull"`
	GasLimit        int64                `xorm:"gas_limit bigint notnull"`
	UncleIndex      int                  `xorm:"uncle_index tinyint notnull"`
	Difficulty      int64                `xorm:"difficulty bigint notnull"`
	TotalDifficulty math.HexOrDecimal256 `xorm:"total_difficulty decimal(30,0) notnull"`
	Size            int64                `xorm:"size int notnull"`
	UncleLen        int                  `xorm:"uncle_len tinyint notnull"`
	Reward          uint64               `xorm:"reward bigint notnull"`
}

func (Uncle) TableName

func (t Uncle) TableName() string

Jump to

Keyboard shortcuts

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