Bitcore Testnet API

2

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 and don't particularly want to use real Bitcoins.

Thanks.

Richard Macarthy

Posted 2015-04-22T15:16:19.550

Reputation: 213

Answers

2

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;

Richard Macarthy

Posted 2015-04-22T15:16:19.550

Reputation: 213

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 2017-09-06T16:14:02.110

0

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']

Michael

Posted 2015-04-22T15:16:19.550

Reputation: 131

-1

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"

Gemohn Herbile

Posted 2015-04-22T15:16:19.550

Reputation: 101

2Bitcore != Bitcoin core FWIWWizard Of Ozzie 2015-04-23T05:09:58.957

I asked about Bitcore not bitcoind...Richard Macarthy 2015-05-21T12:35:54.723