mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-07 16:06:26 +00:00
Merge remote-tracking branch 'base/master'
This commit is contained in:
commit
315d7e2725
@ -65,7 +65,7 @@ A message (or more commonly, a hash of a message) can be signed with a private k
|
||||
|
||||
### What Is a Hash Function?
|
||||
|
||||
A hash function is an algorithm frequently used with cryptograpy. It's a way to map a large, arbitrary amount of data to a small, fixed amount of data. Hash functions used in cryptography are one-way and collision-resistant, meaning that a hash can very reliably be linked to the original data, but the original data can not be regenerated from the hash. Hashes thus allow the transmission of small amounts of data to represent large amounts of data, which can be important for efficiency and storage requirements.
|
||||
A hash function is an algorithm frequently used with cryptography. It's a way to map a large, arbitrary amount of data to a small, fixed amount of data. Hash functions used in cryptography are one-way and collision-resistant, meaning that a hash can very reliably be linked to the original data, but the original data can not be regenerated from the hash. Hashes thus allow the transmission of small amounts of data to represent large amounts of data, which can be important for efficiency and storage requirements.
|
||||
|
||||
### Public-Key Cryptography — In Short
|
||||
|
||||
|
@ -41,13 +41,13 @@ We also suggest that you choose a Debian 8 image when you're creating your machi
|
||||
|
||||
Afterward, boot your VPS.
|
||||
|
||||
> **TESTNET vs MAINNET:** The various possible setups require 5-15G of storage and 2-3G of memory. The non-Pruned Mainnet is the only setup that requires considerably more: about 120G of storage to hold the current blockchain.
|
||||
> **TESTNET vs MAINNET:** The various possible setups require 5-15G of storage and 2-3G of memory. The non-Pruned Mainnet is the only setup that requires considerably more: about 170G of storage to hold the current blockchain.
|
||||
>
|
||||
> Following are suggestions for machine requirements:
|
||||
>
|
||||
> | Setup | Memory | Storage |
|
||||
> |-------|--------|---------|
|
||||
> | Mainnet | 2-3G | 120G |
|
||||
> | Mainnet | 2-3G | 170G |
|
||||
> | Pruned Mainnet | 2-3G | ~5G |
|
||||
> | Testnet | 2-3G | ~15G |
|
||||
> | Pruned Testnet | 2-3G | ~5G |
|
||||
@ -294,9 +294,9 @@ $ source ~/.bash_profile
|
||||
|
||||
We suggest setting up two variables to make this installation more automatic.
|
||||
|
||||
The first variable, $BITCOIN, should be set to the current version of Bitcoin. It was 0.14.1 when we wrote this. The second will then automatically generate a truncated form used by some of the files.
|
||||
The first variable, $BITCOIN, should be set to the current version of Bitcoin. It was 0.15.1 when we wrote this. The second will then automatically generate a truncated form used by some of the files.
|
||||
```
|
||||
$ export BITCOIN=bitcoin-core-0.14.1
|
||||
$ export BITCOIN=bitcoin-core-0.15.1
|
||||
$ export BITCOINPLAIN=`echo $BITCOIN | sed 's/bitcoin-core/bitcoin/'`
|
||||
```
|
||||
|
||||
@ -390,7 +390,7 @@ But wait, your Bitcoin daemon is probably still downloading blocks. This alias,
|
||||
```
|
||||
$ btcblock
|
||||
```
|
||||
0.14.1 is quite fast to download blocks, but it might still take an hour to download the unpruned testnet. It might be time for a few more espressos.
|
||||
0.15.1 is quite fast to download blocks, but it might still take an hour to download the unpruned testnet. It might be time for a few more espressos.
|
||||
|
||||
> **TESTNET vs MAINNET:** An unpruned mainnet will take hours longer.
|
||||
|
||||
|
@ -148,7 +148,7 @@ You will know the StackScripts are done when a BITCOIN-IS-READY file appears in
|
||||
|
||||
```
|
||||
$ ls
|
||||
bitcoin-0.14.1-x86_64-linux-gnu.tar.gz laanwj-releases.asc
|
||||
bitcoin-0.15.1-x86_64-linux-gnu.tar.gz laanwj-releases.asc
|
||||
BITCOIN-IS-READY SHA256SUMS.asc
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
# CURRENT BITCOIN RELEASE:
|
||||
# Change as necessary
|
||||
|
||||
export BITCOIN=bitcoin-core-0.14.2
|
||||
export BITCOIN=bitcoin-core-0.15.1
|
||||
|
||||
# Set the variable $IPADDR to the IP address the new Linode receives.
|
||||
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
|
||||
|
@ -32,57 +32,64 @@ Most of your early work will be done with the `bitcoin-cli` command, which offer
|
||||
$ bitcoin-cli help
|
||||
== Blockchain ==
|
||||
getbestblockhash
|
||||
getblock "hash" ( verbose )
|
||||
getblock "blockhash" ( verbosity )
|
||||
getblockchaininfo
|
||||
getblockcount
|
||||
getblockhash index
|
||||
getblockhash height
|
||||
getblockheader "hash" ( verbose )
|
||||
getchaintips
|
||||
getchaintxstats ( nblocks blockhash )
|
||||
getdifficulty
|
||||
getmempoolancestors txid (verbose)
|
||||
getmempooldescendants txid (verbose)
|
||||
getmempoolentry txid
|
||||
getmempoolinfo
|
||||
getrawmempool ( verbose )
|
||||
gettxout "txid" n ( includemempool )
|
||||
gettxout "txid" n ( include_mempool )
|
||||
gettxoutproof ["txid",...] ( blockhash )
|
||||
gettxoutsetinfo
|
||||
verifychain ( checklevel numblocks )
|
||||
preciousblock "blockhash"
|
||||
pruneblockchain
|
||||
verifychain ( checklevel nblocks )
|
||||
verifytxoutproof "proof"
|
||||
|
||||
== Control ==
|
||||
getinfo
|
||||
getmemoryinfo ("mode")
|
||||
help ( "command" )
|
||||
stop
|
||||
uptime
|
||||
|
||||
== Generating ==
|
||||
generate numblocks ( maxtries )
|
||||
generatetoaddress numblocks address (maxtries)
|
||||
generate nblocks ( maxtries )
|
||||
generatetoaddress nblocks address (maxtries)
|
||||
|
||||
== Mining ==
|
||||
getblocktemplate ( TemplateRequest )
|
||||
getmininginfo
|
||||
getnetworkhashps ( blocks height )
|
||||
prioritisetransaction <txid> <priority delta> <fee delta>
|
||||
submitblock "hexdata" ( "jsonparametersobject" )
|
||||
getnetworkhashps ( nblocks height )
|
||||
prioritisetransaction <txid> <dummy value> <fee delta>
|
||||
submitblock "hexdata" ( "dummy" )
|
||||
|
||||
== Network ==
|
||||
addnode "node" "add|remove|onetry"
|
||||
clearbanned
|
||||
disconnectnode "node"
|
||||
getaddednodeinfo dummy ( "node" )
|
||||
disconnectnode "[address]" [nodeid]
|
||||
getaddednodeinfo ( "node" )
|
||||
getconnectioncount
|
||||
getnettotals
|
||||
getnetworkinfo
|
||||
getpeerinfo
|
||||
listbanned
|
||||
ping
|
||||
setban "ip(/netmask)" "add|remove" (bantime) (absolute)
|
||||
setban "subnet" "add|remove" (bantime) (absolute)
|
||||
setnetworkactive true|false
|
||||
|
||||
== Rawtransactions ==
|
||||
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )
|
||||
combinerawtransaction ["hexstring",...]
|
||||
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime ) ( replaceable )
|
||||
decoderawtransaction "hexstring"
|
||||
decodescript "hex"
|
||||
decodescript "hexstring"
|
||||
fundrawtransaction "hexstring" ( options )
|
||||
getrawtransaction "txid" ( verbose )
|
||||
sendrawtransaction "hexstring" ( allowhighfees )
|
||||
@ -91,55 +98,57 @@ signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","re
|
||||
== Util ==
|
||||
createmultisig nrequired ["key",...]
|
||||
estimatefee nblocks
|
||||
estimatepriority nblocks
|
||||
estimatesmartfee nblocks
|
||||
estimatesmartpriority nblocks
|
||||
estimatesmartfee conf_target ("estimate_mode")
|
||||
signmessagewithprivkey "privkey" "message"
|
||||
validateaddress "bitcoinaddress"
|
||||
verifymessage "bitcoinaddress" "signature" "message"
|
||||
validateaddress "address"
|
||||
verifymessage "address" "signature" "message"
|
||||
|
||||
== Wallet ==
|
||||
abandontransaction "txid"
|
||||
abortrescan
|
||||
addmultisigaddress nrequired ["key",...] ( "account" )
|
||||
addwitnessaddress "address"
|
||||
backupwallet "destination"
|
||||
dumpprivkey "bitcoinaddress"
|
||||
bumpfee "txid" ( options )
|
||||
dumpprivkey "address"
|
||||
dumpwallet "filename"
|
||||
encryptwallet "passphrase"
|
||||
getaccount "bitcoinaddress"
|
||||
getaccount "address"
|
||||
getaccountaddress "account"
|
||||
getaddressesbyaccount "account"
|
||||
getbalance ( "account" minconf includeWatchonly )
|
||||
getbalance ( "account" minconf include_watchonly )
|
||||
getnewaddress ( "account" )
|
||||
getrawchangeaddress
|
||||
getreceivedbyaccount "account" ( minconf )
|
||||
getreceivedbyaddress "bitcoinaddress" ( minconf )
|
||||
gettransaction "txid" ( includeWatchonly )
|
||||
getreceivedbyaddress "address" ( minconf )
|
||||
gettransaction "txid" ( include_watchonly )
|
||||
getunconfirmedbalance
|
||||
getwalletinfo
|
||||
importaddress "address" ( "label" rescan p2sh )
|
||||
importprivkey "bitcoinprivkey" ( "label" rescan )
|
||||
importmulti "requests" ( "options" )
|
||||
importprivkey "privkey" ( "label" ) ( rescan )
|
||||
importprunedfunds
|
||||
importpubkey "pubkey" ( "label" rescan )
|
||||
importwallet "filename"
|
||||
keypoolrefill ( newsize )
|
||||
listaccounts ( minconf includeWatchonly)
|
||||
listaccounts ( minconf include_watchonly)
|
||||
listaddressgroupings
|
||||
listlockunspent
|
||||
listreceivedbyaccount ( minconf includeempty includeWatchonly)
|
||||
listreceivedbyaddress ( minconf includeempty includeWatchonly)
|
||||
listsinceblock ( "blockhash" target-confirmations includeWatchonly)
|
||||
listtransactions ( "account" count from includeWatchonly)
|
||||
listunspent ( minconf maxconf ["address",...] )
|
||||
listreceivedbyaccount ( minconf include_empty include_watchonly)
|
||||
listreceivedbyaddress ( minconf include_empty include_watchonly)
|
||||
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
|
||||
listtransactions ( "account" count skip include_watchonly)
|
||||
listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options])
|
||||
listwallets
|
||||
lockunspent unlock ([{"txid":"txid","vout":n},...])
|
||||
move "fromaccount" "toaccount" amount ( minconf "comment" )
|
||||
removeprunedfunds "txid"
|
||||
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
|
||||
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )
|
||||
sendtoaddress "bitcoinaddress" amount ( "comment" "comment-to" subtractfeefromamount )
|
||||
setaccount "bitcoinaddress" "account"
|
||||
sendfrom "fromaccount" "toaddress" amount ( minconf "comment" "comment_to" )
|
||||
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode")
|
||||
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode")
|
||||
setaccount "address" "account"
|
||||
settxfee amount
|
||||
signmessage "bitcoinaddress" "message"
|
||||
signmessage "address" "message"
|
||||
```
|
||||
You can also type `bitcoin help [command]` to get even more extensive info on that command. For example:
|
||||
```
|
||||
@ -181,8 +190,8 @@ For example `bitcoin-cli getnetworkinfo` gives you a variety of information on y
|
||||
```
|
||||
$ bitcoin-cli getnetworkinfo
|
||||
{
|
||||
"version": 140000,
|
||||
"subversion": "/Satoshi:0.14.0/",
|
||||
"version": 150100,
|
||||
"subversion": "/Satoshi:0.15.1/",
|
||||
"protocolversion": 70015,
|
||||
"localservices": "000000000000000d",
|
||||
"localrelay": false,
|
||||
@ -232,4 +241,3 @@ The ~/.bitcoin directory contains all of your files, while `bitcoin-cli help` an
|
||||
## What's Next?
|
||||
|
||||
Continue "Understanding Your Bitcoin Setup" with [§3.3: Setting Up Your Wallet](03_3_Setting_Up_Your_Wallet.md).
|
||||
|
||||
|
@ -203,7 +203,7 @@ You can also use it to look at individual transactions:
|
||||
|
||||
A block explorer doesn't generally provide any more information than a command line look at a raw transaction; it just does a good job of highlighting the important information and putting together the puzzle pieces, including the transaction fees behind a transaction — another concept that we'll be covering in future sections.
|
||||
|
||||
## Summary: Receiving a Transactions
|
||||
## Summary: Receiving a Transaction
|
||||
|
||||
Faucets will give you money on the testnet. They come in as raw transactions, which can be examined with `getrawtransaction` or a block explorer. Once you've receive a transaction, you can see it in your balance and your wallet.
|
||||
|
||||
|
@ -21,15 +21,14 @@ sudo apt-get install mocha -g
|
||||
```
|
||||
### Set Up BCRPC
|
||||
|
||||
You should next download BCRPC from the [BCRPC Repository](https://github.com/dgarage/bcrpc). Clone it or download it, as you prefer.
|
||||
|
||||
Once you've done that, you can finish setting it up:
|
||||
Create a new node.js project and install BCRPC via NPM.
|
||||
```
|
||||
$ unzip bcrpc-master.zip
|
||||
$ cd bcrpc-master
|
||||
$ npm install
|
||||
$ mkdir myproject
|
||||
$ cd myproject
|
||||
$ npm init
|
||||
[...]
|
||||
$ npm install --save bcrpc
|
||||
```
|
||||
|
||||
### Test BCRPC
|
||||
|
||||
To test the BCRPC package, you must first set environmental variables for your rpcuser and rpcpassword. As noted in [§12.1: Accessing Bitcoind with Curl](12_1_Accessing_Bitcoind_with_Curl.md), these come from `~/.bitcoin/bitcoin.conf`.
|
||||
|
@ -17,7 +17,7 @@ Unless otherwise noted, the contents of this repository are Copyright ©2017 by
|
||||
|
||||
## Introduction
|
||||
|
||||
The best way to learn to learn deeply about bitcoin is to avoid GUIs (even bitcoin-qt), and instead learn it from the command line.
|
||||
The best way to learn deeply about bitcoin is to avoid GUIs (even bitcoin-qt), and instead learn it from the command line.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user