<p>You want to use the RPC Protocol to get blockchain info. RPC is usually disabled by default, so you need to enable it. You can do this in the bitcoin.conf file in .bitcoin folder where you've installed the daemon.  Alternatively, you can run the daemon with the -server flag, see  <a href="https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments" rel="nofollow noreferrer">command line arguments</a>. Now, you will also need to set RPC authentication in the conf file as well. The -txindex flag will allow you to search for any tx by hash using getrawtransaction command, which may be useful depending on how you utilizar the RPC protocol.</p>

<p><a href="https://en.bitcoin.it/wiki/Running_Bitcoin#Sample_Bitcoin.conf" rel="nofollow noreferrer">Example bitcoin.conf</a></p>

<p>The line to add is:</p>

<pre><code>server=1
</code></pre>

<p>How to use:</p>

<p><a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)" rel="nofollow noreferrer">RPC documentation</a></p>

CC BY-SA 4.0
2018-07-21T11:09:42.080Z
Huge thanks! Is it also possible to retrieve an accounts balance using bitcoin-cli? And data about blocks such as timestamp, amount of transactions and total block value (in btc).
Luuk Kenselaar
CC BY-SA 4.0
2018-07-21T14:44:24.450Z
getbalance only retrieves balance for addresses you own. I think you have to query all transactions for an address and sum them up. You probably have to do the same for total block value, have a look at the RPC docs in the link above for all possible commands.
JBaczuk
CC BY-SA 4.0
2018-07-20T17:28:22.160Z
2018-07-20T17:33:38.817Z
2018-07-20T17:33:38.817Z
JBaczuk
<p>Im trying to build a small btc block explorer for fun.
The problem where i am stuck is that im trying to setup a node.
I got a Ubuntu VPS running and i have bitcoind installed, but what now?
Can someone help me with this? I have read that you need to run the node in txindex mode or something.</p>

<p>Thanks in advance!</p>

CC BY-SA 4.0
2018-07-20T15:03:48.530Z
Search for RPC protocol that gives you an interface for the data on the node once it's running.
JBaczuk
CC BY-SA 4.0
2018-07-20T17:22:16.123Z
Thats the problem, i cant get the node configured.
Luuk Kenselaar
CC BY-SA 4.0
2018-07-20T17:35:35.880Z
Got it, let me know if that answer helps.
JBaczuk
<nodes><blockexplorer>
Building a small block explorer for fun, stuck with node
Luuk Kenselaar
# Building a small block explorer for fun, stuck with node

(Asked by: username_0 on 2018-07-20)

Im trying to build a small btc block explorer for fun.
The problem where i am stuck is that im trying to setup a node.
I got a Ubuntu VPS running and i have bitcoind installed, but what now?
Can someone help me with this? I have read that you need to run the node in txindex mode or something.

Thanks in advance!

**Tags:** nodes, blockexplorer

> **Comments:**
> **username_1**: Search for RPC protocol that gives you an interface for the data on the node once it's running.  
> **username_0**: Thats the problem, i cant get the node configured.  
> **username_1**: Got it, let me know if that answer helps.  

---

## 1 answers

### Answer by username_1 on 2018-07-20. Score: 1 | Accepted answer

You want to use the RPC Protocol to get blockchain info. RPC is usually disabled by default, so you need to enable it. You can do this in the bitcoin.conf file in .bitcoin folder where you've installed the daemon. Alternatively, you can run the daemon with the -server flag, see [command line arguments](https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments). Now, you will also need to set RPC authentication in the conf file as well. The -txindex flag will allow you to search for any tx by hash using getrawtransaction command, which may be useful depending on how you utilizar the RPC protocol.

[Example bitcoin.conf](https://en.bitcoin.it/wiki/Running_Bitcoin#Sample_Bitcoin.conf)

The line to add is:

```
server=1

```

How to use:

[RPC documentation](https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

> **Comments:**
> **username_0**: Huge thanks! Is it also possible to retrieve an accounts balance using bitcoin-cli? And data about blocks such as timestamp, amount of transactions and total block value (in btc).  
> **username_1**: getbalance only retrieves balance for addresses you own. I think you have to query all transactions for an address and sum them up. You probably have to do the same for total block value, have a look at the RPC docs in the link above for all possible commands.  

---

