UNPKG

@node-dlc/messaging

Version:
58 lines (57 loc) 1.92 kB
/// <reference types="node" /> import { BitField } from '@node-dlc/common'; import { NodeFeatureFlags } from '@node-dlc/wire'; import { Address } from '../domain/Address'; import { MessageType } from '../MessageType'; import { IWireMessage } from './IWireMessage'; /** * This gossip message allows a node to indicate extra data associated with it, * in addition to its public key. To avoid trivial denial of service attacks, * nodes not associated with an already known channel are ignored. */ export declare class NodeAnnouncementMessage implements IWireMessage { static type: MessageType; static deserialize(payload: Buffer): NodeAnnouncementMessage; /** * Message hashing is after the first 66 bytes of the message * and excludes the type and signature. It performs a double * sha-256 hash of the remaining bytes. */ static hash(msg: NodeAnnouncementMessage): Buffer; /** * Verifies the message signature */ static verifySignatures(msg: NodeAnnouncementMessage): boolean; /** * Type 257 */ type: MessageType; /** * Signature of the announcement message by the node's public key * returned as a 64-byte Buffer. */ signature: Buffer; features: BitField<NodeFeatureFlags>; timestamp: number; /** * Compressed public key of the node that is a 33-byte * buffer. */ nodeId: Buffer; /** * Color of the node returned as a 3-byte Buffer. */ rgbColor: Buffer; /** * Alias of the node returned as a 32-byte Buffer. */ alias: Buffer; /** * Addresses that the node allow public network connections * on. The type indicates how the address is encoded. Addresses * are in order of connectivity preference. Currently * supported addresses formats are IPv4, IPv6, Tor2 and Tor3 */ addresses: Address[]; serialize(): Buffer; }