Bitcoin Core Development – Can anyone explain to me about the Liquid Network


You need to run elements d with the items below.

chain=elementsregtest

rpcport = 18884
rpcuser = user1
rpcpassword = password1

Use the example given in Element code tutorials:

const request = require('request');

let username = "user1";
let password = "password1";

let options = {
    url: "
    method: "post",
    headers:
    { 
     "content-type": "text/plain"
    },
    auth: {
        user: username,
        pass: password
    },
    body: JSON.stringify( {"jsonrpc": "2.0", "id": "rpctest", "method": "getwalletinfo", "params": [] })
};

request(options, (error, response, body) => {
    if (error) {
        console.error('An error occurred: ', error);
    } else {
        json = JSON.parse(body);
        console.log(json.result.balance.bitcoin);
    }
});

The output will show the bitcoin balance returned by getwalletinfo.

Other RPCs:



Source link

Related Posts