mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
sha256t algo + fix sha/decred pool hashrate axis
This commit is contained in:
parent
495e3a51df
commit
be1064a25b
9 changed files with 75 additions and 2 deletions
1
rc.local
1
rc.local
|
@ -33,6 +33,7 @@ screen -dmS timetravel $STRATUM_DIR/run.sh timetravel
|
|||
screen -dmS hmq1725 $STRATUM_DIR/run.sh hmq1725
|
||||
|
||||
screen -dmS sha $STRATUM_DIR/run.sh sha
|
||||
screen -dmS sha256t $STRATUM_DIR/run.sh sha256t
|
||||
screen -dmS scrypt $STRATUM_DIR/run.sh scrypt
|
||||
screen -dmS scryptn $STRATUM_DIR/run.sh scryptn
|
||||
screen -dmS luffa $STRATUM_DIR/run.sh luffa
|
||||
|
|
|
@ -9,7 +9,7 @@ CFLAGS= $(CXXFLAGS) -std=gnu99
|
|||
LDFLAGS=-O2 -lgmp
|
||||
|
||||
SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2z.c Sponge.c \
|
||||
blake.c scrypt.c c11.c x11.c x13.c sha256.c keccak.c deep.c \
|
||||
blake.c scrypt.c c11.c x11.c x13.c sha256.c sha256t.c keccak.c deep.c \
|
||||
x14.c x15.c x17.c nist5.c fresh.c quark.c neoscrypt.c scryptn.c qubit.c skein.c groestl.c \
|
||||
timetravel.c xevan.c hmq17.c \
|
||||
skein2.c zr5.c bmw.c luffa.c pentablake.c whirlpool.c whirlpoolx.c blakecoin.c \
|
||||
|
|
28
stratum/algos/sha256t.c
Normal file
28
stratum/algos/sha256t.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "sha256.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void sha256t_hash(const char* input, char* output, uint32_t len)
|
||||
{
|
||||
unsigned char hash[64];
|
||||
|
||||
SHA256_CTX ctx_sha256;
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, input, len);
|
||||
SHA256_Final(hash, &ctx_sha256);
|
||||
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, hash, 32);
|
||||
SHA256_Final(hash, &ctx_sha256);
|
||||
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, hash, 32);
|
||||
SHA256_Final((unsigned char*)output, &ctx_sha256);
|
||||
}
|
||||
|
16
stratum/algos/sha256t.h
Normal file
16
stratum/algos/sha256t.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef SHA256T_H
|
||||
#define SHA256T_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void sha256t_hash(const char* input, char* output, uint32_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
17
stratum/config.sample/sha256t.conf
Normal file
17
stratum/config.sample/sha256t.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
[TCP]
|
||||
server = yaamp.com
|
||||
port = 3339
|
||||
password = tu8tu5
|
||||
|
||||
[SQL]
|
||||
host = yaampdb
|
||||
database = yaamp
|
||||
username = root
|
||||
password = patofpaq
|
||||
|
||||
[STRATUM]
|
||||
algo = sha256t
|
||||
difficulty = 1
|
||||
max_ttf = 40000
|
||||
reconnect = 1
|
||||
|
|
@ -141,6 +141,8 @@ YAAMP_ALGO g_algos[] =
|
|||
{"velvet", velvet_hash, 0x10000, 0, 0},
|
||||
{"argon2", argon2_hash, 0x10000, 0, sha256_hash_hex },
|
||||
|
||||
{"sha256t", sha256t_hash, 1, 0, 0}, // sha256 3x
|
||||
|
||||
{"sib", sib_hash, 1, 0, 0},
|
||||
|
||||
{"whirlcoin", whirlpool_hash, 1, 0, sha256_hash_hex }, /* old sha merkleroot */
|
||||
|
|
|
@ -151,6 +151,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
|
|||
#include "algos/groestl.h"
|
||||
#include "algos/skein.h"
|
||||
#include "algos/keccak.h"
|
||||
#include "algos/sha256t.h"
|
||||
#include "algos/timetravel.h"
|
||||
|
||||
#include "algos/bmw.h"
|
||||
|
|
|
@ -5,6 +5,7 @@ function yaamp_get_algos()
|
|||
/* Toggle Site Algos Here */
|
||||
return array(
|
||||
'sha256',
|
||||
'sha256t',
|
||||
'scrypt',
|
||||
'scryptn',
|
||||
'argon2',
|
||||
|
@ -56,6 +57,7 @@ function yaamp_algo_mBTC_factor($algo)
|
|||
{
|
||||
switch($algo) {
|
||||
case 'sha256':
|
||||
case 'sha256t':
|
||||
case 'blake':
|
||||
case 'blakecoin':
|
||||
case 'blake2s':
|
||||
|
@ -108,6 +110,7 @@ function getAlgoColors($algo)
|
|||
{
|
||||
$a = array(
|
||||
'sha256' => '#d0d0a0',
|
||||
'sha256t' => '#d0d0f0',
|
||||
'scrypt' => '#c0c0e0',
|
||||
'neoscrypt' => '#a0d0f0',
|
||||
'scryptn' => '#d0d0d0',
|
||||
|
@ -163,6 +166,7 @@ function getAlgoPort($algo)
|
|||
{
|
||||
$a = array(
|
||||
'sha256' => 3333,
|
||||
'sha256t' => 3339,
|
||||
'lbry' => 3334,
|
||||
'scrypt' => 3433,
|
||||
'timetravel' => 3555,
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
/* Graph shown in Pool Tab, Last 24 Hours algo hashrate */
|
||||
|
||||
$percent = 16;
|
||||
$algo = user()->getState('yaamp-algo');
|
||||
$factor = yaamp_algo_mBTC_factor($algo); // 1000 sha (GH/s), 1 for normal MH/s
|
||||
|
||||
$step = 15*60;
|
||||
$t = time() - 24*60*60;
|
||||
|
@ -22,7 +25,8 @@ for($i = 0; $i < 95-count($stats); $i++)
|
|||
|
||||
foreach($stats as $n)
|
||||
{
|
||||
$m = round($n->hashrate/1000000, 3);
|
||||
$r = $n->hashrate/1000000;
|
||||
$m = round($r / $factor, 3);
|
||||
|
||||
$d = date('Y-m-d H:i:s', $n->time);
|
||||
$json .= "[\"$d\",$m],";
|
||||
|
|
Loading…
Add table
Reference in a new issue