installed https://github.com/Ride-The-Lightning/c-lightning-REST/
my cl-rest-config.json is
{
"PORT": 3001,
"DOCPORT": 4001,
"PROTOCOL": "http",
"EXECMODE": "production",
"LNRPCPATH":"~/.lightning/bitcoin/lightning-rpc",
"RPCCOMMANDS": ["*"],
"DOMAIN":"192.168.1.232"
}
launching cl-rest.js produces:
$ node cl-rest.js
Reading config file
warn: --- Starting the cl-rest server ---
warn: --- cl-rest api server is ready and listening on port: 3001 ---
warn: --- cl-rest doc server is ready and listening on port: 4001 ---
when I access http://localhost:3001/v1/getinfo through Firefox i got:
message: "Authentication Failed!"
error: "Bad Macaroon!"
under ~/Downloads/c-lightning-REST-0.9.0/certs are available:
access.macaroon
certificate.pem
rootKey.key
I generated the hex and base64 macaroons with the following index.js:
const readline = require('readline');
const fs = require('fs');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('\ninsert the path of the macaroon file ', (macaroonPath) => {
const macaroonHex = fs.readFileSync(macaroonPath).toString('hex');
console.log(`\nhex-formatted macaroon: ${macaroonHex }`);
const macaroonBase64 = fs.readFileSync(macaroonPath).toString('base64');
console.log(`\nbase64-formatted macaroon: ${macaroonBase64 }`);
rl.close();
});
but I do not know how to pass these to firefox
how do I have to launch Firefox to manage c-lightning-REST?