Update 3_2_Knowing_Your_Bitcoin_Setup.md

This commit is contained in:
Shannon Appelcline 2017-03-23 16:01:22 -07:00 committed by GitHub
parent 446e9ce6d2
commit a9519132f1

View File

@ -4,9 +4,9 @@
Before you start playing with Bitcoin, you may always want to come to a better understanding of your setup. Before you start playing with Bitcoin, you may always want to come to a better understanding of your setup.
## Know Your Directory ## Know Your Bitcoin Directory
If your bitcoind is running and you've downloaded all the blocks, you're probably ready to go. However, it's best to look at the main ~/.bitcoin directory, both to make sure everything is there and to understand for yourself how everything works. To start with, you should understand where everything is kept: the ~/.bitcoin directory.
The main directory just contains your config file and the testnet directory: The main directory just contains your config file and the testnet directory:
``` ```
@ -19,7 +19,7 @@ $ ls ~/.bitcoin/testnet3
banlist.dat blocks database debug.log wallet.dat banlist.dat blocks database debug.log wallet.dat
bitcoind.pid chainstate db.log peers.dat bitcoind.pid chainstate db.log peers.dat
``` ```
You shouldn't mess with most of these files and directories — particularly not the blocks and chainstate directories, which contain all of the blockchain data. However, do take careful note of the db.log and debug.log file, which you should refer to if you ever have problems with your setup. You shouldn't mess with most of these files and directories — particularly not the blocks and chainstate directories, which contain all of the blockchain data, and the wallet.dat file, which contains your personal wallet. However, do take careful note of the db.log and debug.log file, which you should refer to if you ever have problems with your setup.
> **TESTNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main ~/.bitcoin directory. These various setups _do_ elegantly stack, so if you are using mainnet, testnet, and regtest, you'll find that ~/.bitcoin contains your config file and your mainnet data, ~/.bitcoin/testnet3 contains your testnet data, and ~/.bitcoin/regtest contains your regtest data. > **TESTNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main ~/.bitcoin directory. These various setups _do_ elegantly stack, so if you are using mainnet, testnet, and regtest, you'll find that ~/.bitcoin contains your config file and your mainnet data, ~/.bitcoin/testnet3 contains your testnet data, and ~/.bitcoin/regtest contains your regtest data.
@ -163,9 +163,9 @@ Examples:
> bitcoin-cli getmininginfo > bitcoin-cli getmininginfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
``` ```
## Optional: Know Your Bitcoin Info ## Optional: Know Your Other Bitcoin Info
A variety of commands will give oyu move info on your setup: A variety of commands can give you additional information on your bitcoin data. The most general ones are:
``` ```
$ bitcoin-cli getblockchaininfo $ bitcoin-cli getblockchaininfo
$ bitcoin-cli getmininginfo $ bitcoin-cli getmininginfo
@ -173,9 +173,54 @@ $ bitcoin-cli getnetworkinfo
$ bitcoin-cli getnettotals $ bitcoin-cli getnettotals
$ bitcoin-cli getwalletinfo $ bitcoin-cli getwalletinfo
``` ```
Feel free to play with any of these, and use "bitcoin-cli help" if you want more information on what any of them do. For example `bitcoin-cli getnetworkinfo` gives you a bariety of information on your setup and its access to various networks:
```
$ bitcoin-cli getnetworkinfo
{
"version": 140000,
"subversion": "/Satoshi:0.14.0/",
"protocolversion": 70015,
"localservices": "000000000000000d",
"localrelay": false,
"timeoffset": 0,
"networkactive": true,
"connections": 9,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.00001000,
"incrementalfee": 0.00001000,
"localaddresses": [
{
"address": "192.168.1.17",
"port": 18333,
"score": 52
}
],
"warnings": "Warning: unknown
```
Feel free to references any of these and to use "bitcoin-cli help" if you want more information on what any of them do.
## Summary: Knowing Your Bitcoin Setup
## Summary: Verifying Your bitcoin-cli Setup The ~/.bitcoin directory contains all of your files, while `bitcoin-cli help` and a variety of info commands can be used to get more information on how your setup and Bitcoin work.
Before you start playing with bitcoin, you should make sure that the bitcoind is running and that all the blocks have been downloaded. You might get additional help from the `bitcoin-cli help` command or from files in the ~/.bitcoin directory.