iguana DB - yes it does need a DB for some things

jl777

Active Member
Feb 26, 2016
279
345
iguana actually does need a DB, but so far only for saving privkeys and matching up accounts to addresses

my plan is to make a DB middleware layer and just put in a reference DB or two. if anybody wants to change the DB, they would need to make a glue layer, basically initialize a structure with the functions for put, get, etc. and set its name. then they can select that DB per API call or globally

this gets out of the my DB is better than your DB debates. The only requirement is that it needs to be a DB that is linkable into the iguana, though even external DB could be used with a glue layer that has the interface code

I dont think there is a one size fits all DB that will work for all cases, as some users could use sqlite, or even just a flat JSON file, since they would just have several addresses

while other use cases would be more like MGW, that would need to track arbitrary number of account mappings.
 

jl777

Active Member
Feb 26, 2016
279
345
turns out DB wasnt needed.
I ported DJB's cdb to use as the default DB, but then I realized I only needed to store the accounts with list of address/privkeys as all the txdata is already there for all accounts

and to support all the encryptwallet, walletpassphrase, etc. RPC calls, i had to encrypt things at a low level, so I just added a payload to the login JSON and put the accounts and address/privkeys into the JSON.

still need to use the "save to tmp file and rename" method to make it atomic, but now all the wallet RPC is active and in testing.
 
  • Like
Reactions: grewalsatinder