-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: txwrapper-template & CHAIN_BUILDER guide #35
Conversation
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.
Good stuff and thanks for the detailed docs! Left some nits and suggestions.
CHAIN_BUILDER.md
Outdated
@@ -8,23 +8,118 @@ Creating a txwrapper package will expand the offline signing options for users o | |||
|
|||
## Note | |||
|
|||
This guide has very specific instructions on how to structure the public API of a chain's txwrapper package. This approach is taken by txwrapper-core's maintainers so users of existing txwrappers can quickly integrate with newly created txwrappers for `FRAME`-based chains. Feel free to open up a github issue to discuss any of these aspects. | |||
This guide has very specific instructions on how to structure the public API of a chain's txwrapper package. This approach is taken by txwrapper-core's maintainers so users of existing txwrappers can quickly integrate with newly created txwrappers for `FRAME`-based chains. Feel free to open up a github issue in this repo to discuss any of these aspects. |
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.
This guide has very specific instructions on how to structure the public API of a chain's txwrapper package. This approach is taken by txwrapper-core's maintainers so users of existing txwrappers can quickly integrate with newly created txwrappers for `FRAME`-based chains. Feel free to open up a github issue in this repo to discuss any of these aspects. | |
This guide has very specific instructions on how to structure the public API of a chain's txwrapper package. This approach is taken by txwrapper-core's maintainers so users of existing txwrappers can quickly integrate with newly created txwrappers for `FRAME`-based chains. Feel free to open a github issue in this repo to discuss any of these aspects. |
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.
"This approach is taken by txwrapper-core's maintainers so users of existing txwrappers can quickly integrate with newly created txwrappers for FRAME
-based chains." – this is a bit hard to read; not sure what to suggest here though. Maybe we can remove it?
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.
How about "This approach is taken so existing txwrapper users can easily integrate new txwrappers."?
CHAIN_BUILDER.md
Outdated
``` | ||
|
||
3) **Choose relevant methods to re-export** | ||
You will need to choose what pallet methods you want your txwrapper to expose. If you just need methods from Substrate or ORML pallets, checkout txwrapper-substrate and txwrapper-orml to see if the methods are already defined. |
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.
Maybe link to the docs for txwrapper-substrate
/txwrapper-orml
here?
Do you think it would be a good idea to explain what kind of pallet methods it makes sense to export or do we expect the reader to come with that knowledge?
console.log(`\nExpected Tx Hash: ${expectedTxHash}`); | ||
|
||
// Send the tx to the node. Again, since `txwrapper` is offline-only, this | ||
// operation should be handled externally. Here, we just send a JSONRPC |
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.
Maybe we should just log the tx or dump it to disk and end the script here and then add a separate script to submit the tx? To make it super-extra clear what the point of txwrapper
is: prepare a transaction on one machine and send it off somewhere else?
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.
I thought about being more explicit in the example with separating online/offline parts, but I think users need to design their own flow and this example is simply how to use the methods. For example, some flows may only use txwrapper to decode on the offline device (using another tool for sig generation), combining the signature with payload on an online device. I also think the example/README
Offline vs Online section goes into enough detail
} | ||
|
||
/** | ||
* Signing function. Implement this on the OFFLINE signing device. |
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.
👍
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: Andrew Plaza <aplaza@liquidthink.net>
Closes #9
Closes #33
What to review for:
Follow up work: