Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 2.08 KB

README.md

File metadata and controls

63 lines (45 loc) · 2.08 KB

cln4go

Go library for Core Lightning Daemon with flexible interface

GitHub Workflow Status GitHub go.mod Go version (subdirectory of monorepo)

This repository contains a sequence of libraries that are useful to work with Core Lightning Daemon and develop with Core Lightning using Go.

Packages

These are the complete list of craters supported right now

Crate Description
clng4go-client Package that provides means to make RPC bindings from Go code to the core lightning daemon
cln4go-plugin Package that provides a plugin API to give the possibility to implement a plugin in Go
cln4go-common Package that provides common interface for the monorepo. Go

How to Use

Core Go Client

	path := os.Getenv("CLN_UNIX_SOCKET")
	if path == "" {
		err := fmt.Errorf("Unix path not exported with the CLN_UNIX_SOCKET env variable")
		panic(err)
	}
	client, err := NewUnix(path)
	if err != nil {
		panic(err)
	}
	response, err := Call[UnixRPC, MapReq, GetInfo](client, "getinfo", make(map[string]any, 0))

Please look inside the client/unix_test.go for more usage examples.

Core Go Plugin

Please look inside the plugin/example/simple_plugin.go for examples.

Contributing guidelines

Read our Hacking guide

Supports

If you want support this library consider to donate with the following methods