oliverw / miningcore

Miningcore is a high-performance Mining Pool Software for Linux and Windows.
https://store.miningcore.pro
MIT License
717 stars 659 forks source link

Can't to start MiningCore with BCH (bitcoinabc) #209

Closed DySprozin closed 6 years ago

DySprozin commented 6 years ago

I'm trying to start MiningCore with BCH (bitcoinabc), but I get the following error:

[2018-02-14 03:25:22.6706] [E] [bth1] System.FormatException: Invalid base 58 string
   at NBitcoin.DataEncoders.Base58Encoder.DecodeData(String encoded)
   at MiningCore.Blockchain.Bitcoin.BitcoinUtils.AddressToDestination(String address) in /tmp/miningcore/src/MiningCore/Blockchain/Bitcoin/BitcoinUtils.cs:line 41
   at MiningCore.Blockchain.Bitcoin.BitcoinJobManager 2.<PostStartInitAsync>d__49.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MiningCore.Blockchain.JobManagerBase 1.<StartAsync>d__19.MoveNext() in /tmp/miningcore/src/MiningCore/Blockchain/JobManagerBase.cs:line 113

What can I do?

config.json

{
    "logging": {
        "level": "debug",
        "enableConsoleLog": true,
        "enableConsoleColors": true,
        "logFile": "/mining_logs/pool.log",
        "logBaseDirectory": "",
        "perPoolLogFile": false
    },
    "persistence": {
        "postgres": {
            "host": "192.168.0.5",
            "port": 5432,
            "user": "miningcore",
            "password": "..........",
            "database": "miningcore_new"
        }
    },
    "paymentProcessing": {
        "enabled": true,
        "interval": 600,
        "shareRecoveryFile": "recovered-shares.txt"
    },
    "pools": [{
      "id": "bth1",
      "enabled": true,
      "coin": {
        "type": "BCH"
      },
      "address": "...................................",
      "rewardRecipients": [
        {
          "address": "......................................",
          "percentage": 1.0
        }
      ],
      "blockRefreshInterval": 1000,
      "jobRebroadcastTimeout": 55,
      "clientConnectionTimeout": 600,
      "banning": {
        "enabled": true,
        "time": 600,
        "invalidPercent": 50,
        "checkThreshold": 50
      },
      "ports": {
        "3032": {
          "listenAddress": "0.0.0.0",
          "difficulty": 1024,
          "name": "ASIC Mining",
          "varDiff": {
            "minDiff": 512,
            "targetTime": 15,
            "retargetTime": 90,
            "variancePercent": 30
          }
        }
      },
      "daemons": [
        {
          "host": "192.168.0.6",
          "port": 5302,
          "user": "bitcoinrpc",
          "password": "......................."
    }
      ],
      "devDonation": 0.0,
      "paymentProcessing": {
        "enabled": true,
        "minimumPayment": 0.1,
        "payoutScheme": "PPLNS",
        "payoutSchemeConfig": {
          "factor": 2.0
        }
      }
    }]
}

bitcoin.conf:

rpcuser=bitcoinrpc
rpcpassword=..................
rpcallowip=0.0.0.0/0
rpcport=5302
port=8334
daemon=1
server=1
gen=0
oliverw commented 6 years ago

Hmm. I suspect that you are attempting to use a Bitcoin Cash prefixed address for the "address" field. That's not supported.

DySprozin commented 6 years ago

Thank you for answer!

For the "address" field I use address, which was got from command:

/home/pooluser/bitcoin-abc/src/bitcoin-cli getnewaddress

Where I'm wrong? Whats different with litecoin, b2x, etc ?

Can you show right config.json sample for BCH ?

starostinkg commented 6 years ago

oliverw

I have tried to use with prefix and without:

bitcoincash:qp7ycf79a06jnfye0y2awzy39l4535vpa59nm12345 qp7ycf79a06jnfye0y2awzy39l4535vpa59nm12345

The results was the same:

System.FormatException: Invalid base 58 string at NBitcoin.DataEncoders.Base58Encoder.DecodeData(String encoded)

DySprozin commented 6 years ago

I fixed this problem ;-)

In the config (bincoin.conf), we must add parametr usecashaddr:

... usecashaddr = 0 ...

So... Restart daemon, check Address:

bitcoin-cli listreceivedbyaddress 0 true

and in finaly we get addr in old format without prefix! Profit!!! ;-)

uce1565 commented 1 year ago

using legacy address.