zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
1.02k stars 1.03k forks source link

rpc error with daemon instance 0 when submitting block with submitblock {"code":-22,"message":"Block decode failed"} #499

Open igotek2 opened 7 years ago

igotek2 commented 7 years ago

rpc error with daemon instance 0 when submitting block with submitblock {"code":-22,"message":"Block decode failed"}

StarCash

COINDAEMON_TX = 'yes' in stratum-mining. txMessage = true in config json node opening mining portal

How could I fix this problem ? shares are ok from the miner software. but why it cannot submit the share to the deamon ?

igotek2 commented 7 years ago

Network Connected: Mainnet Detected Reward Type: POS Current Block Height: 3984 Current Connect Peers: 4 Current Block Diff: 302.6038 02172 Network Difficulty: NaN Network Hash Rate: NaN KH Stratum Port(s): 1201 Pool Fee Percent: 1% Block polling every: 1000 ms

ghost commented 7 years ago

@igotek2 Which algo? Try algo:POW in config of the coin. Maybe a problem with hybrid coins.

igotek2 commented 7 years ago

yes it is hybrid coin with x1 algo. StarCash

ghost commented 7 years ago

X11 algo works fine with UNOMP. Try "reward": "POW" in coin config.

igotek2 commented 7 years ago

2017-09-05 23:57:41 [Pool] [starcash] (Thread 1) Daemon instance 0 rejected a supposedly valid block

it was showing POS but it shows POW now. But why the deamon rejected a valid block ? It happened 5 times.

starcash@yiimp:~/nomp$ node init.js 2017-09-05 23:57:52 [POSIX] [Connection Limit] (Safe to ignore) POSIX module not installed and resource (connection) limit was not raised 2017-09-05 23:57:52 [Master] [CLI] CLI listening on port 17117 2017-09-05 23:57:53 [Switching] [Setup] (Thread 1) Loading last proxy state from redis 2017-09-05 23:57:53 [Pool] [starcash] (Thread 1) Stratum Pool Server Starte d for starcash [STAR] {x11} Network Connected: Mainnet Detected Reward Type: POW Current Block Height: 4192 Current Connect Peers: 4 Current Block Diff: 328.5863 13604 Network Difficulty: NaN Network Hash Rate: NaN KH Stratum Port(s): 1201 Pool Fee Percent: 1% Block polling every: 1000 ms

ghost commented 7 years ago

Try TX and p2p submitblock.

igotek2 commented 7 years ago

how could I do it ?

ghost commented 7 years ago

@igotek2 p2p in poolconfig of NOMP. Bottom of file. https://github.com/zone117x/node-open-mining-portal#coin-config

/* This allows the pool to connect to the daemon as a node peer to receive block updates.
       It may be the most efficient way to get block updates (faster than polling, less
       intensive than blocknotify script). It requires the additional field "peerMagic" in
       the coin config. */
    "p2p": {
        "enabled": false,

        /* Host for daemon */
        "host": "127.0.0.1",

        /* Port configured for daemon (this is the actual peer port not RPC port) */
        "port": 19333,

        /* If your coin daemon is new enough (i.e. not a shitcoin) then it will support a p2p
           feature that prevents the daemon from spamming our peer node with unnecessary
           transaction data. Assume its supported but if you have problems try disabling it. */
        "disableTransactions": true
    },

I think there is a problem with NOMP and hybrid coins. With pure POW coins no problems. If You give me a link to GIT of Your coin - I can try it on my pool.

igotek2 commented 7 years ago

I didnt test only POW coins. I tested DeepOnion only one time. I tested StarCash coin many times because its difficulty is so low and i can find a block faster.

https://github.com/deeponion/deeponion

or

https://github.com/cybernetik7/StarCash1.0.2.git

ghost commented 7 years ago

I will test it today evening and give you results.

ghost commented 7 years ago

@igotek2 Deeponion is not X11 coin. It's X13 coin.

igotek2 commented 7 years ago

https://onionpool.youngwebsolutions.com/

This pool use nomp and mpos. And there is no problem. I talked to the pool operator. He told me he use nomp.

ghost commented 7 years ago

@igotek2 In config You use X13? I can't start DeepOnion coin on Debian.

