Pages:
Author

Topic: Checking Address Balance with Bitcoin Core - page 2. (Read 670 times)

newbie
Activity: 18
Merit: 11
August 08, 2019, 06:57:45 AM
#5
So how do I check if that specific address had a transaction? After walletnotify tells the bash script to go, what methods do I use to check specific addresses vs the whole wallets balance?
legendary
Activity: 1624
Merit: 2481
August 08, 2019, 06:42:16 AM
#4
If I have thousands of transactions couldnt that cause performance issues if theres payments in many addresses in very short periods of time? I'm trying to build it to scale from the beginning.

While i can't speak out of experience, i don't think you'll have performance issues.

walletnotify and blocknotify execute a shell script upon receiving a transaction / block.

You probably won't be able to process thousands of transactions each minute with a raspberry pi, but since the network can't handle so much itself you shouldn't get any problem with a medicore VPS / whatever you are using.

The current amount of transactions the bitcoin network can handle is at roughly 200 per minute.
Besides the fact that i doubt you alone will fill 50% of all blocks, it definitely should be possible without performance issues.
newbie
Activity: 18
Merit: 11
August 08, 2019, 06:34:41 AM
#3
Quote
Why don't you use the master public key to derive public keys and addresses while the private keys are in cold storage ?
That way, you would directly accept payments into your cold wallet and would save on transaction fees.

Was most likely going to do this in deployment environment. Was just going to add extra functionality to send to single address if I wanted it stored in one address for whatever reason.

Quote
You could use walletnotify to get notified each time the state of your wallet changes (i.e. transaction received, transaction sent, first confirmation on a TX).
That'd be more efficient than having a cronjob checking the addresses each X seconds/minutes.

If I have thousands of transactions couldnt that cause performance issues if theres payments in many addresses in very short periods of time? I'm trying to build it to scale from the beginning.
legendary
Activity: 1624
Merit: 2481
August 08, 2019, 06:21:34 AM
#2
Generate address -> receive payment -> wait for confirmations -> send coins to cold storage and show confirmed payment

Why don't you use the master public key to derive public keys and addresses while the private keys are in cold storage ?
That way, you would directly accept payments into your cold wallet and would save on transaction fees.



Currently I save the address in a database associated with the order and generate it using getnewaddress(). I'm stuck on checking the balance of said address and how many confirmations the payment has.

You could use walletnotify to get notified each time the state of your wallet changes (i.e. transaction received, transaction sent, first confirmation on a TX).
That'd be more efficient than having a cronjob checking the addresses each X seconds/minutes.

If you require more than 1 confirmation, you can combine this with blocknotify, to get notified each time core receives a block.
If walletnotify says that you received 1 confirmation on transaction X, you can be sure the next time blocknotify is called, this TX has one more confirmation.
newbie
Activity: 18
Merit: 11
August 08, 2019, 06:04:08 AM
#1
I have an online store and already accept CC payments and I want to start accepting crypto. I'm using the regtest to test the application and so I can't rely on third party APIs plus I feel doing that will hurt at scaling. I'm trying to set it up where each new order will have its own address and I'll have a cronjob periodically check if the address received the payment then send money to cold storage wallet as follows:

Generate address -> receive payment -> wait for confirmations -> send coins to cold storage and show confirmed payment

Currently I save the address in a database associated with the order and generate it using getnewaddress(). I'm stuck on checking the balance of said address and how many confirmations the payment has. I saw accounts looked kind of like what I was looking for but its deprecated so I cant use that. I looked into using blockchain.info JSON API but then with scaling I have to worry about request limits and if I'm trying to request information on too many addresses at once I think it will result in an error. For example, say I have like 4000 orders and the cronjob needs to check all 4000 addresses during the cronjob to get it done efficiently then the addresses that received enough confirmation switch order to paid in database and send coins to cold storage wallet off of server. Plus I'm trying to test it in regtest mode so obviously I cant use a 4rd party API. I saw listunspent() after manually adding addresses and rescanning the chain but I feel if you have thousands of orders and addresses it will be very inefficient every time the job is run and slow the server down.

What is a solution to what I'm trying to accomplish?

I'm very tech savvy and am interested in the be my own bank aspect so I'm not trying to use third party processors or use blockchain.info's wallet API.
Pages:
Jump to: