Skip to main content

NodeAudit

Get a report of your node's activity over a period.

Example request: http://localhost:8466/v1/faraday/nodeaudit

Source: faraday.proto

gRPC

rpc NodeAudit (NodeAuditRequest) returns (NodeAuditResponse);

REST

HTTP MethodPath
GET /v1/faraday/nodeaudit

Code Samples

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

const GRPC_HOST = 'localhost:8465'
const MACAROON_PATH = 'FARADAY_DIR/regtest/faraday.macaroon'
const TLS_PATH = 'FARADAY_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('faraday.proto', loaderOptions);
const frdrpc = grpc.loadPackageDefinition(packageDefinition).frdrpc;
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 frdrpc.FaradayServer(GRPC_HOST, creds);
let request = {
start_time: <uint64>,
end_time: <uint64>,
disable_fiat: <bool>,
granularity: <Granularity>,
custom_categories: <CustomCategory>,
fiat_backend: <FiatBackend>,
custom_prices: <BitcoinPrice>,
};
client.nodeAudit(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "reports": <ReportEntry>,
// }

Messages

frdrpc.NodeAuditRequest

Source: faraday.proto

FieldgRPC TypeREST TypeREST Placement
start_time
uint64stringquery
end_time
uint64stringquery
disable_fiat
boolbooleanquery
granularity
Granularitystringquery
custom_categories
CustomCategory[]arrayunknown
fiat_backend
FiatBackendstringquery
custom_prices
BitcoinPrice[]arrayunknown

frdrpc.NodeAuditResponse

Source: faraday.proto

FieldgRPC TypeREST Type
reports
ReportEntry[]array

Nested Messages

frdrpc.BitcoinPrice

FieldgRPC TypeREST Type
price
stringstring
price_timestamp
uint64string
currency
stringstring

frdrpc.CustomCategory

FieldgRPC TypeREST Type
name
stringstring
on_chain
boolboolean
off_chain
boolboolean
label_patterns
string[]array

frdrpc.ReportEntry

FieldgRPC TypeREST Type
timestamp
uint64string
on_chain
boolboolean
amount
uint64string
credit
boolboolean
asset
stringstring
type
EntryTypestring
custom_category
stringstring
txid
stringstring
fiat
stringstring
reference
stringstring
note
stringstring
btc_price
BitcoinPriceobject

Enums

frdrpc.EntryType

NameNumber
UNKNOWN
0
LOCAL_CHANNEL_OPEN
1
REMOTE_CHANNEL_OPEN
2
CHANNEL_OPEN_FEE
3
CHANNEL_CLOSE
4
RECEIPT
5
PAYMENT
6
FEE
7
CIRCULAR_RECEIPT
8
FORWARD
9
FORWARD_FEE
10
CIRCULAR_PAYMENT
11
CIRCULAR_FEE
12
SWEEP
13
SWEEP_FEE
14
CHANNEL_CLOSE_FEE
15

frdrpc.FiatBackend

NameNumber
UNKNOWN_FIATBACKEND
0
COINCAP
1
COINDESK
2
CUSTOM
3
COINGECKO
4

frdrpc.Granularity

NameNumber
UNKNOWN_GRANULARITY
0
MINUTE
1
FIVE_MINUTES
2
FIFTEEN_MINUTES
3
THIRTY_MINUTES
4
HOUR
5
SIX_HOURS
6
TWELVE_HOURS
7
DAY
8