Suggest creating an RPC that extract the list of SwapDeals done.
We have interesting data there list status, state, errormessae, createtime, executetime, completetime that the educate us and help to debug.
For now, we can show information from memory but in the long run, we should store/extract from the database.
Do we want to store all swap deals to the database, including failures? I think it would make sense (separate from this PR) to write finished deals to the database and remove them from memory.
Since we deal with "real" money, we need to record everything.
Minimum would be a log file which is not getting lost easily.
Better to log to database swap, orders, etc. Everything that deal with
money.
In general, we should never permanently delete these objects. It is ok to
delete from memory but only when backed to a persistent storage.
IMHO
On Fri, Sep 14, 2018 at 2:31 PM Daniel McNally notifications@github.com
wrote:
Do we want to store all swap deals to the database, including failures? I
think it would make sense (separate from this PR) to write finished deals
to the database and remove them from memory.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ExchangeUnion/xud/issues/477#issuecomment-421330895,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJQ0cvZO2GnVcvWch1KD8haKQ4QSvyMAks5ua5OJgaJpZM4WpDtU
.
Sounds good to me. Although we are not putting orders themselves in the database, we'd have a record of any that get filled via swaps.
Yes we want to save all successful swaps in the db. See https://github.com/ExchangeUnion/xud/issues/161. So this issue is about implementing a RPC call to query these.
Feel free to put proposals for the datafields please into #161 :)
Question on this, should this query the db? If we are only keeping "active" swap deals in memory - which makes sense to me - but means that there won't be many swaps available at any given times (only ones that are in progress). If so, it would seem a precursor is actually saving completed swaps to the db. I figure we'd want to set a limit on what we query, and not return the full history of swaps each time we call this.
I will make a pr for this issue along with issue #562 I'm working on.
Yes, I believe this should query the db @sangaman , hence dependent on https://github.com/ExchangeUnion/xud/issues/562 . But important for exchanges to see 'results' of their testing.
Do you need help on this one? @ImmanuelSegol
Do you need help on this one? @ImmanuelSegol
No I'm going to finish it after #569 so I can fetch them for the DB.
@sangaman @kilrau What data from the swap deal should we return?
My inclination is to go with everything in the database.
I'd probably wait until #623 is merged, at which point I think we'll want to do a join on the new orders table. I'll provide more details soon.
Closing this in favor of a single rpc call for swaps/trades - #1567.