-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature : Pinning as a service and Recover Token [Tokenchain] #189
Conversation
Suggestion for Enhanced Flexibility: To improve the generalizability and future-proofing of the command interface, consider the following changes:
This approach makes the commands and endpoints less tied to a specific token type ("rbt"), allowing for easier adaptation for other token types that are introduced later. |
ae55c7b
to
1b26c5f
Compare
f816d92
to
74f9cc3
Compare
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.
Unpledging of tokens and Self Transfer working as expected
The pinning service allows token owners to pin their tokens on a pinning node on their behalf. The token's ownership remains unchanged; the pinning node will have all the information about the pinned token and token chain. The recover token feature allows us to retrieve the token and tokenchain from the pinning node.
Commands added :
Eg:
./rubixgoplatform pinToken -port 20013 -senderAddr bafybmibw7lvjidvlohhdsdshbj4bcly7y6zwanlwcloj5puaizzstyfbhi -pinningAddress bafybmihs3hniinkuk3nh2bo4geyljevyjjyixtnrn3tdqe3yecqrzv22qq -rbtAmount 1 -transComment "Test Pinning As a service " -transType 2
Eg:
./rubixgoplatform recoverToken -port 20015 -senderAddr bafybmibw7lvjidvlohhdsdshbj4bcly7y6zwanlwcloj5puaizzstyfbhi -pinningAddress bafybmihs3hniinkuk3nh2bo4geyljevyjjyixtnrn3tdqe3yecqrzv22qq
APIs added :
Request Structure :
Request Structure :
Test Results :
- The status in the sender node changed to 4 (TokenisTransferred)
- In the pining node the status is still 15 (TokenIsPinnedAsService)
- The error is insufficient balance, the reason is that, when we fetch the balance from the db, we are searching the token table with the did value, in the tokentable of the pinned node, the did value will be of the sender node, basically the owner node. Also even if that is changed in that particular part, in the latest tokenchain block when the ownership is checked the tokenownership check will fail and the pinning node won’t be able to transfer this token.
- When an already transferred token which was existing in the pinning nodes db was recovered and transferred, the transaction didn’t go through. Consensus failed and the tokenstatus in the recovered node’s db was changed to 12(Tokenchainsyncissue). Basically the node was not able to sync the tokenchain. In the quorum part the log showed the tokenstate was already pinned.