Closed tangjielong closed 5 years ago
Testnet
const bitcoin = require('bitcoinjs-lib')
// ...
const network = bitcoin.networks.testnet // spot the difference
// ...
const keyPair = new bitcoin.ECPair.fromWIF(..., network)
const txb = new bitcoin.TransactionBuilder(network)
Mainnet
const bitcoin = require('bitcoinjs-lib')
// ...
const network = bitcoin.networks.bitcoin // spot the difference
// ...
const keyPair = new bitcoin.ECPair.fromWIF(..., network)
const txb = new bitcoin.TransactionBuilder(network)
think your very mach!
If you use bitcoinjs.ECPair.fromWIF(publicKeys, mainnet) on the main network; how do you need to modify the mainnet later? this my code const TestNet = bitcoinjs.networks.testnet; var key = new bitcoinjs.ECPair.fromWIF(publicKeys, TestNet); var tx = new bitcoinjs.TransactionBuilder(TestNet); how to use main network?