overtorment / cashier-btc Goto Github PK
View Code? Open in Web Editor NEW๐ฐ Self-hosted Bitcoin payment gateway (เธฟ)
๐ฐ Self-hosted Bitcoin payment gateway (เธฟ)
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!
I got Cashier-BTC working, npm test run without any errors and all ok.
It's possible to check balanace, create new transaction, check seller balance the only thing not working is the payout.
I already checked if it could be because of balance issues or fee too high etc, which is all perfectly fine. In debugging I can see amount, amountToOutput, changeAddress, feeInSathoshis, fixedFee are all spendable and ok.
What could have caused the following error and how would I be able to fix it? Have not been able to locate the issue yet so any help will be appreciated.
code:500
message:"{"result":null,"error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code 16)"},"id":"62986010-8ef5-4917-9d5f-ab43ba5b957c"}\n"
stack:"Error: {"result":null,"error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code 16)"},"id":"62986010-8ef5-4917-9d5f-ab43ba5b957c"}\n\n at IncomingMessage. (/home/user/BitcoinPayment/Cashier-BTC/node_modules/jayson/lib/client/http.js:74:21)\n at emitNone (events.js:111:20)\n at IncomingMessage.emit (events.js:208:7)\n at endReadableNT (_stream_readable.js:1064:12)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)"
After starting up cashier, in the bitcore logs it is reporting many requests per second trying to find address information for the same several addresses. Here is a small portion of the logs:
[2017-03-26T02:45:12.546Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1FRVpkvSPeYfuDoW1i6peK9GjTuBQydi7T?noTxList=1" 200 239 0.499 "-"
[2017-03-26T02:45:12.614Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/19WwaMfB1bmjMSJkFCCfrFFqiVrHwKzM2P?noTxList=1" 200 239 0.521 "-"
[2017-03-26T02:45:12.687Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1Nd2AGwSkNFwYQav6bQimtnN8faa5XD6Gx?noTxList=1" 200 239 0.527 "-"
[2017-03-26T02:45:12.757Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1JPpt6YD5dkFB87cDGiFRoDXxhKcmnqBhv?noTxList=1" 200 239 0.508 "-"
[2017-03-26T02:45:12.821Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1LayKNbHyf5MVqRe9GV1bsN2EfBxKUE27A?noTxList=1" 200 239 0.498 "-"
[2017-03-26T02:45:12.884Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1Q8M4oRCPiQ1qdmcSHMFP5HUtoeP9o35pZ?noTxList=1" 200 239 0.469 "-"
[2017-03-26T02:45:12.964Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1NSwBKJBTPQDwiMfHdaGAP1twRXDqzdFUn?noTxList=1" 200 239 0.469 "-"
[2017-03-26T02:45:13.037Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/18DcKe8QMwhhMHJXuJKrDzxHDjKtoUG8bz?noTxList=1" 200 239 2.011 "-"
[2017-03-26T02:45:13.102Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1EsLX2oc8grjSxC6AwbQrewjZnaYMX25wu?noTxList=1" 200 239 0.598 "-"
[2017-03-26T02:45:13.170Z] info: ::ffff:127.0.0.1 "GET /insight-api/addr/1PBKZBWn2tbmvDMS6t47kTiXPfNyW4ht5e?noTxList=1" 200 239 0.542 "-"
I have never even made any api calls to cashier. Is this normal?
So I seem to be having another issue.
I created a test transaction, sent the BTC, and after executing curl http://localhost:2222/check_payment/3LRqq2SSQMozv9ucBvgTGybiuuNYLoaPK5
I get {"btc_expected":0.00034435,"btc_actual":0,"btc_unconfirmed":0}
Is this normal? When I put the address 3LRqq2SSQMozv9ucBvgTGybiuuNYLoaPK5
at bitref.com it can see the transaction so how come Cashier-BTC isn't able to?
EDIT: I am by no means an expert, but I have tried to recover my funds by downloading the database and extracting the WIF. After trying to convert it to a private key it comes out as invalid, so maybe the issue is that invalid WIFs are stored.
Inputting sample WIFs at http://gobittest.appspot.com/PrivateKey successfully gets the private key, but when I put my own WIFs from the database the site returns "Private key is not on curve" indicating they're invalid.
I am working on creating a POST version of the current GET api endpoints. And organizing the routes to a routers folder, converting the current controller scripts to modules. It will also leave the GET endpoints still usable as is.
This way we can introduce optional parameters, e.g. message or custom fees etc.
Thoughts on this?
Hi, I tried running below command
mkdir datadir
Then
./bin/bitcoind -port=8444 -rpcport=8442 -datadir=./datadir -rpcuser=user -rpcpassword=pass -rpcbind=0.0.0.0 -rpcallowip=44.33.22.11
After 30 minutes or so nothing happens, is it an error or what I am doing wrong? I check debug.log and shows this many lines, but no signs of error. I am on windows using ubuntu 16 in a virtualbox machine
2018-01-06 08:09:10 UpdateTip: new best=000000
2018-01-06 08:09:10 UpdateTip: new best=000000
Curious about a demo for quick evaluation of payment/invoicing projects
Hello, thank you for this tool! I was just wondering since a BTC address is created for each transaction, how would I claim all of the BTC?
Hi
i do npm test and face me error
i have installed btc full node and also couchdb and i just configure the config js file and then i just run npm test and face me error :
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at /downloads/Cashier-BTC/node_modules/mocha/lib/mocha.js:231:27
at Array.forEach (native)
at Mocha.loadFiles (/downloads/Cashier-BTC/node_modules/mocha/lib/mocha.js:228:14)
at Mocha.run (/downloads/Cashier-BTC/node_modules/mocha/lib/mocha.js:536:10)
at Object. (/downloads/Cashier-BTC/node_modules/mocha/bin/_mocha:573:18)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
at bootstrap_node.js:507:3
npm ERR! Test failed. See above for more details
its installed on centos 7 x64
is there any customization for centos ?
The 20,000 satoshi fee is going to make tx confirmation pretty slow today, should be more like 50,000 (or configurable). Additionally, if the amount being transferred to seller wallet is less than the transaction fee, it crashes because 0.0001 - 0.0002 = -0.0001 and bitcore gives an error with negative amounts...
Firstly, thanks for creating this very useful code. I am using it to test payment gateway with Bitcoin testnet. I have altered signer.js for testnet -
let testnet = bitcoinjs.networks.testnet // define bitcoin testnet
exports.generateNewSegwitAddress = function () {
// let keyPair = bitcoinjs.ECPair.makeRandom() -- for bitcoin mainnet
let keyPair = bitcoinjs.ECPair.makeRandom({network: testnet})
But when I hit the -"http://localhost:2222/request_payment/0.005/BTC/wheres%20the%20money%20lebowski/seller3/customer2/http%3A%2F%2Fgoogle.com%2F"
it returns - " "error": "{"result":null,"error":{"code":-5,"message":"Invalid Bitcoin address or script"},"id":"2c015994-6f01-4acd-94e4-77bd2b1d547c"}\n""
Please suggest if I need to add something to make it work on the bitcoin testnet. Thanks in advance!
storage
get_document()
โ should return any db document
save_address() && get_address()
โ should save document with address data, and get it back (77ms)
save_payout()
โ saves document with details on the payout (49ms)
save_seller()
โ saves document with details on the seller (59ms)
blockchain
#create_transaction()
โ should return valid TX hex (54ms)
โ should correctly consider all used inputs
9 passing (1m)
6 failing
loading express responds to /check_payment/:address:
Uncaught Error: getaddrinfo ENOTFOUND http http:80
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
loading express "after each" hook for "responds to /check_payment/:address":
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
blockchain #broadcast_transaction() should broadcast TX:
Uncaught Error: getaddrinfo ENOTFOUND http://35.154.27.8 http://35.154.27.8:3001
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
blockchain #fetch_transactions_by_address() should return TXs by address :
Uncaught Error: getaddrinfo ENOTFOUND http http:80
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
blockchain #fetch_transactions_by_address() should return all TXs:
Uncaught Error: getaddrinfo ENOTFOUND http http:80
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
blockchain #get_address() should return balances associated with this address :
Uncaught Error: getaddrinfo ENOTFOUND http http:80
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
Hello!
I get the following error when i run nodejs worker.js although npm test works
(node:13420) UnhandledPromiseRejectionWarning: Error: {"result":null,"error":{"code":-4,"message":"Address not found in wallet"},"id":"ca143925-f031-42eb-b559-d36c8a6c08ce"}
at IncomingMessage.<anonymous> (/home/Desktop/Cashier-BTC/node_modules/jayson/lib/client/http.js:74:21)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1103:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:13420) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13420) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What should i do ?
Thank you in advance
I don't really think that your routes are comfortable to use, for example:
GET /request_payment/:expect/:currency/:message/:seller/:customer/:callback_url
When you build a wrapper, joining these parameters is very tricky process: you should always match values with position. Maybe they should be passed via query string?
Hi, if yes, can we know which settings to change? It says
(node:7211) UnhandledPromiseRejectionWarning: Error: {"result":null,"error":{"code":-5,"message":"Invalid Hilux address"},"id":"21ce350b-fd60-426b-bfc7-a340421bffe3"}
When running nodejs worker.js
and npm test.
Appreciate any help we can get.
Hello,
is there anyway I can keep bitcoin core running? I know that there's some instructions for keeping the node files running but I'm kind of lost on how to keep bitcoin core up. Not even an hour after I execute it, it dies with the message "Killed"
what is the license usage of this project? :)
[
'broadcasting',
'010000000001018b0b33aed894fab40f8b2169cd6ef4fe9698d0ceda169995ebb14f1ef616977c0000000017160014f66fce40a9defb9bf913452dcdea39d1ae8c005affffffff01000000000000000017a914b84e23ed387fdeb8f85f8aff075e98bb8d83e5ec870247304402201f95722f6115fe44c2e393530b0efe483e02d418865aad928f920a52d760cd6a022053ea25cd1ac4ce47b7b778fb2a9a95d0193ac34ed2dbbacaf1fe51f22e99abdd0121034a153f20b6571c58a9751d5fb62f8452941d86a4949b0546712f9702d40e6dbb00000000'
]
(node:10594) UnhandledPromiseRejectionWarning: Error: {"result":null,"error":{"code":-26,"message":"dust (code 64)"},"id":"b7ede744-211a-4603-a95b-328b2d3901b0"}
at IncomingMessage.<anonymous> (/root/Cashier-BTC/node_modules/jayson/lib/client/http.js:74:21)
at IncomingMessage.emit (events.js:208:15)
at endReadableNT (_stream_readable.js:1168:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:10594) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10594) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{"btc_expected":0.0001,"btc_actual":0.00019864,"btc_unconfirmed":0.00019864}
Got this in check payment url what will happen now?
I want to build a feature by which we can use anyone's extended private key to generate addresses so that we can generate as many addresses as we want without the ability to spend them(because this needs a private key). Can you suggest anything, i just need to modify the code regarding address generation and i have seen that in the existing codebase we are generating a new private key using bitcore.js and storing it along with the address and other invoice details in the database.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.