Bitcoin Forum
April 25, 2024, 03:38:55 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: how to get confirmations about many transaction at once using bitcore node or bi  (Read 159 times)
chukaman (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
April 20, 2018, 07:11:26 AM
 #1

I think it's possible to get the confirmation of a single transaction using getrawtransaction of bitcoind rpc, but i want to check the confirmations of multiple transaction by one call.
Or do i need to call getrawtransaction for each tx in pending tx?

Is it possible?

Thanks
1714016335
Hero Member
*
Offline Offline

Posts: 1714016335

View Profile Personal Message (Offline)

Ignore
1714016335
Reply with quote  #2

1714016335
Report to moderator
1714016335
Hero Member
*
Offline Offline

Posts: 1714016335

View Profile Personal Message (Offline)

Ignore
1714016335
Reply with quote  #2

1714016335
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714016335
Hero Member
*
Offline Offline

Posts: 1714016335

View Profile Personal Message (Offline)

Ignore
1714016335
Reply with quote  #2

1714016335
Report to moderator
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
April 20, 2018, 10:28:16 AM
 #2

Well not really.

getrawtransaction command only gives you the raw transaction data of the transactions in the mempool or in your wallet (if they are transactions to or from one of your addresses), unless you have txindex switched on, which it isn't by default.

You can however get raw transaction data of the transaction in some block if you know the hash of that block.
So there is no real way to check if the transaction is confirmed reliably, but if you know that the transaction was successfully broadcasted to the network with a fee that was high enough, then if you don't get the right output from that command you can know that it has been added to some block. But you can't do this for transactions connected to one of your addresses, since you will always get a full output.

As for checking multiple transactions, no. You can't do that with this command.
chukaman (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
April 20, 2018, 12:06:09 PM
 #3

Thank very much for your answer.

My initial need to check the confirmations (actually 6) of multiple pending deposit on my hot wallet addresses which i generated for each deposit request.
So i wish to check any confirmed deposit on those addresses.
I'm using bitcore, bitcore-wallet-service with bitcoind with tindex 1 setting.

My plan was like following:
1. listen mempool update bitcoind.on('tx')
--> if there's a match of output address with my receiving address ==> create a mempool deposit tx (with tx of the address) on db
2. listen new block update bitcoind.on('block')
--> if there's a match with mempool deposit tx id ==> move the mempool deposit tx to pending deposit tx on db
--> check all existing pending deposit tx for confirmation until 6 (using getRawTransaction)

I know it could be done with some cloud api like blockchain.net etc. But i need implement on my own node.

I've been studying the blockchain only 1 month. so please how can i accomplish this task?

Thanks in advance.

starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
April 20, 2018, 12:30:27 PM
 #4

Thank very much for your answer.

My initial need to check the confirmations (actually 6) of multiple pending deposit on my hot wallet addresses which i generated for each deposit request.
So i wish to check any confirmed deposit on those addresses.
I'm using bitcore, bitcore-wallet-service with bitcoind with tindex 1 setting.

My plan was like following:
1. listen mempool update bitcoind.on('tx')
--> if there's a match of output address with my receiving address ==> create a mempool deposit tx (with tx of the address) on db
2. listen new block update bitcoind.on('block')
--> if there's a match with mempool deposit tx id ==> move the mempool deposit tx to pending deposit tx on db
--> check all existing pending deposit tx for confirmation until 6 (using getRawTransaction)

I know it could be done with some cloud api like blockchain.net etc. But i need implement on my own node.

I've been studying the blockchain only 1 month. so please how can i accomplish this task?

Thanks in advance.

I won't tell you exactly how I would have done it, but here a few leads.

First, you have 2 options to bitcoind which will help you:

Code:
  -blocknotify=<cmd>
       Execute command when the best block changes (%s in cmd is replaced by
       block hash)

  -walletnotify=<cmd>
       Execute command when a wallet transaction changes (%s in cmd is replaced
       by TxID)

The first one will call an external program (ie: your script/binary) on each block received; The second, on all transactions involved in a change in your wallet (including new transactions).

My guess is you can build something around these + the json api. It should be fairly easy to retrieve tx information when a new one is added in your wallet & updating the confirmation number on each block received. I would not use mempool for this.


Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!