Browse Source

round 6

pull/123/head
notgiven688 2 years ago
parent
commit
0c7c6360c8
8 changed files with 27 additions and 22 deletions
  1. +4
    -1
      SDK/miner_raw/mine.html
  2. +1
    -0
      SDK/miner_raw/miner/miner.js
  3. +4
    -11
      hash_cn/libhash/cryptonight.c
  4. +4
    -3
      hash_cn/webassembly/simple_profile.html
  5. +5
    -0
      server/Server/AlgorithmHelper.cs
  6. +5
    -2
      server/Server/PoolList.cs
  7. +1
    -2
      server/Server/Program.cs
  8. +3
    -3
      server/pools.json

+ 4
- 1
SDK/miner_raw/mine.html View File

@ -1,6 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<!--A TEXT FIELD-->
@ -24,7 +28,6 @@
/* start mining, use a local server */
server = "ws://localhost:8181";
startMining("moneroocean.stream",
"422QQNhnhX8hmMEkF3TWePWSvKm6DiV7sS3Za2dXrynsJ1w8U6AzwjEdnewdhmP3CDaqvaS6BjEjGMK9mnumtufvLmz5HJi");

+ 1
- 0
SDK/miner_raw/miner/miner.js View File

@ -241,6 +241,7 @@ function informWorker(wrk) {
}
function on_servermsg(e) {
console.log(e.data);
var obj = JSON.parse(e.data);
receiveStack.push(obj);

+ 4
- 11
hash_cn/libhash/cryptonight.c View File

@ -135,11 +135,6 @@
// -------------------------------------- VARIANT 4 ---------------------------------------------
struct V4_Instruction code[NUM_INSTRUCTIONS_MAX + 1];
int lastHeight = -1;
v4_reg r[9];
#define V4_REG_LOAD(dst, src) \
do \
{ \
@ -148,16 +143,14 @@ v4_reg r[9];
} while (0)
#define VARIANT4_RANDOM_MATH_INIT() \
struct V4_Instruction code[NUM_INSTRUCTIONS_MAX + 1]; \
v4_reg r[9]; \
do \
if (variant >= 4) \
{ \
for (int i = 0; i < 4; ++i) \
V4_REG_LOAD(r + i, (uint8_t *)(state.hs.w + 12) + sizeof(v4_reg) * i); \
if (lastHeight != height) \
{ \
v4_random_math_init(code, height); \
lastHeight = height; \
} \
v4_random_math_init(code, height); \
} \
while (0)
@ -500,10 +493,10 @@ void SubAndShiftAndMixAddRoundInPlace(uint32_t *temp, uint32_t *AesEncKey)
temp[3] = TestTable2[saved[3]] ^ TestTable3[saved[4]] ^ TestTable4[saved[5]] ^ TestTable1[state[12]] ^ AesEncKey[3];
}
uint8_t text[INIT_SIZE_BYTE];
void cryptonight_hash_ctx(void *output, const void *input, size_t len, int algo, int variant, int height)
{
uint8_t text[INIT_SIZE_BYTE];
uint8_t *long_state;
oaes_ctx *aes_ctx;

+ 4
- 3
hash_cn/webassembly/simple_profile.html View File

@ -1,9 +1,11 @@
<!DOCTYPE html>
<html>
<body>
<head>
<meta charset="utf-8"/>
</head>
<p id="demo"></p>
<body>
<script src="cn.js"></script>
@ -30,7 +32,6 @@ function checkvariants() {
blob = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111113";
alert(cn(blob,1,1,0)); // c2e3bd88bffd1bd7855af2dae2a52fef6efd36f00db514a6594718c5b67fab21
blob = "6465206f6d6e69627573206475626974616e64756d";
alert(cn(blob,0,0,0)); // 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5

+ 5
- 0
server/Server/AlgorithmHelper.cs View File

@ -49,6 +49,11 @@ namespace Server
{ "cn/half", new Tuple<string, int>("cn-half", 2) }
};
public static bool ValidAlgorithm(string algo)
{
return lookup.ContainsKey(algo);
}
public static bool NormalizeAlgorithmAndVariant(JsonData job)
{
int possibleHeight = 0;

+ 5
- 2
server/Server/PoolList.cs View File

@ -66,7 +66,6 @@ namespace Server
foreach (string pool in data.Keys)
{
JsonData jinfo = data[pool] as JsonData;
PoolInfo pi = new PoolInfo();
@ -76,10 +75,14 @@ namespace Server
pi.Url = jinfo["url"].GetString();
pi.EmptyPassword = jinfo["emptypassword"].GetString();
pi.DefaultAlgorithm = jinfo["algorithm"].GetString();
pi.Port = int.Parse(jinfo["port"].GetString());
pl.pools.Add(pool, pi);
if (!AlgorithmHelper.ValidAlgorithm(pi.DefaultAlgorithm))
throw new Exception("Invalid algorithm found in pools.json: " + pi.DefaultAlgorithm );
pl.pools.Add(pool, pi);
}

+ 1
- 2
server/Server/Program.cs View File

@ -37,7 +37,6 @@ namespace Server
public class Client
{
public PoolConnection PoolConnection;
public IWebSocketConnection WebSocket;
public string Pool = string.Empty;
@ -536,7 +535,7 @@ namespace Server
{
string testStr = new string('1', 151) + '3';
IntPtr ptr = hash_cn(testStr, 1, 0,0);
IntPtr ptr = hash_cn(testStr,1, 0,0);
string str = Marshal.PtrToStringAnsi(ptr);
hash_free(ptr);

+ 3
- 3
server/pools.json View File

@ -31,7 +31,7 @@
"aeonpool.xyz" : { "url" : "mine.aeonpool.xyz", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"aeonpool.dreamitsystems.com" : { "url" : "aeonpool.dreamitsystems.com", "port" : 13333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeonminingpool.com" : { "url" : "pool.aeonminingpool.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeonhash.com" : { "url" : "pool.aeonhash.com", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite" },
"aeonhash.com" : { "url" : "pool.aeonhash.com", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"durinsmine.com" : { "url" : "mine.durinsmine.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeon.uax.io" : { "url" : "mine.uax.io", "port" : 4446, "emptypassword" : "", "algorithm" : "cn-lite/1" },
"aeon-pool.sytes.net" : { "url" : "aeon-pool.sytes.net", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-lite/1" },
@ -40,9 +40,9 @@
"pooltupi.com" : { "url" : "pooltupi.com", "port" : 8080, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"aeon.semipool.com" : { "url" : "pool.aeon.semipool.com", "port" : 3333, "emptypassword" : "x", "algorithm" : "cn-lite/1" },
"turtlepool.space" : { "url" : "eu.turtlepool.space", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-pico" },
"turtlepool.space" : { "url" : "eu.turtlepool.space", "port" : 3333, "emptypassword" : "", "algorithm" : "cn-pico/trtl" },
"masari.miner.rocks" : { "url" : "masari.miner.rocks", "port" : 5005, "emptypassword" : "", "algorithm" : "cn-half/half" },
"masari.miner.rocks" : { "url" : "masari.miner.rocks", "port" : 5005, "emptypassword" : "", "algorithm" : "cn/half" },
"etn.spacepools.org" : { "url" : "pool.etn.spacepools.org", "port" : 80, "emptypassword" : "", "algorithm" : "cn/0"},
"etn.nanopool.org" : { "url" : "etn-eu1.nanopool.org", "port" : 13333, "emptypassword" : "x", "algorithm" : "cn/0" },

Loading…
Cancel
Save