Giter Club home page Giter Club logo

clightningjs's People

Contributors

darosior avatar mrhash avatar rsbondi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

clightningjs's Issues

Getting Started

Hey --

I am trying to write a plugin for my C-Lightning node in Javascript and came across this library.

I tried to get the Hello World example up and running but I am struggling a bit.

My first question (and this might be stupid) is do I need node and npm installed on the device that my node is running on? I assume yes, but want to make sure.

Once that's cleared, I assume I can clone my repo, npm install, and then run lightningd --plugin=/data/lightning/plugins/clightning-plugin-sandbox, correct?

Thank you!

Automated tests

We definitely need to add a test suite, people are using this and I still shamefully test new updates by-hand with a regtest and the plugins in test/.

Forward event notification plugin runs only once

Hi,

I build a plugin using clightningjs package that subscribe to forward_event notifications, but the plugin is notify only about the first payment routed through the node that runs the plugin. After the first routed payment the script is not running.

This is the plugin code:

listenPlugin.subscribe('forward_event');
listenPlugin.notifications.forward_event.on('forward_event', (params) => {
  if ( params.forward_event.status == "settled" ) {
     fs.writeFile('log', JSON.stringify(params.forward_event), () => {});
  }
});

listenPlugin.start();

And I'm running my c-lightning (v0.8.0) node like this: lightningd --plugin="/home/ln/forward-notify.js"

Any idea way?

Thanks.

Unhandled 'error' event

Hi
I have noticed the following error in c-lightning log, when I am running my js api server as a plugin. Not able to replicate the scenario, which caused this, but thought to report, in case you want to take a look.

Please note, once this error is encountered, c-lightning aborts.

My project: https://github.com/saubyk/c-lightning-REST

events.js:186
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:150:25)
    at writeGeneric (internal/stream_base_commons.js:141:3)
    at Socket._writeGeneric (net.js:768:11)
    at Socket._write (net.js:780:8)
    at doWrite (_stream_writable.js:428:12)
    at writeOrBuffer (_stream_writable.js:412:5)
    at Socket.Writable.write (_stream_writable.js:302:11)
    at Plugin.writeJsonrpcNotification (/REDACTED/node_modules/clightningjs/src/plugin.js:115:8)
    at /REDACTED/node_modules/clightningjs/src/plugin.js:101:12
    at Array.forEach (<anonymous>)
Emitted 'error' event on Socket instance at:
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at onwriteError (_stream_writable.js:443:5)
    at onwrite (_stream_writable.js:470:5)
    at internal/streams/destroy.js:49:7
    at Socket.dummyDestroy [as _destroy] (internal/process/stdio.js:7:3)
    at Socket.destroy (internal/streams/destroy.js:37:8)
    at afterWriteDispatched (internal/stream_base_commons.js:150:17)
    at writeGeneric (internal/stream_base_commons.js:141:3)
    at Socket._writeGeneric (net.js:768:11)
    at Socket._write (net.js:780:8) {
  errno: 'EPIPE',
  code: 'EPIPE',
  syscall: 'write'
}
Abort trap: 6

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.