Overtorment / Cashier-BTC

💰 Self-hosted Bitcoin payment gateway (āļŋ)
284 stars 100 forks source link

btc_actual and btc_unconfirmed shows zero #11

Open ravikkr18 opened 6 years ago

ravikkr18 commented 6 years ago

Hi, Thanks for the great project, i'm facing a problem, only btc_expected value showing correct value.

{"btc_expected":0.0154,"btc_actual":0,"btc_unconfirmed":0}

Please help.

Thanks in advance!

Overtorment commented 6 years ago

Hello. Can you please provide more info? Did you setup BitcoinCore node corectly?

ravikkr18 commented 6 years ago

Hello,

Here is output of npm test

npm test

Cashier-BTC@2.1.0 test /root/Cashier-BTC standard && ./node_modules/.bin/mocha --exit tests/*

acceptance - loading express Listening on port 2222 144c2c93-c85e-49e4-88b7-4e433ad293b4 checking seller existance... 144c2c93-c85e-49e4-88b7-4e433ad293b4 seller already exists 144c2c93-c85e-49e4-88b7-4e433ad293b4 created address 3AT5WTdQstnDZ6ZhNijRPyBfhZVtgcZsnY 144c2c93-c85e-49e4-88b7-4e433ad293b4 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /request_payment/0.001/BTC/testmessage/testseller/testcustomer/http%3A%2F%2Ftesturl.com%2F HTTP/1.1" 200 383 "-" "node-superagent/3.8.1" ✓ responds to /request_payment/:expect/:currency/:message/:seller/:customer/:callback_url (224ms) Listening on port 2222 99229208-ecb2-4c61-9231-429c465d157a checking seller existance... 99229208-ecb2-4c61-9231-429c465d157a seller already exists 99229208-ecb2-4c61-9231-429c465d157a created address 3EZyTwrRSzPCCmQcm1MbsKXFLmU9zq78F9 99229208-ecb2-4c61-9231-429c465d157a ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /request_payment/0.001/BTC/testmessage/testseller/testcustomer/http%3A%2F%2Ftesturl.com%2F HTTP/1.1" 200 383 "-" "node-superagent/3.8.1" ✓ responds to duplicate /request_payment/:expect/:currency/:message/:seller/:customer/:callback_url (64ms) Listening on port 2222 3fa01953-7045-4303-a95a-7353a49309f0 checking seller existance... 3fa01953-7045-4303-a95a-7353a49309f0 seller doesnt exist. creating... 3fa01953-7045-4303-a95a-7353a49309f0 created testseller-oxagk ( 38CAX1mXZYBouuK57AtqY3FkfCU7AA9z3d ) 3fa01953-7045-4303-a95a-7353a49309f0 created address 3CuZaFcdNEyYa9ADN1tS6wM38TcPi2o6k5 3fa01953-7045-4303-a95a-7353a49309f0 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /request_payment/0.001/BTC/testmessage/testseller-oxagk/testcustomer/http%3A%2F%2Ftesturl.com%2F HTTP/1.1" 200 383 "-" "node-superagent/3.8.1" ✓ creates new seller on /request_payment/:expect/:currency/:message/:seller/:customer/:callback_url (110ms) Listening on port 2222 387f8476-d236-47a7-87da-303bbcce3e67 checking seller existance... 387f8476-d236-47a7-87da-303bbcce3e67 seller doesnt exist. creating... 387f8476-d236-47a7-87da-303bbcce3e67 created testseller-eafky ( 36owTthihRx5PbLemab2UmiSBVqeW6Ssf5 ) 387f8476-d236-47a7-87da-303bbcce3e67 created address 3JHMQbjqNDMPdBjQHftBNUbod2BcSqAkgn 387f8476-d236-47a7-87da-303bbcce3e67 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /request_payment/0.001/BTC/testmessage/testseller-eafky/testcustomer/http%3A%2F%2Ftesturl.com%2F HTTP/1.1" 200 383 "-" "node-superagent/3.8.1" ✓ returns unprocessed documents ok (251ms) Listening on port 2222 68557fe2-07c5-4e59-a2e6-cd89cec012d0 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /check_payment/3CuZaFcdNEyYa9ADN1tS6wM38TcPi2o6k5 HTTP/1.1" 200 57 "-" "node-superagent/3.8.1" ✓ responds to /check_payment/:address Listening on port 2222 1e1ca891-4660-42a1-823d-1ac7d223a404 not enough balance 1e1ca891-4660-42a1-823d-1ac7d223a404 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /payout/testseller/0.66/BTC/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa HTTP/1.1" 200 30 "-" "node-superagent/3.8.1" ✓ responds to /payout/:seller/:amount/:currency/:address Listening on port 2222 862253d6-a4cb-4035-87e1-075d7a35f0b2 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /get_seller_balance/testseller HTTP/1.1" 200 1 "-" "node-superagent/3.8.1" ✓ responds to /get_seller_balance/testseller Listening on port 2222 440b5191-9efb-47d8-b0f9-d8ab3337be53 no such seller 440b5191-9efb-47d8-b0f9-d8ab3337be53 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /get_seller_balance/unexistant_seller666 HTTP/1.1" 200 26 "-" "node-superagent/3.8.1" ✓ responds with error to /get_seller_balance/unexistant_seller666

acceptance - loading express Listening on port 2222 21b204b0-8c0e-4c82-a7ab-78becc72490b ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET / HTTP/1.1" 200 30 "-" "node-superagent/3.8.1" ✓ responds to / Listening on port 2222 0aad378b-bef6-4b7f-93b9-d546e964ea86 ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /generate_qr/1512789346834 HTTP/1.1" 301 82 "-" "node-superagent/3.8.1" ✓ responds to /generate_qr/ and qr image is actually generated Listening on port 2222 b81f41c6-1478-43c5-832d-8512012a3a5e ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /foo/bar HTTP/1.1" 404 3 "-" "node-superagent/3.8.1" ✓ 404 everything else Listening on port 2222 84d7006f-d160-4724-8261-32e16d88ff3b ::ffff:127.0.0.1 - - [09/Dec/2017:03:15:46 +0000] "GET /foobar HTTP/1.1" 404 3 "-" "node-superagent/3.8.1" ✓ 404 everything else

integration - blockchain getblockchaininfo() RPC call ✓ should return info

integration - storage getDocumentPromise() ✓ should return any db document saveAddressPromise() && getAddressPromise() ✓ should save document with address data, and get it back saveSellerPromise() ✓ saves document with details on the seller saveAddressPromise() && getUnprocessedAdressesYoungerThan() ✓ saves unprocessed address to database and fetches it back

unit - signer createTransaction() ✓ should return valid tx hex ✓ should return valid tx hex for segwit transactions (92ms) ✓ should return valid tx hex for segwit transactions with multiple inputs (112ms) ✓ should return valid tx hex for segwit transactions with change address (82ms) WIF2address() ✓ should convert WIF to segwit P2SH address generateNewAddress() ✓ should generate new address (54ms) URI() ✓ should form correct payment url

24 passing (2s)

My config.js settings is

module.exports = { 'port': 2222, 'base_url': 'http://localhost:2222', 'base_url_qr': 'http://localhost:2222', 'couchdb': 'http://localhost:5984/cashier-btc', // install locally or use https://cloudant.com 'bitcoind': { 'rpc': 'http://juyta:sjuda@127.0.0.1:8442' }, 'small_amount_threshhold': 0.005, // amounts higher than that will require confirmed balance 'process_unpaid_for_period': 24 3600 1000, // worker that checks status of addresses 'process_paid_for_period': 30 24 3600 * 1000 // worker2 that sweeps temporary wallets }

Thanks

Overtorment commented 6 years ago

All looks fine. You'll have to check whats going on with the bitcoin node.

Run

./bin/bitcoin-cli -rpcconnect=localhost -rpcport=8442 -rpcuser=user -rpcpassword=pass getreceivedbyaddress "YOUR PROBLEM ADDRESS HERE" 0

and see if theres any balance there. Also check on blockchain info same address, balances should match. If bitcoin-cli reports zero, then it was a problem importing address