Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
878e5f23fd | ||
|
|
76077630aa | ||
|
|
a19ae3444a | ||
|
|
83d92719bb | ||
|
|
8df9fc4c58 | ||
|
|
03dc1e3201 | ||
|
|
33f65ae2a8 | ||
|
|
62fa7d504c | ||
|
|
42d3d8a398 | ||
|
|
45b20392af |
@ -6,7 +6,4 @@ python:
|
|||||||
- "3.3"
|
- "3.3"
|
||||||
# command to install dependencies
|
# command to install dependencies
|
||||||
install:
|
install:
|
||||||
- "pip install ."
|
|
||||||
- "pip install -r requirements.txt"
|
- "pip install -r requirements.txt"
|
||||||
# command to run tests
|
|
||||||
script: nosetests
|
|
||||||
|
|||||||
32
README.md
32
README.md
@ -1,5 +1,4 @@
|
|||||||
[ ](https://www.codeship.io/projects/12274)
|
# Description
|
||||||
#Description
|
|
||||||
Stratum-mining is a pooled mining protocol. It is a replacement for *getwork* based pooling servers by allowing clients to generate work. The stratum protocol is described [here](http://mining.bitcoin.cz/stratum-mining) in full detail.
|
Stratum-mining is a pooled mining protocol. It is a replacement for *getwork* based pooling servers by allowing clients to generate work. The stratum protocol is described [here](http://mining.bitcoin.cz/stratum-mining) in full detail.
|
||||||
|
|
||||||
This is a implementation of stratum-mining for scrypt based coins. It is compatible with *MPOS* as it complies with the standards of *pushpool*. The end goal is to build on these standards to come up with a more stable solution.
|
This is a implementation of stratum-mining for scrypt based coins. It is compatible with *MPOS* as it complies with the standards of *pushpool*. The end goal is to build on these standards to come up with a more stable solution.
|
||||||
@ -8,18 +7,7 @@ The goal is to make a reliable stratum mining server for a wide range of coins u
|
|||||||
|
|
||||||
**NOTE:** This fork is still in development. Many features may be broken. Please report any broken features or issues.
|
**NOTE:** This fork is still in development. Many features may be broken. Please report any broken features or issues.
|
||||||
|
|
||||||
#Donations
|
# Features
|
||||||
* BTC: 18Xg4qP6RUvpeajanKPt5PDvvcqvU2pP6d
|
|
||||||
* BTE: 8UJLskr8eDYATvYzmaCBw3vbRmeNweT3rW
|
|
||||||
* DGC: DSBb5KmGWYKMJjxk3rETtvpk9sPqgCCYAw
|
|
||||||
* LTC: Lg4kXMqPsmMHrGr81LLe8oHpbsMiWiuMSB
|
|
||||||
* WDC: WeVFgZQsKSKXGak7NJPp9SrcUexghzTPGJ
|
|
||||||
* Doge: DLtBRYtNCzfiZfcpUeEr8KPvy5k1aR7jca
|
|
||||||
* SRC: sMP2wHN5H2ik7FQDPjhSzFZUWux75BYZGe
|
|
||||||
* ARG: AQvXPWVqGzcpH2j2XSRG7X5R9nA3y9D9aQ
|
|
||||||
* Cryptsy Trade Key: ec13d183e304326ebd41258d6ae7188e303866fe
|
|
||||||
|
|
||||||
#Features
|
|
||||||
|
|
||||||
* Stratum Mining Pool
|
* Stratum Mining Pool
|
||||||
* Solved Block Confirmation
|
* Solved Block Confirmation
|
||||||
@ -36,7 +24,7 @@ The goal is to make a reliable stratum mining server for a wide range of coins u
|
|||||||
* Transaction Messaging Support
|
* Transaction Messaging Support
|
||||||
|
|
||||||
|
|
||||||
#Requirements
|
# Requirements
|
||||||
*stratum-mining* is built in python. I have been testing it with 2.7.3, but it should work with other versions. The requirements for running the software are below.
|
*stratum-mining* is built in python. I have been testing it with 2.7.3, but it should work with other versions. The requirements for running the software are below.
|
||||||
* Python 2.7+
|
* Python 2.7+
|
||||||
* python-twisted
|
* python-twisted
|
||||||
@ -62,25 +50,17 @@ Other coins have been known to work with this implementation. I have tested with
|
|||||||
* Quark
|
* Quark
|
||||||
* Securecoin
|
* Securecoin
|
||||||
|
|
||||||
#Installation
|
# Installation
|
||||||
|
|
||||||
The installation of this *stratum-mining* can be found in the Repo Wiki.
|
The installation of this *stratum-mining* can be found in the Repo Wiki.
|
||||||
|
|
||||||
#Contact
|
# Credits
|
||||||
I am available in the #MPOS, #crypto-expert, #digitalcoin, and #worldcoin channels on freenode.
|
|
||||||
Although i am willing to provide support through IRC please file issues on the repo.
|
|
||||||
Issues as a direct result of stratum will be helped with as much as possible
|
|
||||||
However issues related to a coin daemon's setup and other non stratum issues,
|
|
||||||
Please research and attempt to debug first.
|
|
||||||
|
|
||||||
|
|
||||||
#Credits
|
|
||||||
|
|
||||||
* Original version by Slush0 and ArtForz (original stratum code)
|
* Original version by Slush0 and ArtForz (original stratum code)
|
||||||
* More Features added by GeneralFault, Wadee Womersley, Viperaus, TheSeven and Moopless
|
* More Features added by GeneralFault, Wadee Womersley, Viperaus, TheSeven and Moopless
|
||||||
* Multi Algo, Vardiff, DB and MPOS support done by Ahmed_Bodi, penner42 and Obigal
|
* Multi Algo, Vardiff, DB and MPOS support done by Ahmed_Bodi, penner42 and Obigal
|
||||||
* Riecoin support implemented by gatra
|
* Riecoin support implemented by gatra
|
||||||
|
|
||||||
#License
|
# License
|
||||||
This software is provided AS-IS without any warranties of any kind. Please use at your own risk.
|
This software is provided AS-IS without any warranties of any kind. Please use at your own risk.
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# Add conf directory to python path.
|
# Add conf directory to python path.
|
||||||
# Configuration file is standard python module.
|
# Configuration file is standard python module.
|
||||||
import os, sys
|
import os, sys
|
||||||
sys.path = [os.path.join(os.getcwd(), 'conf'),os.path.join(os.getcwd(), 'externals', 'stratum-mining-proxy'),] + sys.path
|
sys.path = [os.path.join(os.getcwd(), 'conf'),os.path.join(os.getcwd(), '.'),os.path.join(os.getcwd(), 'externals', 'stratum-mining-proxy'),] + sys.path
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.application.service import Application, IProcess
|
from twisted.application.service import Application, IProcess
|
||||||
|
|||||||
@ -141,12 +141,16 @@ class BitcoinRPC(object):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def prevhash(self):
|
def prevhash(self):
|
||||||
resp = (yield self._call('getwork', []))
|
|
||||||
try:
|
try:
|
||||||
defer.returnValue(json.loads(resp)['result']['data'][8:72])
|
resp = (yield self._call('getblocktemplate', [{}]))
|
||||||
|
defer.returnValue(json.loads(resp)['result']['previousblockhash'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception("Cannot decode prevhash %s" % str(e))
|
if (str(e) == "500 Internal Server Error"):
|
||||||
raise
|
resp = (yield self._call('getblocktemplate', []))
|
||||||
|
defer.returnValue(json.loads(resp)['result']['previousblockhash'])
|
||||||
|
else:
|
||||||
|
log.exception("Cannot decode prevhash %s" % str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def validateaddress(self, address):
|
def validateaddress(self, address):
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class CoinbaseTransactionPOW(halfnode.CTransaction):
|
|||||||
tx_out.scriptPubKey = coinbaser.get_script_pubkey()
|
tx_out.scriptPubKey = coinbaser.get_script_pubkey()
|
||||||
|
|
||||||
if settings.COINDAEMON_TX == 'yes':
|
if settings.COINDAEMON_TX == 'yes':
|
||||||
self.strTxComment = "http://github.com/ahmedbodi/stratum-mining"
|
self.strTxComment = "RanchiMall mining"
|
||||||
self.vin.append(tx_in)
|
self.vin.append(tx_in)
|
||||||
self.vout.append(tx_out)
|
self.vout.append(tx_out)
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ class CoinbaseTransactionPOS(halfnode.CTransaction):
|
|||||||
|
|
||||||
self.nTime = ntime
|
self.nTime = ntime
|
||||||
if settings.COINDAEMON_SHA256_TX == 'yes':
|
if settings.COINDAEMON_SHA256_TX == 'yes':
|
||||||
self.strTxComment = "http://github.com/ahmedbodi/stratum-mining"
|
self.strTxComment = "RanchiMall mining"
|
||||||
self.vin.append(tx_in)
|
self.vin.append(tx_in)
|
||||||
self.vout.append(tx_out)
|
self.vout.append(tx_out)
|
||||||
|
|
||||||
|
|||||||
@ -31,3 +31,4 @@ simplejson==3.3.3
|
|||||||
six==1.4.1
|
six==1.4.1
|
||||||
wsgiref==0.1.2
|
wsgiref==0.1.2
|
||||||
zope.interface==4.1.0
|
zope.interface==4.1.0
|
||||||
|
stratum==0.2.15
|
||||||
|
|||||||
260
sql/base_structure.sql
Normal file
260
sql/base_structure.sql
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `accounts` (
|
||||||
|
`id` int(255) NOT NULL AUTO_INCREMENT,
|
||||||
|
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`is_anonymous` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`no_fees` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`username` varchar(40) NOT NULL,
|
||||||
|
`pass` varchar(255) NOT NULL,
|
||||||
|
`email` varchar(255) DEFAULT NULL COMMENT 'Assocaited email: used for validating users, and re-setting passwords',
|
||||||
|
`timezone` varchar(35) NOT NULL DEFAULT '415',
|
||||||
|
`notify_email` VARCHAR( 255 ) NULL DEFAULT NULL,
|
||||||
|
`loggedIp` varchar(255) DEFAULT NULL,
|
||||||
|
`is_locked` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`failed_logins` int(5) unsigned DEFAULT '0',
|
||||||
|
`failed_pins` int(5) unsigned DEFAULT '0',
|
||||||
|
`signup_timestamp` int(10) DEFAULT '0',
|
||||||
|
`last_login` int(10) DEFAULT NULL,
|
||||||
|
`pin` varchar(255) NOT NULL COMMENT 'four digit pin to allow account changes',
|
||||||
|
`api_key` varchar(255) DEFAULT NULL,
|
||||||
|
`token` varchar(65) DEFAULT NULL,
|
||||||
|
`donate_percent` float DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `username` (`username`),
|
||||||
|
UNIQUE KEY `email` (`email`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `blocks` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`height` int(10) unsigned NOT NULL,
|
||||||
|
`blockhash` char(65) NOT NULL,
|
||||||
|
`confirmations` int(10) NOT NULL,
|
||||||
|
`amount` double NOT NULL,
|
||||||
|
`difficulty` double NOT NULL,
|
||||||
|
`time` int(11) NOT NULL,
|
||||||
|
`accounted` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`account_id` int(255) unsigned DEFAULT NULL,
|
||||||
|
`worker_name` varchar(50) DEFAULT 'unknown',
|
||||||
|
`shares` double unsigned DEFAULT NULL,
|
||||||
|
`share_id` bigint(30) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `height` (`height`,`blockhash`),
|
||||||
|
KEY `time` (`time`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Discovered blocks persisted from Litecoin Service';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `coin_addresses` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`currency` varchar(5) NOT NULL,
|
||||||
|
`coin_address` varchar(255) NOT NULL,
|
||||||
|
`ap_threshold` float DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `coin_address` (`coin_address`),
|
||||||
|
KEY `account_id` (`account_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `invitations` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) unsigned NOT NULL,
|
||||||
|
`email` varchar(50) NOT NULL,
|
||||||
|
`token_id` int(11) NOT NULL,
|
||||||
|
`is_activated` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `monitoring` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(30) NOT NULL,
|
||||||
|
`type` varchar(15) NOT NULL,
|
||||||
|
`value` varchar(255) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `name` (`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Monitoring events from cronjobs';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `news` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(10) unsigned NOT NULL,
|
||||||
|
`header` varchar(255) NOT NULL,
|
||||||
|
`content` text NOT NULL,
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`active` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `notifications` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`type` varchar(25) NOT NULL,
|
||||||
|
`data` varchar(255) NOT NULL,
|
||||||
|
`active` tinyint(1) NOT NULL DEFAULT '1',
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`account_id` int(10) unsigned DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `active` (`active`),
|
||||||
|
KEY `data` (`data`),
|
||||||
|
KEY `account_id` (`account_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `notification_settings` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`type` varchar(15) NOT NULL,
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`active` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `account_id` (`account_id`),
|
||||||
|
UNIQUE KEY `account_id_type` (`account_id`,`type`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `payouts` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`completed` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `account_id` (`account_id`,`completed`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `pool_worker` (
|
||||||
|
`id` int(255) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(255) NOT NULL,
|
||||||
|
`username` char(50) DEFAULT NULL,
|
||||||
|
`password` char(255) DEFAULT NULL,
|
||||||
|
`difficulty` float NOT NULL DEFAULT '0',
|
||||||
|
`monitor` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `username` (`username`),
|
||||||
|
KEY `account_id` (`account_id`),
|
||||||
|
KEY `pool_worker_username` (`username`(10))
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `settings` (
|
||||||
|
`name` varchar(255) NOT NULL,
|
||||||
|
`value` text DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`name`),
|
||||||
|
UNIQUE KEY `setting` (`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO `settings` (`name`, `value`) VALUES ('DB_VERSION', '1.0.3');
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `shares` (
|
||||||
|
`id` bigint(30) NOT NULL AUTO_INCREMENT,
|
||||||
|
`rem_host` varchar(255) NOT NULL,
|
||||||
|
`username` varchar(120) NOT NULL,
|
||||||
|
`our_result` enum('Y','N') NOT NULL,
|
||||||
|
`upstream_result` enum('Y','N') DEFAULT NULL,
|
||||||
|
`reason` varchar(50) DEFAULT NULL,
|
||||||
|
`solution` varchar(257) NOT NULL,
|
||||||
|
`difficulty` float NOT NULL DEFAULT '0',
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `time` (`time`),
|
||||||
|
KEY `upstream_result` (`upstream_result`),
|
||||||
|
KEY `our_result` (`our_result`),
|
||||||
|
KEY `username` (`username`),
|
||||||
|
KEY `shares_username` (`username`(10))
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `shares_archive` (
|
||||||
|
`id` bigint(30) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`share_id` bigint(30) unsigned NOT NULL,
|
||||||
|
`username` varchar(120) NOT NULL,
|
||||||
|
`our_result` enum('Y','N') DEFAULT NULL,
|
||||||
|
`upstream_result` enum('Y','N') DEFAULT NULL,
|
||||||
|
`block_id` int(10) unsigned NOT NULL,
|
||||||
|
`difficulty` float NOT NULL DEFAULT '0',
|
||||||
|
`time` datetime NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `share_id` (`share_id`),
|
||||||
|
KEY `time` (`time`),
|
||||||
|
KEY `our_result` (`our_result`),
|
||||||
|
KEY `username` (`username`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Archive shares for potential later debugging purposes';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `statistics_shares` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(10) unsigned NOT NULL,
|
||||||
|
`block_id` int(10) unsigned NOT NULL,
|
||||||
|
`valid` float unsigned NOT NULL DEFAULT '0',
|
||||||
|
`invalid` float unsigned NOT NULL DEFAULT '0',
|
||||||
|
`pplns_valid` float unsigned NOT NULL DEFAULT '0',
|
||||||
|
`pplns_invalid` float unsigned NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `account_id` (`account_id`),
|
||||||
|
KEY `block_id` (`block_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `tokens` (
|
||||||
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`token` varchar(65) NOT NULL,
|
||||||
|
`type` tinyint(4) NOT NULL,
|
||||||
|
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `token` (`token`),
|
||||||
|
KEY `account_id` (`account_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `token_types` (
|
||||||
|
`id` tinyint(4) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(25) NOT NULL,
|
||||||
|
`expiration` INT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `name` (`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO `token_types` (`id`, `name`, `expiration`) VALUES
|
||||||
|
(1, 'password_reset', 3600),
|
||||||
|
(2, 'confirm_email', 0),
|
||||||
|
(3, 'invitation', 0),
|
||||||
|
(4, 'account_unlock', 0),
|
||||||
|
(5, 'account_edit', 3600),
|
||||||
|
(6, 'change_pw', 3600),
|
||||||
|
(7, 'withdraw_funds', 3600);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `transactions` (
|
||||||
|
`id` int(255) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(255) unsigned NOT NULL,
|
||||||
|
`type` varchar(25) DEFAULT NULL,
|
||||||
|
`coin_address` varchar(255) DEFAULT NULL,
|
||||||
|
`amount` decimal(50,30) DEFAULT '0',
|
||||||
|
`block_id` int(255) DEFAULT NULL,
|
||||||
|
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`txid` varchar(256) DEFAULT NULL,
|
||||||
|
`archived` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `block_id` (`block_id`),
|
||||||
|
KEY `account_id` (`account_id`),
|
||||||
|
KEY `type` (`type`),
|
||||||
|
KEY `archived` (`archived`),
|
||||||
|
KEY `account_id_archived` (`account_id`,`archived`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE `statistics_users` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`hashrate` bigint(20) unsigned NOT NULL,
|
||||||
|
`workers` int(11) NOT NULL,
|
||||||
|
`sharerate` float NOT NULL,
|
||||||
|
`timestamp` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `account_id_timestamp` (`account_id`,`timestamp`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_settings` (
|
||||||
|
`account_id` int(11) NOT NULL,
|
||||||
|
`name` varchar(50) NOT NULL,
|
||||||
|
`value` text DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`account_id`,`name`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
|
||||||
|
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
Loading…
Reference in New Issue
Block a user