Tor 0.2.5.1-alpha-dev died
ghost commented 7 years ago
2017-09-09 19:08:04 [Pool]      [starcash] (Thread 2) Submitted Block using submitblock successfully to daemon instance(s)
2017-09-09 19:08:04 [Pool]      [starcash] (Thread 2) Block found: 000000000014971655154a85fa429dbaae42e93d58a7edefe336b48dd04e9eb3 by ENTW8sNPiZYBMfuUTYGBd51EeEXiBM3xiU
2017-09-09 19:08:04 [Pool]      [starcash] (Thread 2) Share accepted at diff 49.63235294/3182.82723271 by ENTW8sNPiZYBMfuUTYGBd51EeEXiBM3xiU [::ffff:37.58.65.213]

image

image

My blocks: http://45.32.226.114/index.php?0000000000426713337aa3a2d2ee975d3b3f5529494c02bcb8d8fd66b9ba8859 http://45.32.226.114/index.php?000000000014971655154a85fa429dbaae42e93d58a7edefe336b48dd04e9eb3

Starcash works fine.

igotek2 commented 7 years ago

:( could you give me the config files ?

ghost commented 7 years ago

coins/starcash.json

{
    "name": "StarCash",
    "symbol": "STC",
    "algorithm": "x11"
}

pool_configs/starcash.json

{
    "enabled": true,
    "coin": "starcash.json",
    "blockRefreshInterval": 0,

    "address": "ENTW8sNPiZYBMfuUTYGB23d51EeEXiBM3xiU",

    "rewardRecipients": {
        "ENTW8sNPiZYBMfuUTYGBd51E23eEXiBM3xiU": 0
    },

    "paymentProcessing": {
        "enabled": false,
        "paymentInterval": 60,
        "minimumPayment": 1,
        "daemon": {
            "host": "127.0.0.1",
            "port": 26254,
            "user": "user",
            "password": "pass"
        }
    },

    "ports": {
        "36254": {
            "varDiff": {
                "minDiff": 0.0001,
                "maxDiff": 10000,
                "targetTime": 15,
                "retargetTime": 30,
                "variancePercent": 30
            }
        }
    },

    "daemons": [
        {
            "host": "127.0.0.1",
            "port": 26254,
            "user": "user",
            "password": "pass"
        }
    ],

    "p2p": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 26254,
        "disableTransactions": true
    },

    "mposMode": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 3306,
        "user": "me",
        "password": "mypass",
        "database": "ltc",
        "checkPassword": true,
        "autoCreateWorker": false
    },

    "mongoMode": {
        "enabled": false,
        "host": "127.0.0.1",
        "user": "",
        "pass": "",
        "database": "ltc",
        "authMechanism": "DEFAULT"
    }

}

coindaemon/StarCash.conf

rpcuser=user
rpcpassword=pass
port=16254
rpcport=26254   
rpcthreads=8
rpcallowip=127.0.0.1
rpctimeout=30
daemon=1
server=1
txindex=1
gen=0
blocknotify=node /home/mining/pool/scripts/cli.js blocknotify starcash %s
ghost commented 7 years ago

@igotek2 Profit of this coin is lower than profit of Nicehash mining. Sure to mine it? May be after adding it to Nova it will pump up but I think it's shitcoin :)

ghost commented 7 years ago

@igotek2 If You can help with onion - I will test it.

igotek2 commented 7 years ago

apt install redis-server Install Redis Server. apt-get install node Install node. apt-get install nodejs-legacy Install nodejs-legacy for "node". apt-get install npm Install npm.

then I download nomp and edit config files. And I cannot start web for nomp. So I always install mpos. (I have apache in my server.)

ghost commented 7 years ago

My problem is not in nomp. My problem with coin daemon. It crashes with error of Tor.

igotek2 commented 7 years ago

is TOR allowed in your contry ?

Where did you find this rpcport number and p2p port number ? There are different port numbers in starcash.conf

ghost commented 7 years ago

Russia. I don't know about TOR anything. Ports - random.

igotek2 commented 7 years ago

apt-get install qt5-default qt5-qmake qtbase5-dev-tools qttools5-dev-tools build-essential libboost-dev libboost-system-dev apt-get install libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libevent-dev

install these dependicies to create DeepOnion coin deamon.

ghost commented 7 years ago

