Giter Site home page Giter Site logo

nostr-control's Introduction

nostr-control

Formatter Tests

Planned Features:

  • Disable events
  • Only settled forwards
  • Channel summary
  • Routing summary
  • NWC (NIP-47, Nostr Wallet Connect)

Description

nostr-control is a Core Lightning plugin that allows you talk to your node over Nostr DM. It also will send you events from your node over Nostr DMs.

Requirements

Tested with Core Lightning v23.02.2 and Node 18. nostr-control uses the sql lightning-cli method so any version that supports that should work.

Screenshots

Info Channel Summary Create Invoice Pay Invoice Get Address See Forwards New Blocks (etc.)
IMG_2262 IMG_2348 IMG_2258 IMG_2352 IMG_2261 IMG_9AF1D5254260-1 IMG_2258

What can I do with it?

When you first set up nostr-control you will start recieving DMs from your node about events that are happening. By default you will receive all events, but you can change this in the config file.

The events you can receive are:

  • channel_opened
  • channel_open_failed
  • channel_state_changed
  • connect
  • disconnect
  • invoice_payment
  • invoice_creation
  • forward_event
  • sendpay_success
  • sendpay_failure
  • coin_movement
  • balance_snapshot
  • block_added
  • openchannel_peer_sigs
  • shutdown

The most interesting thing about nostr-control is that you can communicate with your node. You can respond to it in your DMs and get information about your node. /help will give you a list of commands you can use.

Available Commands:

  • /help - Get a list of commands
  • /info - Get information about your node
  • /channels - Get information about your channels
  • /funds - Get information about your funds
  • /invoice - Create an invoice (pass amount_sats, label, and description)
  • /pay - Pay an invoice (pass bolt11)
  • /address - Get a new address (Bech32)
  • /donate - See how you can donate to the project
  • /issues - Open a GitHub issue
  • /verbose - show everything (including failed forwards)
  • /quiet - show only successful forwards (and payment related events)
  • /silent - show no notifications
  • /version - see the version of nostr-control you are running

How do I set it up?

nostr-control uses Node.js and npm. You can install them from here.

  1. Clone the repo into your plugins directory (DO NOT RUN npm install packages are checked in and there is a modification needed for this to run.)
  2. Set up a config file (config.json) in this project's directory (see below)
  3. Register the plugin with lightningd (https://docs.corelightning.org/docs/a-day-in-the-life-of-a-plugin)

Config File

nostr-control needs some Nostr information to work. Specifically these items:

Required

  • relay - The relays you want to send events to
  • bot_secret - The account that will be sending you DMs
  • your_pubkey - Your pubkey so you will receive the events

Optional

  • verbosity - How much information you want to receive (see above)
  • show_failed_forwards - Whether or not to show failed forwards (see above)

There is an example config in the root directory example-config.json it looks like this. Input your information there and nostr-control will pick it up.

{
  relay: "some_relay",
  bot_secret: "some_secret_key_hex",
  your_pubkey: "your_pub_key_hex",
  verbosity: "verbose",
  show_failed_forwards: true
}

nostr-control also keeps track of it's own settings so you can update things on the fly. Create your config.json in the root directory and it will be picked up.

You probably won't need to change that but that's where things you set while running will be stored.

How do I get my bot secret?

Just create an account on any Nostr app and use the secret key (hex). You can also update the profile picture etc. this way.

Contribute ( please do )

PRs and Issues are welcome. Follow me on Nostr npub19a86gzxctwtz68l8zld2u9y2fjvyyj4juyx8m5geylssrmfj27eqs22ckt or leave me a tip at my lightning address: [email protected]. Can also leave a tip on my site: Klabo.blog

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.