var fs = require('fs');
var request = require('request');
var macaroon=fs.readFileSync('/home/sahana/lndNodes/nodeB/data/chain/bitcoin/regtest/admin.macaroon').toString('hex');
var requestBody = {
msg: Buffer.from("sahana").toString("base64"),
signature: 'ryk63mh434e193abhubxfrxej8bpezbdb8spjwdpmx9tjwa48dx1cfzcoydncsaoxbry98ft6ffc6agxft4szcij7qatzsmbou7475nn',};
var options = {
url: 'https://localhost:8180/v1/verifymessage',
// Work-around for self-signed certificates.
rejectUnauthorized: false,
json: true,
headers: {
'Grpc-Metadata-macaroon': macaroon,
},
form: JSON.stringify(requestBody),};
request.post(options, function(error, response, body) {
console.log(body); });
,响应为:
{ pubkey:
'0362c3c5f1b5705d7c61ca68167d1ba33a0916037d54e396225f1da0ffbfab1f8d' }
如何修改它也返回布尔值?