Deamon created. It is not a problem. Deamon not starts. Give error Tor 0.2.5.1-alpha-dev died No connects to peer. My server did not see onion net.

igotek2 commented 7 years ago

DeepOnion.conf

rpcuser=DeepOnionrpc rpcpassword=password addnode=3wdd3jnoqchxkypw.onion:17570 addnode=47rldkv62swc5hwf.onion:17570 addnode=zekhbgax6bf66jsk.onion:17570 addnode=slz2b7zvopuigglc.onion:17570 addnode=rv5wufytede2ki4q.onion:17570 addnode=mjtsga47m4ehvzc6.onion:17570 addnode=msjtgahbiplfdf7z.onion:17570 addnode=rk2bnzon34ce2hqg.onion:17570 addnode=rxb4nvcpnk4gdpgu.onion:17570 addnode=s3hahnekvzqxnddk.onion:17570 addnode=spelgezoddb45mpe.onion:17570 addnode=h62qmlbmwm7kpz4g.onion:17570 addnode=kr4xq3cryimxdcmn.onion:17570 addnode=udds4ybjgb7bm5hv.onion:17570 addnode=jynkusuegv3c5kt5.onion:17570 addnode=xpuwzgvd2aih66gm.onion:17570 port=17570 rpcport=18580 rpcthreads=8 rpcallowip=127.0.0.1 rpctimeout=30 daemon=1 server=1 txindex=1 gen=0 blocknotify=node /home/deeponion/pool/scripts/cli.js blocknotify deeponion %s

igotek2 commented 7 years ago

https://i.hizliresim.com/g9lXkO.png

Check thisi mage. Deamon works fine. sync is completed.

How could I set p2p submitblock ?

igotek2 commented 7 years ago

http://deeponion.igotek.us

Everything works well. nomp and mpos. But I dont know why the deamon reject the valid blocks ? If we can fix the problem, i will check the nomp and mpos for many algos. I m stuck in the block submitting step.

2017-09-10 00:37:54 [Pool] [deeponion] (Thread 4) Share accepted at diff 16.86591398/20.06629175 by igotek.giant3 [176.88.52.5] 2017-09-10 00:37:56 [MySQL] [deeponion] Share inserted 2017-09-10 00:38:00 [Pool] [deeponion] (Thread 4) Daemon instance 0 rejected a supposedly valid block 2017-09-10 00:38:08 [Pool] [deeponion] (Thread 1) Share accepted at diff 0.72060381/1.51347202 by igotek.cube [176.88.52.5]

ghost commented 7 years ago

@igotek2 Check readme file.

GenTarkin commented 6 years ago

Ive solved this particular w/ hybrid POW/POS coins that require a payee and payee_reward tx in the coinbasetx (such as boostcoin). Steps to take:

  1. Make the changes to coin daemon source code as @CryptoCanary outlined here: https://github.com/EverGreenCoinDev/EverGreenCoin/commit/1f53769feca6797b9090aba3a821288cb66ceec0#diff-c2c990fee1c3381462640e80ae7db0d0

  2. In NOMP source, change https://github.com/zone117x/node-stratum-pool/blob/master/lib/transactions.js#L136 to: var payeeReward = rpcData.payee_amount;

  3. In NOMP coins/coin.json ensure theres entry: "Reward": "POS"

tweak19 commented 6 years ago

@igotek2 Could you especially be so fine and give me an short information about your working config files for deeponion and nomp? My stratum seems to work, but I have trouble to find block's. So I am not sure if there is any configuration fault.

Thanks!

serbus09 commented 6 years ago

@igotek2 You should read your daemons log file, search for "submitblock" keyword, below is exception causing the found block rejection.

The solution proposed by @GenTarkin works only for hybrids with payee property in the block, anybody who tries to solve found block rejection should first read the block template with daemon command getblocktemplate and search for payee keyword. This way you can ensure that is causing the problem.

phantanthanh1996 commented 6 years ago

Could you please guide me? I have same problem but i don't how to fix it.

serbus09 commented 6 years ago

@phantanthanh1996 Open client log file and search for error messages, in windows it is usually located in: C:\Users[User]\AppData\Roaming[Coin name]\debug.log or /home/[user]/.[coin name]/debug.log in linux.