bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.6k stars 2.08k forks source link

ReferenceError: regtest is not defined #1197

Closed NoR3s closed 5 years ago

NoR3s commented 5 years ago

Hello im getting everytime refrence error or missing imports.

i follow the examples witch are shown on the git i just try the following code to create a simple random adress const alice1 = bitcoin.ECPair.makeRandom({ network: regtest })

This happends also when using other examples that im missing things. ReferenceError: regtest is not defined

version im using is "bitcoinjs-lib": "^4.0.1",

coinflippa commented 5 years ago

Try

const alice1 = bitcoin.ECPair.makeRandom({ network: bitcoin.networks.regtest })
dcousens commented 5 years ago

@NoR3S it is assumed understand the basics of JavaScript before using this library.

dcousens commented 5 years ago

@coinflippa regtest in that scenario is undefined too! Use testnet.

const alice1 = bitcoin.ECPair.makeRandom({ network: bitcoin.networks.testnet })