dcrdata icon indicating copy to clipboard operation
dcrdata copied to clipboard

use db instead of searchrawtransactions

Open chappjc opened this issue 4 years ago • 0 comments

Requires https://github.com/decred/dcrdata/pull/1922. This PR starts with the use db instead of searchrawtransactions commit.

dcrd's addrindex is no longer required. Previously it wasn't even really strictly necessary except for a single http endpoint and unused functions; sync always worked without it.

There are breaking changes as a type has change, but this is in dcrdata/v7 only, which is not yet tagged.

db/dcrpg:

Rewrite GetAddressTransactionsRawWithSkip to use the pg db instead of the searchrawtransactions RPC.

Remove InsightSearchRPCAddressTransactions, which was unused.

api/types:

Stop using chainjson.VinPrevOut.

Add VinShort type that is similar to chainjson.Vin, although lacking Sequence and ScriptSig, and the Coinbase, StakeBase, etc. fields are just booleans rather than strings. The VinPrevOut type is not even emulated because it was almost useless: the amount was already in the Vin struct, and the address of the prev out is not of high importance when requesting address transactions. ref https://github.com/btcsuite/btcd/pull/487 The prev out in that is no longer provided.

Redefine AddressTxRaw with new VinShort type. This only changes responses from the various /api/address/{addr}/.../raw endpoints. Turns out it wasn't Insight using this after all, which is good because the Insight consumers are less adaptable.

chappjc avatar Oct 09 '21 23:10 chappjc