Skip to content

Commit

Permalink
add fee earnings info to peers
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbosworth committed Nov 25, 2019
1 parent d5d911b commit f68ddfd
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 165 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Versions

## Version 5.5.0

- `peers`: Add `fee-days` option to show fees earned via a peer
- `peers`: Add `first_connected` attribute to peers list
- `peers`: Add `private` option to only show private channel peers

## Version 5.4.0

- `chart-fees-earned`: Add `via` argument to show only fees related to a peer
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ bos help
bos help commandName
```

Or ask about commands on [Telegram](https://t.me/balanceofsatoshis)

### Example Commands

```shell
Expand Down
20 changes: 14 additions & 6 deletions bos
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,16 @@ prog
.option('--no-color', 'Mute all colors')
.option('--node <node_name>', 'Node to get forwards for')
.action((args, options, logger) => {
return new Promise((resolve, reject) => {
return getForwards({
days: options.days,
node: options.node,
},
returnObject({logger, reject, resolve}));
return new Promise(async (resolve, reject) => {
try {
return getForwards({
days: options.days,
lnd: (await authenticatedLnd({logger, node: options.node})).lnd,
},
returnObject({logger, reject, resolve}));
} catch (err) {
return reject(err);
}
});
})

Expand Down Expand Up @@ -571,20 +575,24 @@ prog
// Get a list of channel-connected peers
.command('peers', 'Get a list of channel-connected peers')
.option('--active', 'Only active peer channels')
.option('--fee-days <past_days>', 'Include fees earned over n days', INT)
.option('--inbound-below <amount>', 'Inbound liquidity below amount')
.option('--node <node_name>', 'Node to get peers for')
.option('--offline', 'Only offline peer channels')
.option('--outbound-below <amount>', 'Outbound liquidity below amount', INT)
.option('--no-color', 'Mute all colors')
.option('--private', 'Only private channels')
.option('--public', 'Only peers with public channels')
.option('--sort', 'Sort results by peer attribute')
.action((args, options, logger) => {
return new Promise(async (resolve, reject) => {
try {
return getPeers({
earnings_days: options.feeDays,
inbound_liquidity_below: options.inboundBelow,
is_active: !!options.active,
is_offline: !!options.offline,
is_private: !!options.private,
is_public: !!options.public,
lnd: (await authenticatedLnd({logger, node: options.node})).lnd,
node: options.node,
Expand Down
Loading

0 comments on commit f68ddfd

Please sign in to comment.