/images/sob.png

lndart.cln is a Dart framework for Core Lightning. This package is really handy if you wish to interact with your lightning node and develop some cool plugins for it. This post offers detailed guide on how you can start contributing to the lndart.cln package.

The only requirement is to have a working Dart SDK. You can follow instructions from here to get up and running.

To get started, one should first fork and clone the repository lndart.cln. The instructions on doing that can be found here.

Let’s first understand the structure of this repository.

The repository is structured as a monorepo which means it houses several related tools together, four in this case:

packages
|
└─── cln_common
|
└─── cln_plugin
|
└─── lnlambda
|
└─── rpc
  • The lndart.cln_common package houses all the utilities and interfaces for other subsidiary packages to use.
  • lndart.cln_plugin is a Dart library that provides ergonomic support to developing custom plugins for Core Lightning. It provides comprehensive and robust support to developing plugins using functional and object-oriented methods.
  • lnlambda is a minimal interface to run lnlambda function with Dart.
  • The lndart.rpc package is a cool tool to interact with the Core Lightning RPC interface.

If you are looking to contribute to the repository, it is highly recommended that you go through the Hacking Guide.

This is a well documented package with essential examples guiding you along the way in case you get stuck. The documentation can be found here.

You can use any IDE or text editor of your choice to hack the codebase or develop plugins. A good recommendation would be IntelliJ IDEA with the Dart plugin installed.

It is expected that any patches submitted are well formatted. To ensure this you should run make fmt inside the package directory. You can also use the dart formatter for this by running dart format file-name.

All code must be written with the expectation of a successful release. As with lndart.cln, we have the possibility to release the packages either individually or simultaneously. To make our lives easier, we can generate the changelog before a release with a minimal overhead using changelog.dart.
The instructions on how to make a release can be summarized as following:

  1. Bump the version number in the package and the changelog.json according to the package versioning guide.
  2. Generating the changelog for the package(s) is essential for every release. To generate the changelog you can refer to here.
  3. Make a GitHub release using the following tags:
    • Minor release: {package_name}-v{version_number}
    • Major release: v{version_number}

License

MIT License

Copyright (c) 2023 swaptr

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.