Skip to content
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

Unable to PublishTransaction #8

Open
losh11 opened this issue Jan 14, 2025 · 1 comment
Open

Unable to PublishTransaction #8

losh11 opened this issue Jan 14, 2025 · 1 comment

Comments

@losh11
Copy link

losh11 commented Jan 14, 2025

Trying to use LND to broadcast a raw transaction, using the walletkit rpc PublishTransaction.
No matter what I do, LND doesn't seem to be able to see the transaction, looking at the logs I see this:

2025-01-14 09:53:16.932 [ERR] RPCS: [/walletrpc.WalletKit/PublishTransaction]: must provide a transaction to publish
2025-01-14 09:53:16.932 [ERR] RPCS: [/walletrpc.WalletKit/PublishTransaction]: unexpected EOF

Here's how I tried to publish a transaction:

const rpc = await publishLndTransaction(
  create(TransactionSchema, {
    txHex: Buffer.from(rawTx),
    label,
  }),
);

and also like this:

const rpc = await publishLndTransaction({
  txHex: Buffer.from(rawTx),
  label,
});
@hsjoberg
Copy link
Owner

Hey @losh11!

Hmm strange. Not sure what's going on. What is Buffer and where is it coming from? That doesn't exist in JS or react-native's env as it's a NodeJS API.

I usually convert hex to Uint8Array via this helper function:
https://github.com/hsjoberg/blixt-wallet/blob/c35c09fd43c7a9872212fd2b440056eb219fccdc/src/utils/index.ts#L74-L76

The error message from lnd seems to suggest the input arg is not being sent correctly. Hmm.
https://github.com/lightningnetwork/lnd/blob/4b16c2902ea251eb4d464f9670a10ed04757f065/lnrpc/walletrpc/walletkit_server.go#L666-L669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants