Skip to content

Commit ef70661

Browse files
committed
Rename to libbwt-nodejs
1 parent bec9b6b commit ef70661

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# bwt-daemon
1+
# libbwt-nodejs
22

33
A nodejs library for programmatically managing the Bitcoin Wallet Tracker Electrum RPC and HTTP API servers
44
using the [`libbwt` C FFI interface](https://github.com/bwt-dev/libbwt).
@@ -8,21 +8,21 @@ using the [`libbwt` C FFI interface](https://github.com/bwt-dev/libbwt).
88
### Install
99

1010
```
11-
$ npm install bwt-daemon
11+
$ npm install libbwt
1212
```
1313

1414
This will download the `libbwt` library for your platform.
1515
The currently supported platforms are Linux, Mac, Windows and ARMv7/8.
1616

1717
The hash of the downloaded library is verified against the
18-
[`SHA256SUMS`](https://github.com/shesek/bwt/blob/master/contrib/nodejs-bwt-daemon/SHA256SUMS)
18+
[`SHA256SUMS`](https://github.com/bwt-dev/libbwt-nodejs/blob/master/SHA256SUMS)
1919
file that ships with the npm package.
2020

2121
The library comes with the electrum and http servers by default.
22-
If you're only interested in the Electrum server, you can install with `BWT_VARIANT=electrum_only npm install bwt-daemon`.
22+
If you're only interested in the Electrum server, you can install with `BWT_VARIANT=electrum_only npm install libbwt`.
2323
This reduces the download size by ~1.6MB.
2424

25-
> Note: `bwt-daemon` uses [`ffi-napi`](https://github.com/node-ffi-napi/node-ffi-napi), which requires
25+
> Note: `libbwt-nodejs` uses [`ffi-napi`](https://github.com/node-ffi-napi/node-ffi-napi), which requires
2626
> a recent nodejs version. If you're running into errors during installation or segmentation faults,
2727
> try updating to a newer version.
2828
@@ -32,7 +32,7 @@ Below is a minimally viable setup. If bitcoind is running locally on the default
3232
and with cookie auth enabled (the default), this should Just Work™ \o/
3333

3434
```js
35-
import BwtDaemon from 'bwt-daemon'
35+
import { BwtDaemon } from 'libbwt'
3636

3737
const bwtd = await BwtDaemon({
3838
xpubs: [ 'xpub66...' ],
@@ -82,7 +82,7 @@ console.log('bwt http server ready on', bwtd.http_url)
8282
bwtd.shutdown()
8383
```
8484

85-
See [`example.js`](https://github.com/shesek/bwt/blob/master/contrib/nodejs-bwt-daemon/example.js) for an even more complete
85+
See [`example.js`](https://github.com/bwt-dev/libbwt-nodejs/blob/master/example.js) for an even more complete
8686
example, including connecting to the HTTP API.
8787

8888
The full list of options is available in the [libbwt documentation](https://github.com/bwt-dev/libbwt#config-options).

example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const BwtDaemon = require('bwt-daemon')
1+
const { BwtDaemon } = require('libbwt')
22

33
;(async function(){
44
const my_desc = 'wpkh(tpubD6NzVbkrYhZ4Ya1aR2od7JTGK6b44cwKhWzrvrTeTWFrzGokdAGHrZLK6BdYwpx9K7EoY38LzHva3SWwF8yRrXM9x9DQ3jCGKZKt1nQEz7n/0/*)';

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const ffi = require('ffi-napi')
22
, ref = require('ref-napi')
33
, path = require('path')
44
, EventEmitter = require('events')
5-
, debug = require('debug')('bwt-daemon')
5+
, debug = require('debug')('libbwt')
66

77
const LIB_PATH = process.env.BWT_LIB || path.join(__dirname, 'libbwt')
88

@@ -109,9 +109,9 @@ class BwtDaemon extends EventEmitter {
109109
}
110110

111111
// optional 'new'
112-
exports = module.exports = function(opt) { return new BwtDaemon(opt) }
113-
exports.BwtDaemon = BwtDaemon
114-
exports.start = BwtDaemon.start = opt => new BwtDaemon(opt).start()
112+
exports.BwtDaemon = module.exports = function(opt) { return new BwtDaemon(opt) }
113+
exports._BwtDaemon = BwtDaemon
114+
exports.start = opt => new BwtDaemon(opt).start()
115115

116116
// Utility
117117

npm-shrinkwrap.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "bwt-daemon",
2+
"name": "libbwt",
33
"version": "0.2.0",
44
"author": "Nadav Ivgi",
55
"description": "A library for programmatically controlling the Bitcoin Wallet Tracker daemons",
@@ -10,9 +10,9 @@
1010
"bitcoin-api",
1111
"xpub"
1212
],
13-
"repository": "https://github.com/shesek/bwt.git",
13+
"repository": "https://github.com/bwt-dev/libbwt-nodejs.git",
1414
"license": "MIT",
15-
"homepage": "https://github.com/shesek/bwt",
15+
"homepage": "https://github.com/bwt-dev/libbwt-nodejs",
1616
"scripts": {
1717
"dist": "./build.sh",
1818
"postinstall": "./postinstall.js"

postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function download(version, variant=null) {
4545
// Download the file while stream-hashing its contents
4646
async function getFile(url, dest) {
4747
return new Promise((resolve, reject) => {
48-
const options = { headers: { 'user-agent': 'bwt-daemon' } }
48+
const options = { headers: { 'user-agent': 'libbwt' } }
4949
https.get(url, options, resp => {
5050
if (resp.statusCode == 302) {
5151
return getFile(resp.headers.location, dest).then(resolve, reject)

0 commit comments

Comments
 (0)