Skip to content

LightningBuddy Commands

Elaine Ou edited this page Feb 15, 2018 · 2 revisions

GETINFO

Request information about the lightning node attached to a bot. This command is usually issued between bots to exchange contact information.

Parameters

None.

Returns

  • URI - Lightning node URI, in the form of node_id@host (which can end in :port if not default)

Example

CONNECT

Connect to another lightning node. This command is issued as an instruction from the bot owner to the bot.

Parameters

One of the following:

  • username - Twitter user that you wish to connect to
  • URI - Target node, in the form of node_id@host (which can end in :port if not default)

Returns

  • node_id - Node ID of connected peer

Example

GETINVOICE

Request an invoice for some amount. This command is usually issued between bots following a payment instruction.

Parameters

  • amount - Amount to invoice, in satoshis
  • description (optional) - Description of invoice

Returns

  • invoice - BOLT11 invoice for payer

Example

PAY

Pay a Twitter user. This command is issued as an instruction from the bot owner to the bot.

Parameters

  • amount - Amount to send, in satoshis
  • username - Twitter user that you wish to pay
  • description (optional) - Description of payment

Returns

  • preimage - payment preimage which hashes to the 'payment_hash' generated in the invoice, to prove that the payment was successful.

Example

FUNDCHANNEL

Fund payment channel to a Twitter user's lightning node. This command is issued as an instruction from the bot owner to the bot.

Parameters

  • username - Twitter user that you wish to fund a channel with
  • amount (optional) - Number of satoshis to commit to the channel. Will default to amount set in config.py

Returns

  • funding_txid - Transaction ID of funding transaction

Example