-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: database structure #80
Conversation
docs/DATABASE.md
Outdated
### Orders (`orders`) | ||
- order - String: order identifier provided by the frontend | ||
- payment_status - Enum: (pending|paid|timed_out). | ||
- withdrawal_status - Enum: (waiting|failed|completed|none). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might need "forced" status as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c69aa99
@@ -0,0 +1,32 @@ | |||
Plan is to update the database scheme in a way that it will support the requirements we have as for the API specs and additional improvements of the deamon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these things derived from API? Please indicate if something is different from types defined there, ideally these should be as similar as possible, but deviations are ok where they make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c69aa99
- order - String: order id to link transaction to order | ||
- chain - String: identifier for the chain where transaction occured | ||
- block_nmber - Integer: Block number where the transaction is recorded. | ||
- position_in_block - Integer: Position of the transaction within the block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might also (later?) want to store the block for which transaction was submitted. It is included into saved transaction bytes though, so maybe not
Firstly, tables aren't enough. We also need to define keys for them. Also, remember that our database backend ( Another suggestion is to make the database store an absolute basic data that can't be fetched from a blockchain by a simple query. Now about the scheme itself. It'd be nice to have descriptions for enum variants, too. Like we already have in the API specification:
|
@fluiderson thanks a lot for wrapping it up, I've addressed the remarks below or with code suggestions.
the keys are
My goal with this Pull Request is to have a discussion and decide as for database structure, we can describe here enums as well, but thats not the goal atm.
|
What's the transaction ID? Do you mean the extrinsic ID from Subscan?
We can store transactions in a single table as per my key design. What're the benefits of adding another table or field in the
To store a transaction, we need its ID. Until it isn't included in the block, what ID should we use for it, then? Either this is a fundamental flaw in our API spec or we need to come up with a more complex key to identify both included & pending transactions.
So, the current key checking, the key rotation mechanism, the chains genesis checking will be in future versions, too? If yes, then please remove the |
@fluiderson I definitely would prefer having extrinsic but as you said that won't allow us to precreate the transaction.
removed |
discussed with @fluiderson
|
@Slesarew this can be merged |
Want to discuss database structure here