<p>You set them in your bitcoin.conf file and use the network specific configuration sections. So you can add to your bitcoin.conf file:</p>

<pre><code>[test]
rpcuser=name
rpcpassword=sdaddf
</code></pre>

CC BY-SA 4.0
2019-06-05T08:20:59.030Z
2019-06-05T08:20:59.030Z
Ava Chow
<p>How to get testnet credentials to use bit-coin core functions in Node.js.</p>

<pre><code>{
    "Bitcoin": {
      "testnet": {
        "username": "name",
        "password": "sdaddf",
        "network": "regtest",
        "port": 18332 
      },
      "mainnet": {
        "username": "name",
        "password": "sadasd",
        "network": "mainnet",
        "port": 8332
      }
    }
}
</code></pre>

<bitcoin-core><json-rpc><node.js>
Testnet credentials
Abhay parihar
# Testnet credentials

(Asked by: username_0 on 2019-06-05)

How to get testnet credentials to use bit-coin core functions in Node.js.

```
{
    "Bitcoin": {
      "testnet": {
        "username": "name",
        "password": "sdaddf",
        "network": "regtest",
        "port": 18332 
      },
      "mainnet": {
        "username": "name",
        "password": "sadasd",
        "network": "mainnet",
        "port": 8332
      }
    }
}

```

**Tags:** bitcoin-core, json-rpc, node.js


---

## 1 answers

### Answer by username_1 on 2019-06-05. Score: 1

You set them in your bitcoin.conf file and use the network specific configuration sections. So you can add to your bitcoin.conf file:

```
[test]
rpcuser=name
rpcpassword=sdaddf

```


---

