-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to define custom parameters in an interface data definition (*.capnp) ? #51
Comments
I'm happy to help debug if you post a git tag. I think probably for your case, you don't need to build on bitcoin/bitcoin#10102 and just bitcoin/bitcoin#19160 should be sufficient. Everything you posted and wrote is right. To use custom C++ types in interfaces, you need to either use $Proxy.wrap and list all fields in the type, or you need implement CustomReadField/CustomWriteField/CustomPassField overloads to read/write the C++ type as a capnp type. The CustomReadMessage/CustomBuildMessage overloads you mentioned are added in bitcoin/bitcoin#10102. They are a simpler alternative to CustomReadField/CustomWriteField/CustomPassField and can be defined in .cpp instead of .h files since they aren't template functions. bitcoin/bitcoin#10102 also adds CustomReadField/CustomWriteField/CustomPassField overload that detect if a type has Serialize/Unserialize methods and will use those if them if they are available. |
Thanks to propose to help on the debug, here the git tag : ariard/bitcoin@ddcfd07. Note, you need to pass the following configuration flag I'm trying to follow the first path for my custom C++ types, i.e $Proxy.wrap and list all fields in the type. I'm encountering the following build error :
AFAICT, such |
The Because I'm building your branch and can post a patch soon. |
Following commit should fix the BuildPrimitive error: ryanofsky/bitcoin@e53c7a9. It just pulls in common-types.h functions from bitcoin/bitcoin#10102 to be able to handle serializable types. There are still some other build errors on the branch, which I can try to help with, so feel free to ask any followups! |
Thanks for the answer on this, I finally fixed the other build errors by rebasing and tweaking few others files. I can build the data definitions I want and making progress on my altnet branch. I don't have other |
Will close this issue, but feel free to reopen or post questions or work-in-progress code in new issues. Happy to help! |
Sure, fyi the WIP branch is here: https://github.com/ariard/bitcoin/commits/2021-07-altnet-lightning, where I'm able to chain multiple processes : |
I've successfully added and built API/data definitions for my new Validation interface
I would like to add a custom parameters to my interface :
But so far, I'm hitting libmultiprocess compilations errors which are beyond my understanding for
now.
AFAIU by observing the interfaces in #10102, you have two options to add a custom parameters :
struct WalletTxOut $Proxy.wrap("interfaces::WalletTxOut")
)CustomReadMessage/CustomBuildMessage
)I should rebase my branch on top of #10102, as this branch includes a lot more of common helpers.
Feel free to correct the terminology I used, I'm progressively catching up on libmultiprocess usage :)
The text was updated successfully, but these errors were encountered: