Closed AlonzoRicardo closed 1 year ago
Yes, Taro is something I want to play with myself, so I'll definitely be spending some time on this pretty soon.
Thanks for the request, it's very helpful to know if others would find it useful as well.
came here to see if this request existed. +1 I'll also add, it would be cool to be able to add similar daemons like pool or peerswap.
any updates on this? has work already began? can we contribute?
Yes, I have begun work on this. I'm currently trying to figure out an architecture that not only supports Taro but is also flexible enough to make adding additional node types as simple as possible. Nodes such as loop, litd, peerswap, fedimint, RTL, thunderhub, block explorers, and many others. This is a much bigger lift than implementing just Taro alone. I may have to save this project for another time since it seems many people want Taro support ASAP.
Other than that idea, even if I proceed with Taro alone, it will likely be a custom build off a branch or in a pre-release state. Taro is still in early alpha with the expectation of breaking API changes in the near future. It also requires running the LND master
branch, which I wouldn't like to bundle in a stable release of Polar.
As you can see, there's a bunch of moving parts which make implementing Taro support a bit complicated. I still am going to work on a solution that allows devs to test out Taro easier than the the current method, but it'll likely remain a bit hacky until all the dependencies stabilize.
As far as contributions go, what would help me now is to understand what devs want to see exposed via the Polar UI. I assume everyone wants the ability to mint, list, and transfer assets. Is there any other information or functionality that you feel is important for Polar to surface?
i don't know if it helps a little bit, but i created a PR on Taro for Docker implementation https://github.com/lightninglabs/taro/pull/179
@mroxso That does save me a bit of time. Appreciate the update.
@jamaljsr For taro, Yea miniting, sending and signing( Which I don't think can be done yet). I've started to hack this together, I'm working on adding master branches to the docker images through build targets. which seams feasible, but I was thinking it might be better to have a install script that tests against the version,
if LND_VERSION == master
install go
build lnd from github
else
download and https://github.com/lightningnetwork/lnd/releases/download/v${LND_VERSION}/lnd-linux-amd64-v${LND_VERSION}.tar.gz
Maybe people would want a use specific tag of the github repo instead of the latest? I was thinking of incorporating that idea too. Am I going in a productive direction?
Perhaps this method is in line with the goal of having a generalized docker node? Perhaps if a repo is provided, we can procedurally retrieve the releases with something like
curl https://api.github.com/repos/lightningnetwork/lnd/releases | jq -r '.[] | .tag_name'
Hey @amovfx, yes I have already begun work on adding Taro support. I am implementing it in a somewhat generic way which will simplify adding additional dockerized "apps" for each node (ex: RTL, Thunderhub, Mempool.space, etc). This is a bit more work than just adding Taro alone but it'll open the door for more tooling support and UIs for the regtest networks. I should have an initial PR up in a week or so.
Regarding the x86/arm64 docker images, I have already been building multi-arch images for LND & bitcoind. These are what everyone is using in Polar today. You can see the Dockerfiles im using in this commit. I havent pushed these to master as i hit brick walls trying to get CLN and Eclair arm64 images working. This is another project I need to revisit.
For building the master branch or fork repos, I'd suggest using the custom nodes documentation. That should suffice for most devs as a starting point. I think there are too many possible unique scenarios for us to have Dockerfiles to suite everyone's needs.
@jamaljsr Thanks, I'll continue to poke around, I'm learning a lot about polar. If you think I can help, I'm willing, I have a lot of time on my hands.
Are you making a generic interface for getting the commands into the sidebar node details as well?
Are you making a generic interface for getting the commands into the sidebar node details as well?
Yes. It's not fully fleshed out yet but this is the goal.
By the way, I have been working on a TS Taro api module which could be useful for this feature as well.
@AlonzoRicardo this is great! Thanks for sharing. We'll likely need to use this.
@AlonzoRicardo Thanks for sharing this, huge help for getting a taro proxy client up and running.
I've been chipping away at this and finally have a docker stack with all the nodes running. GAH. But there is some legit strangeness.
# command: >-
# tarod
# --network=regtest
# --lnd.macaroonpath=/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon
# --lnd.tlspath=/home/lnd/.lnd/tls.cert
# --tarodir=/home/taro/.taro
# --rpclisten=0.0.0.0:10029
# --restlisten=0.0.0.0:8089
# —-lnd.host=alice:10009
command: '/bin/bash -c "su-exec taro tarod --network=regtest --lnd.macaroonpath=/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon --lnd.tlspath=/home/lnd/.lnd/tls.cert --tarodir=/home/taro/.taro --rpclisten=0.0.0.0:10029 --restlisten=0.0.0.0:8089 --lnd.host=alice:10009"'
These commands are essentially identical. The command with the argument list that is commented out. Doesnt work at all, and taro will refuse to connect to lnd. The second command from bash works and taro launches successfully.
I am at a complete loss.
Here is the entry point for further reference:
#!/bin/sh
set -e
# containers on linux share file permissions with hosts.
# assigning the same uid/gid from the host user
# ensures that the files can be read/write from both sides
if ! id taro > /dev/null 2>&1; then
USERID=${USERID:-1000}
GROUPID=${GROUPID:-1000}
echo "adding user taro ($USERID:$GROUPID)"
addgroup -g $GROUPID taro
adduser -u $USERID -D -G taro taro
fi
if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for taro"
å
set -- tarod "$@"
fi
if [ "$1" = "tarod" ] || [ "$1" = "tarocli" ]; then
echo "Running as taro user: $@"
exec su-exec taro "$@"
fi
echo "$@"
exec "$@"
Can you paste the docker logs when using the first command that doesn't work. It should start with something like "Running as taro user: ..."
@jamaljsr I got it all working now. It was the strangest thing, I noticed the argument in the debugger started with a hypen that was a few pixels longer that the other ones. I have no idea how it got in there, but it was a different character hypen. So lnd.host was being skipped by the parser.
Check it out from the post above, crazy, the first hypen on the lnd.host line is just a smidge bigger than the other ones.
# --restlisten=0.0.0.0:8089
# —-lnd.host=alice:10009
How nice would it be to integrate the Taro daemon to the system, there will surely be a lot of developers looking to play around with it and i have found Polar to be extremely useful for development environments, is this something that has been considered already?