Skip to main content

UpdateNodeAnnouncement

lncli: peers updatenodeannouncement UpdateNodeAnnouncement allows the caller to update the node parameters and broadcasts a new version of the node announcement to its peers.

Source: peersrpc/peers.proto

gRPC

rpc UpdateNodeAnnouncement (NodeAnnouncementUpdateRequest) returns (NodeAnnouncementUpdateResponse);

REST

HTTP MethodPath
POST /v2/peers/nodeannouncement

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:10009'
const MACAROON_PATH = 'LND_DIR/data/chain/bitcoin/regtest/admin.macaroon'
const TLS_PATH = 'LND_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync(['lightning.proto', 'peersrpc/peers.proto'], loaderOptions);
const peersrpc = grpc.loadPackageDefinition(packageDefinition).peersrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new peersrpc.Peers(GRPC_HOST, creds);
let request = {
feature_updates: <UpdateFeatureAction>,
color: <string>,
alias: <string>,
address_updates: <UpdateAddressAction>,
};
client.updateNodeAnnouncement(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "ops": <Op>,
// }

Messages

peersrpc.NodeAnnouncementUpdateRequest

Source: peersrpc/peers.proto

FieldgRPC TypeREST TypeREST Placement
feature_updates
UpdateFeatureAction[]arraybody
color
stringstringbody
alias
stringstringbody
address_updates
UpdateAddressAction[]arraybody

peersrpc.NodeAnnouncementUpdateResponse

Source: peersrpc/peers.proto

FieldgRPC TypeREST Type
ops
Op[]array

Nested Messages

lnrpc.Op

FieldgRPC TypeREST Type
entity
stringstring
actions
string[]array

peersrpc.UpdateAddressAction

FieldgRPC TypeREST Type
action
UpdateActionstring
address
stringstring

peersrpc.UpdateFeatureAction

FieldgRPC TypeREST Type
action
UpdateActionstring
feature_bit
FeatureBitstring

Enums

lnrpc.FeatureBit

NameNumber
DATALOSS_PROTECT_REQ
0
DATALOSS_PROTECT_OPT
1
INITIAL_ROUING_SYNC
3
UPFRONT_SHUTDOWN_SCRIPT_REQ
4
UPFRONT_SHUTDOWN_SCRIPT_OPT
5
GOSSIP_QUERIES_REQ
6
GOSSIP_QUERIES_OPT
7
TLV_ONION_REQ
8
TLV_ONION_OPT
9
EXT_GOSSIP_QUERIES_REQ
10
EXT_GOSSIP_QUERIES_OPT
11
STATIC_REMOTE_KEY_REQ
12
STATIC_REMOTE_KEY_OPT
13
PAYMENT_ADDR_REQ
14
PAYMENT_ADDR_OPT
15
MPP_REQ
16
MPP_OPT
17
WUMBO_CHANNELS_REQ
18
WUMBO_CHANNELS_OPT
19
ANCHORS_REQ
20
ANCHORS_OPT
21
ANCHORS_ZERO_FEE_HTLC_REQ
22
ANCHORS_ZERO_FEE_HTLC_OPT
23
ROUTE_BLINDING_REQUIRED
24
ROUTE_BLINDING_OPTIONAL
25
AMP_REQ
30
AMP_OPT
31

peersrpc.UpdateAction

NameNumber
ADD
0
REMOVE
1