Skip to content

Instantly share code, notes, and snippets.

@time0x
Last active August 25, 2020 08:12
Show Gist options
  • Save time0x/e5a153ab1a57f8aa6a3bbdcf259fef17 to your computer and use it in GitHub Desktop.
Save time0x/e5a153ab1a57f8aa6a3bbdcf259fef17 to your computer and use it in GitHub Desktop.
-- Adminer 4.2.4 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `stats_pool_day`;
CREATE TABLE `stats_pool_day` (
`day` int(11) NOT NULL COMMENT '格式为:20200821',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '一天内矿池矿机的“接受Share”难度之和',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '一天内矿池矿机提交的过时share的难度之和',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '一天内矿池矿机的“拒绝Share”难度之和',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '拒绝率,单位是1,例如值是0.0014,则拒绝率为0.0014*100%=0.146%',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '预期爆块数,矿池某天的预期爆块数为5个,但是爆了6个,幸运值为:6÷5×100%=120%',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '收益,矿池应发给所有用户的PPS收益之和。收益的单位是各个区块链的最小可分割金额,比如比特币是聪,以太坊是wei。',
`lucky` double NOT NULL DEFAULT '0' COMMENT '',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `stats_pool_hour`;
CREATE TABLE `stats_pool_hour` (
`hour` int(11) NOT NULL COMMENT '时间(小时) ,比如2019080811,表示2019年8月8日11点',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '接受份额,用于计算矿池每小时算力',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '矿机提交的过时share的难度之和',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '拒绝份额,与接受份额相对应',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '拒绝率',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '预期爆块数,用来计算幸运值',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '收益,同上',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `hour` (`hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `stats_users_day`;
CREATE TABLE `stats_users_day` (
`puid` int(11) NOT NULL COMMENT '用户id',
`day` int(11) NOT NULL COMMENT '日期,比如20190808,表示2019年8月8日',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '预期爆块数,用来计算幸运值',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '矿池该日应当发给该用户的PPS收益',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `puid_day` (`puid`,`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `stats_users_hour`;
CREATE TABLE `stats_users_hour` (
`puid` int(11) NOT NULL COMMENT '',
`hour` int(11) NOT NULL COMMENT '',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `puid_hour` (`puid`,`hour`),
KEY `hour` (`hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `stats_workers_day`;
CREATE TABLE `stats_workers_day` (
`puid` int(11) NOT NULL COMMENT '用户id',
`worker_id` bigint(20) NOT NULL COMMENT '矿机id,用来区别不同的矿机。worker_id是矿机名的hash值',
`day` int(11) NOT NULL COMMENT '',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `puid_worker_id_day` (`puid`,`worker_id`,`day`),
KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `stats_workers_hour`;
CREATE TABLE `stats_workers_hour` (
`puid` int(11) NOT NULL COMMENT '',
`worker_id` bigint(20) NOT NULL COMMENT '',
`hour` int(11) NOT NULL COMMENT '',
`share_accept` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_stale` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`share_reject` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`reject_rate` double NOT NULL DEFAULT '0' COMMENT '',
`score` decimal(35,25) NOT NULL DEFAULT '0.0000000000000000000000000' COMMENT '',
`earn` decimal(35,0) NOT NULL DEFAULT '0' COMMENT '',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `puid_worker_id_hour` (`puid`,`worker_id`,`hour`),
KEY `hour` (`hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment