btcpayserver/node-btcpay

Unable to generate private key in node v11.15.0

alko89 opened this issue · 7 comments

Trying to generate private key using node -p "require('btcpay').crypto.generate_keypair()" returns a large object instead of the private key.

Using the same command with node v10.16.0 works as expected:

<Key priv: c5e246de8c156c607658391641d42a1040914c78509c76acc8752947dd4ff091 pub: null >
(node:26425) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

@alko89 what version of node gives you the large object?

On v11.15.0. Downgrading solved the issue.

You can do this instead:

node -p "require('btcpay').crypto.generate_keypair().getPrivate('hex')"

@takinbo I guess the doc somewhere is outdated.

fixed by #32

I ran into this same docs bug. I noticed #32 was merged into branch btcpayserver:dev and not master. This may confuse users that try to use this library for the first time.