Does anyone know if Bitcore offer a testnet API to play around with?

I'm implementing an Escrow system using the API and Node.js Thanks.


I figured this out, you need to set the default network after you instantiate bitcore.

var bitcore = require('bitcore'); 

// Set the network to testnet
bitcore.Networks.defaultNetwork = bitcore.Networks.testnet;
  • It seams this does not work anymore. bitcore.Networks is now bitcore.networks and bitcore.networks.defaultNetwork = bitcore.networks.testnet throws Error: Cannot find module './build/Debug/buffertools.node'
    – Giszmo
    Sep 6 '17 at 16:14
  • This is no longer supported I think. May 25 at 10:22

I had to mess around with this until I got it. Kinda silly it wasn't any where in the docs...

This is via Typescript

import * as bitcore from 'bitcore-lib'

bitcore.Networks['defaultNetwork'] = bitcore.Networks['testnet']

Close bitcoind and then start bitcoind in a terminal or bash shell like so: "bitcoind -testnet" Using that should cause bitcoin to use a test network.

Although on windows you might need to find the bitcoind.exe and execute that if the command bitcoind is not added to the system path.

This information was retrieved from bitcoin's core using "bitcoind -help" and a quote from it says "-testnet Use the test network"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.