Connect any application to your node without disclosing your node information
- Install Node.js (only v18 tested)
- Get Una-connect
git clone https://github.com/blc-org/una-connect
cd una-connect
yarn install
yarn build
- Scaffold your node
npm run scaffold
This command will generate 2 files. config.json
and events.json
events.json
is the file where event ids has been processed. You don't need to do anything with this fileconfig.json
is your configuration file. It looks like this
{
// "node" is your personnal (and secret) configuration part
"node": {
// nostr.privKey and nostr.pubKey will be generated automatically
"nostr": {
"privKey": "",
"pubKey": ""
},
// Your Lightning node configuration. Chose one of the supported backend
"lightning": {
"backend": "", // LndRest, ClnRest, ClnSocketTcp, ClnSocketUnix, Eclair
"lndRest": {
"url": "",
"hexMacaroon": ""
},
"clnRest": {
"url": "",
"hexMacaroon": ""
},
"clnSocketTcp": {
"host": "",
"port": 0
},
"clnSocketUnix": {
"path": ""
},
"eclair": {
"url": "",
"user": "",
"password": ""
}
}
},
// "services" are services where you want them to control your node
"services": [
{
"pubKey": "", // the Nostr pubKey of the service you want to authorize
"authorizations": [
"createInvoice", "payInvoice"
]
}
],
// a list of nostr relays. You need to put at least one (more is better) same used by services
"relays": [
"wss://nostr-pub.wellorder.net"
]
}
- Launch
npm run start
Actions are JSON sent by an authorized service to control your node. It uses encrypted direct message (NIP-04) and have to be authorized in your config.json
file.
createInvoice
{"action": "createInvoice", "createInvoice": {"amount": 1000, "description": "Hello from Una-connect!"}}
payInvoice
{"action": "payInvoice", "payInvoice": {"bolt11": "lnbcrt10u1p34...yufwppz6cp69j0zh"}}
yarn dev:build
compile (+ watch changes) TS files into js filesyarn dev:start
launch (+ watch changes) Una-connect