-
Notifications
You must be signed in to change notification settings - Fork 22
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
we need a python module #71
Comments
While I definitely see and understand your issue, I don't think we should start adding language specific modules to this repository. Otherwise we'll end up needing to maintain such modules for a whole list of languages. I believe WASM should be the common ground as there seem to be WASM interpreters out there for most languages. So we should instead focus on making sure the generated WASM binary can be used with tools such as If you want to create and maintain a Python module outside of this repository, then by all means go ahead. We'll probably even link to it. |
I can see that the python package itself should be a separate repository like https://github.com/lightninglabs/lnc-rn, but in the Makefile here you have apple/ios/macos/android binary builders. That's the only reason I suggested it here. I thought maybe the Makefile would have the necessary options added to build the binary file for the python package. For fun, I did just try gopy to see what it it would do and am getting stumped with the following error:
|
That looks fine, it's just skipping the top level I think what we need to do is extract some of this, into something more easily useable as a module: https://github.com/lightninglabs/lightning-node-connect/blob/master/cmd/wasm-client/main.go. Most of the stuff needed to connect a client lives here: https://github.com/lightninglabs/lightning-node-connect/tree/master/mailbox. On the upside, |
Hi @Roasbeef. Both PRs linked were merged, indicating that a WASI build of LNC should be possible. This would be great as I can potentially add it as an option as a BTCPay Server Lightning node backend as per btcpayserver/btcpayserver#4859 and btcpayserver/btcpayserver#5626. I briefly tried to modify the wasm make action to see if it was trivial (I have absolutely no go knowledge so it might actually still be trivial) but got the following: wasi step (just changed GOOS to wasip1):
|
Hey @Kukks! Awesome, it would be really nice if you'd be able to add LNC support for BTCPay Server Lightning node backends 🎉!
The error your seeing is due to that the files in the |
@Kukks @AndySchroder would compiling this into a daemon work for your use cases ( We are thinking about doing this for SN's backend which needs:
Also, more just preferentially, we'd prefer to avoid loading wasm on the application server. |
Currently lightning node connect is written in go and compiled to web assembly for use in https://github.com/lightninglabs/lnc-web within a browser using javascript. Initially, I thought that maybe web assembly was the most universal way to use lightning node connect, so I tried to use web assembly from python with wasmer. In #70 I mention that I can't get it to work with wasmer.
Later, I learned that Zeus uses https://github.com/lightninglabs/lnc-rn which has the go code compiled to native binaries for mobile (lightninglabs/lnc-rn#23) and does not use web assembly.
Now, I'm wondering, would it be simpler to make a python module that uses natively compiled go code instead of using web assembly code within python? Here are some relevant resources
With the new LND Accounts feature (lightninglabs/lightning-terminal#363 , https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/accounts) that leverages Lightning Node Connect, it's critical that there are more ways to use Lightning Node Connect in a variety of code bases. The LND Accounts feature can safely and easily allow a wide variety of applications and machine to machine devices to use the lightning network.
The text was updated successfully, but these errors were encountered: