Skip to content

Commit

Permalink
feat: address aliases, watch pubkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzbit committed Apr 27, 2022
1 parent 38dceb9 commit 84923eb
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 45 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# bitcoin-balance-notifier
Notifies if the balance of a bitcoin address changes
Notifies if the balance of a bitcoin address changes.
Supports addresses and Extended Pubkeys.

## Configuration

Set some environment variables before launching, or add a `.env` file.

| Variable | Value(s) |
|:-|:-|
| ADDRESSES | A comma separated list of addresses to watch |
| ADDRESSES | A comma separated list of `nickname:address` to watch (example: `Test Address:34rng4QwB5pHUbGDJw1JxjLwgEU8TQuEqv`) |
| BTC_RPC_API | (optional) The URL to an instance of BTC-RPC-Explorer. Default: `https://bitcoinexplorer.org` |
| CHECK_ALL_PUBKEY_TYPES | Whether or not to check the other types of a given pubkey (xpub, ypub, zpub) |
| CURRENCY | Fiat currency to display balance in |
| DISCORD_WEBHOOK | The URL to a Discord Webhook to call when the balance changes |
| INTERVAL | (optional) The amount of time, in seconds, between checking the balance. Default: `300` (5 minutes) |
| LOG_LEVEL | `trace`, `debug`, `info`, `warn`, `error` |
| LOOKAHEAD | How many addresses with no activity before we consider a pubkey to be completely scanned. Default: `20` |
| PAGE_SIZE | How many addresses to request at once for PubKey-type addresses Default: `100` |
| PUBKEYS | A comma separated list of `nickname:pubkey` to watch (example: `Test Pubkey:xpub6EuV33a2DXxAhoJTRTnr8qnysu81AA4YHpLY6o8NiGkEJ8KADJ35T64eJsStWsmRf1xXkEANVjXFXnaUKbRtFwuSPCLfDdZwYNZToh4LBCd`) |
| SLEEP_INTERVAL | (optional) The amount of time, in seconds, between checking the balance. Default: `300` (5 minutes) |

## Database

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/golobby/config/v3 v3.3.4
github.com/sirupsen/logrus v1.8.1
github.com/tyzbit/btcapi v0.4.0
github.com/tyzbit/btcapi v0.5.3
gorm.io/driver/sqlite v1.3.2
gorm.io/gorm v1.23.4
)
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ github.com/tyzbit/btcapi v0.3.0 h1:Jv4i6y0ba3IZesDRuiqpSgFaktsV9Yjf+OO63u9CsLA=
github.com/tyzbit/btcapi v0.3.0/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
github.com/tyzbit/btcapi v0.4.0 h1:3XZksHhqPCr7Z/kLd9fTikHvVTXO1iH3hzC+IBnZLvo=
github.com/tyzbit/btcapi v0.4.0/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
github.com/tyzbit/btcapi v0.5.0 h1:RhGJbQNkr0QUeI1VyHKRe8LoiYEoi+ahwXJ7yUhWiJs=
github.com/tyzbit/btcapi v0.5.0/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
github.com/tyzbit/btcapi v0.5.1 h1:Zu5bTefpzkxKRHV0LSkDRFcv3HTH+ySxglHbR3YYkRQ=
github.com/tyzbit/btcapi v0.5.1/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
github.com/tyzbit/btcapi v0.5.2 h1:WSFxKowUGy1H5+/EhbzOMP2mqIJuBPz3xYWWrkcSfZ8=
github.com/tyzbit/btcapi v0.5.2/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
github.com/tyzbit/btcapi v0.5.3 h1:kxsB186Q6hT0B7NVd6+QCJSeKlWmSZvlD0VC29tckYg=
github.com/tyzbit/btcapi v0.5.3/go.mod h1:hU/nXDArmULgj3lAjQdK+eMY3F5HlsWN+MAoGszp9RY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
Loading

0 comments on commit 84923eb

Please sign in to comment.