<p>The propagate function isn't designed for testnet-in-a-box because there is no routing for requests in the bitoind program that testnet-in-a-box activates.
Rather testnet-in-a-box is designed for JSON-RPC, so you can use <code>sendrawtransaction</code>, which described in <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list</a>.</p>

<p>This is the propagate function:</p>

<pre><code>blockchain.transactions.propagate = function broadcast (txHex, callback) {
  dhttp({
    method: 'POST',
    url: 'https://api.ei8ht.com.au:9443/3/pushtx',
    body: txHex
  }, callback)
}
</code></pre>

CC BY-SA 3.0
2017-10-24T19:56:21.310Z
2017-10-25T01:45:50.040Z
2017-10-25T01:45:50.040Z
Daniel Eliraz
<p>I put together some code using <a href="https://github.com/bitcoinjs/bitcoinjs-lib" rel="nofollow">bitcoinjs-lib</a> which allows me to create a testnet transaction and send some bitcoins from one address to another.</p>

<p>But I'm getting tired of waiting for 10 mins after every test. I'd like to be able to test my code a bit faster.</p>

<p>I set up <a href="https://github.com/freewil/bitcoin-testnet-box" rel="nofollow">testnet-in-a-box</a> in a virtual machine and have played around with <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">a few commands</a> and it works fine.</p>

<p>But when I try to send a transaction to one of the nodes at 127.0.0.1:19000 it gives me an error saying:</p>

<pre><code>{ [Error: socket hang up] code: 'ECONNRESET' }
</code></pre>

<p>I'm broadcasting the transaction as shown <a href="https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/basic.js#L50" rel="nofollow">here</a> using:</p>

<pre><code>blockchain.t.transactions.propagate(tx.build().toHex(), done)
</code></pre>

<p>What am I doing wrong? Is it not possible to submit transactions to the node in testnet-in-a-box?</p>

<p>Any help will be appreciated! Thanks!</p>

<testnet>
Send a transaction using bitcoinjs-lib to testnet in a box
Plasty Grove
# Send a transaction using bitcoinjs-lib to testnet in a box

(Asked by: username_0 on 2016-06-07)

I put together some code using [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) which allows me to create a testnet transaction and send some bitcoins from one address to another.

But I'm getting tired of waiting for 10 mins after every test. I'd like to be able to test my code a bit faster.

I set up [testnet-in-a-box](https://github.com/freewil/bitcoin-testnet-box) in a virtual machine and have played around with [a few commands](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) and it works fine.

But when I try to send a transaction to one of the nodes at 127.0.0.1:19000 it gives me an error saying:

```
{ [Error: socket hang up] code: 'ECONNRESET' }

```

I'm broadcasting the transaction as shown [here](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/basic.js#L50) using:

```
blockchain.t.transactions.propagate(tx.build().toHex(), done)

```

What am I doing wrong? Is it not possible to submit transactions to the node in testnet-in-a-box?

Any help will be appreciated! Thanks!

**Tags:** testnet


---

## 1 answers

### Answer by username_1 on 2017-10-24. Score: 1

The propagate function isn't designed for testnet-in-a-box because there is no routing for requests in the bitoind program that testnet-in-a-box activates.
Rather testnet-in-a-box is designed for JSON-RPC, so you can use `sendrawtransaction`, which described in <https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list>.

This is the propagate function:

```
blockchain.transactions.propagate = function broadcast (txHex, callback) {
  dhttp({
    method: 'POST',
    url: 'https://api.ei8ht.com.au:9443/3/pushtx',
    body: txHex
  }, callback)
}

```


---

