Skip to content

Instantly share code, notes, and snippets.

@time0x
Last active August 25, 2020 07:38
Show Gist options
  • Save time0x/dc3149ed3f10e2d7f77291608add16ca to your computer and use it in GitHub Desktop.
Save time0x/dc3149ed3f10e2d7f77291608add16ca 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 `found_blocks`;
CREATE TABLE `found_blocks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`puid` int(11) NOT NULL COMMENT '用户id,用来记录是哪个用户爆了块',
`worker_id` bigint(20) NOT NULL COMMENT '矿机id,用来记录是哪个矿机爆了块',
`worker_full_name` varchar(50) NOT NULL COMMENT '矿工全名,用于显示是谁爆了块',
`job_id` bigint(20) unsigned NOT NULL COMMENT '任务id,爆块的挖矿任务的id',
`height` int(11) NOT NULL COMMENT '挖到的区块的高度',
`is_orphaned` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否为孤块,BTCPool不更新这个数据,但可以自行编写脚本,查询区块浏览器来确定爆块是否成功,然后更新这个字段',
`hash` char(64) NOT NULL COMMENT '挖到的区块的hash',
`rewards` bigint(20) NOT NULL COMMENT '挖到的区块所包含的奖励',
`size` int(11) NOT NULL COMMENT '挖到的区块的大小',
`prev_hash` char(64) NOT NULL COMMENT '挖到的这个区块的父区块hash',
`bits` int(10) unsigned NOT NULL COMMENT '是Target的压缩形式',
`version` int(11) NOT NULL COMMENT '挖到的比特币区块的版本',
`created_at` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `hash` (`hash`),
KEY `height` (`height`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `found_nmc_blocks`;
CREATE TABLE `found_nmc_blocks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bitcoin_block_hash` char(64) NOT NULL COMMENT '联合挖矿的父区块hash',
`aux_block_hash` char(64) NOT NULL COMMENT '联合挖矿的任务hash',
`aux_pow` text NOT NULL COMMENT '联合挖矿的工作量证明数据',
`is_orphaned` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否为孤块',
`chain_name` varchar(20) NOT NULL DEFAULT '' COMMENT '链名称',
`submit_response` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`created_at` datetime NOT NULL COMMENT '',
PRIMARY KEY (`id`),
UNIQUE KEY `aux_block_hash` (`aux_block_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `mining_workers`;
CREATE TABLE `mining_workers` (
`worker_id` bigint(20) NOT NULL COMMENT '矿工id',
`puid` int(11) NOT NULL COMMENT '用户id',
`group_id` int(11) NOT NULL COMMENT '分组id',
`worker_name` varchar(50) DEFAULT NULL COMMENT '矿工名 ',
`accept_1m` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近1分钟内接受的share的难度之和',
`accept_5m` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近5分钟内接受的share的难度之和',
`accept_15m` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近15分钟内接受的share的难度之和',
`stale_15m` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_15m` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近15分钟内拒绝的share的难度之和',
`reject_detail_15m` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`accept_1h` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近1小时内接受的share的难度之和 ',
`stale_1h` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
`reject_1h` bigint(20) NOT NULL DEFAULT '0' COMMENT '最近1小时内拒绝的share的难度之和 ',
`reject_detail_1h` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`accept_count` int(11) NOT NULL DEFAULT '0' COMMENT '接受的share的个数(不是难度),用于显示给用户看,表示矿机在正常提交',
`last_share_ip` char(16) NOT NULL DEFAULT '0.0.0.0' COMMENT '最后提交share的ip地址,如果只是连接矿池没有提交share,不会被记录',
`last_share_time` timestamp NOT NULL DEFAULT '1970-01-01 00:00:01' COMMENT '最后提交share的时间',
`miner_agent` varchar(30) DEFAULT NULL COMMENT '挖矿程序的名称字符串:比如蚂蚁矿机是“bmminer/xxx”',
`created_at` timestamp NULL DEFAULT NULL COMMENT '',
`updated_at` timestamp NULL DEFAULT NULL COMMENT '',
UNIQUE KEY `puid_worker_id` (`puid`,`worker_id`),
KEY `puid_group_id` (`puid`,`group_id`),
KEY `puid_worker_name` (`puid`,`worker_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment