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

<pre><code>var bitcore = require('bitcore'); 

// Set the network to testnet
bitcore.Networks.defaultNetwork = bitcore.Networks.testnet;
</code></pre>

CC BY-SA 3.0
2017-09-06T16:14:02.110Z
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
CC BY-SA 4.0
2021-05-25T10:22:03.403Z
This is no longer supported I think.
rxjmx
CC BY-SA 3.0
2015-05-27T15:20:28.593Z
2015-05-27T15:20:28.593Z
rxjmx
<p>I had to mess around with this until I got it. Kinda silly it wasn't any where in the docs...</p>

<p><em>This is via Typescript</em></p>

<pre><code>import * as bitcore from 'bitcore-lib'

bitcore.Networks['defaultNetwork'] = bitcore.Networks['testnet']
</code></pre>

CC BY-SA 4.0
2018-10-27T22:46:05.800Z
2018-10-27T22:46:05.800Z
Michael
<p>Close <code>bitcoind</code> and then start bitcoind in a terminal or bash shell like so:
<code>"bitcoind -testnet"</code> Using that should cause bitcoin to use a test network.</p>

<p>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.</p>

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

CC BY-SA 3.0
2015-04-23T05:09:58.957Z
Bitcore != Bitcoin core FWIW
Wizard Of Ozzie
CC BY-SA 3.0
2015-05-21T12:35:54.723Z
I asked about Bitcore not bitcoind...
rxjmx
CC BY-SA 3.0
2015-04-22T18:11:51.390Z
2015-04-22T18:11:51.390Z
Gemohn Herbile
<p>Does anyone know if Bitcore offer a <code>testnet</code> API to play around with?</p>
<p>I'm implementing an Escrow system using the API and <code>Node.js</code>
Thanks.</p>

<api><testnet><bitcore>
Bitcore Testnet API
rxjmx
# Bitcore Testnet API

(Asked by: username_0 on 2015-04-22)

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.

**Tags:** api, testnet, bitcore


---

## 3 answers

### Answer by username_0 on 2015-05-27. Score: 2 | Accepted answer

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;

```

> **Comments:**
> **username_1**: 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'`  
> **username_0**: This is no longer supported I think.  

---

### Answer by username_2 on 2018-10-27. Score: 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']

```


---

### Answer by username_3 on 2015-04-22. Score: -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"`

> **Comments:**
> **username_4**: Bitcore != Bitcoin core FWIW  
> **username_0**: I asked about Bitcore not bitcoind...  

---

