Got a few Qs/todo items for you:
* with balances, what is the difference between CBALANCE, CBALANCET, ubalance and ubalancet???
CBALANCE = Confirmed Balance
CBALANCET = Confirmed Balance (Test)
UBALANCE = Unconfirmed Balance
UBALANCET = Unconfirmed Balance (Test)
* it appears you clear out the transactions_processed table totally every run. If I have an API query going on during this time when it's cleared and being regenerated, I would return bad data. Can you regenerate into a temp table and rename, or come up with another way? I can pause transactions for now when this is being regenerated, but that's kind of ghetto.
Yep - doing full state processing on every run is useful in these early stages for hunting bugs. This was much less of an issue for the first version of the engine as processing only took a few ms. As we scale out this is no longer viable so temp tables will be used (already are in my wallet). On the to-do list
* masterchest-engine sql versioning - have a version table or a way for me to deduct the sql schema version....auto schema upgrades in masterchest-engine would be best... worst case, if blow away the DB on schema upgrades, if necessary, and regenerate...
Will consider this. Whilst it was just me using the engine for masterchest.info obviously it didn't matter so much, but if others are going to make use of it I can see how this would be valuable.
* have a way for me to query the masterchest-engine version
No problems here - not difficult to add a -ver switch.
* an abundance of magic numbers -- makes the code confusing to read. e.g. what does "If .Item(6) < 999998 Then" mean??? What is that 999998 lack of comments around these kinds of things. Also, things like "curtype = 1" -- maybe use enums instead? A future task I'm sure...I know you're busy getting Dex working (and my sqlite integration )
Haha - the magic 999998 is for my unconfirmed transaction processing. 999999 is a dummy block number for an unconfirmed transaction. Again as I mentioned below there is some cleanup to be done - this (along with a couple other tricks) was a quick and dirty way of supporting the display of unconfirmed transactions on masterchest.info.
* what timezone does masterchest-engine store -- we should probably force UTC time. Or, the timezone must be stored with it
Doesn't store a timezone at all, it stores the blocktime as recorded in the blockchain. You should do localization after retrieving transaction times from the db, not while storing them.
* you have no indexes on any rows, columns of your database. This greatly can impact performance. Do you have plans to add indexes?
As needed sure - I haven't run into any performance issues yet (none of my queries take longer than a few ms) which is why I don't have them, but they can be added without to much difficulty if needed.
* from transactions_processed, how do I tell what kind of transaction it is (multi-sig, class A, etc)?? can you add this into the schema?
You can tell what kind of transaction it is from the type column (send, selloffer, acceptoffer etc). The transaction encoding class isn't stored as I haven't come across a need for it. Simple sends are the only supported Class A transaction type. If you throw a simple send to mlib.getmastercointransaction it'll return the correct tx details regardless of whether it used Class A or Class B encoding.
It's not hugely disruptive to add it, but could I ask what you'd be using it for?
* also, for transactions_processed, does "VALUE" include the bonus amount for txns in the exodus period, or not?
Assume you mean for the 'generate' transaction type - and yes, 'generate' transaction types include the early adopter bonus.
Hey rbdrbd,
Sorry for the delayed response, I was away for the weekend & when I got back the forums were down. Yep the code is quite scrappy but functional and will be cleaned up as time allows. Please see inline for responses to your Qs.
Thanks!