storj / storjscan

GNU Affero General Public License v3.0
6 stars 2 forks source link

Check token Payment #82

Closed ohari5336 closed 9 months ago

ohari5336 commented 10 months ago

/api/v0/payments/wallet/payments-with-confirmations

Response (on localhost):-

console service: storjscan service: storjscan client: tokens endpoint: tokens service: HeadersDB: storjscandb: violates constraint \"block_headers_pkey\": ERROR: duplicate key value violates unique constraint \"block_headers_pkey\" (SQLSTATE 23505)
ohari5336 commented 10 months ago

I faced this issue when I ran a private geth Blockchain and deployed basic erc20 token.

After this I start storjscan with this and link with satellite via endpoint and api key, secret

After this setup I made a token transfer on storj billing address its detected transaction and shown in response. Now after saving these transactions in scan db then show this error on all new api calls.

When I delete this scan TRX data from db then api gives response first time then again giving error.

Also TRX data after detection by scan and 20+ confirmation show msg in ui transaction successfully but in satellite db not saving and user account plan not upgraded

ifraixedes commented 10 months ago

Thank you @ohari5336 for the details.

I don't know that much about this part of the Storj ecosystem and this is a company week off, so please, be patient until next week because most of my mates will be around and the ones that know more about this will come along here during next week or the following one for trying to help you.

heunland commented 10 months ago

related support tickets so far: https://github.com/storj/customer-issues/issues/1303 https://github.com/storj/customer-issues/issues/1304 https://github.com/storj/customer-issues/issues/1313

ohari5336 commented 10 months ago

can't accessing this links

ifraixedes commented 10 months ago

@ohari5336 it's a private repository and it's intended. Don't worry about them, it's for tracking the bug with customer issues that we got due to this bug.

dlamarmorgan commented 10 months ago

HI @ohari5336

This error you are receiving means storjscan is trying to add a transaction to the headers database, but there is already a transaction with the blockchain hash that exists in the DB. The most likely cause is that you have a duplicate transaction with the exact same hash on your private blockchain multiple times.

Can you give a bit more detail about your setup? How exactly are you sending new transactions to your private chain? It is important that the transactions are distinct, and have a different transaction hash.

ohari5336 commented 10 months ago

ok i'll try, when i open deposit popup on satellite server

Screenshot 2023-12-28 at 9 43 14 PM

when open scan db and delete token deposit save data

Screenshot 2023-12-28 at 9 44 09 PM

after when detect first time trx then response but after this again giving error on every calls

Screenshot 2023-12-28 at 9 45 15 PM
ohari5336 commented 10 months ago
Screenshot 2023-12-28 at 10 07 31 PM

my concern is very simple to resolve this error add already existing hash checks to save data on the table

maybe here see

dlamarmorgan commented 9 months ago

HI @ohari5336

The table you're referring to (block_headers) currently has a primary key that is the hash of the transaction. Therefore it must be unique. As I mentioned before, my suspicion is that you are creating transactions that have the same hash in your local private geth blockchain. Below I have an example of what to look for in the geth node output.

A sample of output from the geth node should look like the following image

Notice that for each block number (9, 10, 11, 12 etc.) there is a different value for the hash (c5af4e, 0f0778, etc.). Even though these are all transactions that token transfer to the same recipient address, they have a different hash, which allows them all to be correctly entered into the block_headers table, as you can see below. image

The hashes in the first image (geth node output), should all be present in the second image (transactions in the block_headers table) along with their corresponding block number.

I see your post with a picture of your block_headers DB, and only a single entry, but we should also look at your geth node output to verify that the other transactions are in the blockchain.

Hope this helps!

dlamarmorgan commented 9 months ago

This issue has been closed, as there has been no recent activity, and the Geth library has been updated.