bitcoin full node deployment

Keywords: Linux JSON network Blockchain Ubuntu

Server configuration:

Operating system: ubuntu 16.04
CPU:         4U
 Memory: 16G ා generally speaking, 4G is enough, but if you want to check the history, you need to load the complete transaction index table tindex, which results in 8G + memory
 Hard disk: 500G bitcoin has been running since 2008, with a large amount of data accumulated, and the content size of blockchain reaches 210G.
Bandwidth: 10MB+

Installation and deployment:

Download address: https://bitcoincore.org/en/download/

root@wallet-test1:/data# tar xf bitcoin-0.17.1-x86_64-linux-gnu.tar.gz 
root@wallet-test1:/data# ln -s bitcoin-0.17.1 bitcoin           #In the way of soft link, when upgrading the program, it is not necessary to reset the environment variables
root@wallet-test1:/data# mkdir -p coin/btccoin/                 #Data storage directory
root@wallet-test1:/data# vim /etc/profile.d/bitcoin.sh          #Add environment variable
export PATH=/data/bitcoin/bin:$PATH
root@wallet-test1:/data# source /etc/profile.d/bitcoin.sh       #Load environment variables

Profile:

-conf=<file>                #Specify configuration file, default ~ /. bitcoin/bitcoin.conf
-port=<port>                #Listening port, 8332 or testnet 18332 by default
-bind=<addr>                #Listening address, use [host]:port to identify ipv6 address
-datadir=<dir>              #Data storage directory, more than 500G recommended
-daemon                     #Run as Daemons
-dbcache=<n>                #Set data cache size, in megabytes, default 450
-debuglogfile=<file>        #Specifies where debug level logs are saved.
-includeconf=<file>         #Specify the additional profile path. Can only be used for configuration files, not for the command line.
-loadblock=<file>           #Load data block from external named blk000??? Dat at startup
-reindex                    #Rebuild chain state and block index from blk*.dat file on disk
-reindex-chainstate         #Rebuild chain state from blocks of current index
-version                    #View the current program version and exit
-txindex                    #By default, the bitcoin core only creates the transaction index related to the user's wallet. If you need to maintain the index of all transactions, you need to set this option.
-maxmempool=<n>             #Keep transaction memory below < n > MB (default: 300)
-maxorphantx=<n>            #Save up to < n > non connectable transactions in memory (default: 100)
-mempoolexpiry=<n>          #Do not save transactions in the memory pool for more than < n > hours (default:336)
-server                     #Accept command line and JSON-RPC commands
-rpcuser=<user>             #User name for JSON-RPC connection
-rpcpassword=<pw>           #Password for JSON-RPC connection
-rpcport=<port>             #Port for JSON-RPC connection listening, 8332 or testnet 18332 by default
-rpcallowip=<ip>            #Allow JSON-RPC connections to connect from outside. It can be a single IP(e.g. 1.2.3.4), network address / mask (e.g.1.2.3.4/255.255.255.0), or network address / mask length (e.g. 1.2.3.4/24). This option can be specified more than once.
-rpcbind=<addr>[:port]      #The service listening address and port of the JSON-RPC connection. When the - rpcallowip parameter is not specified, it is not valid. The port parameter is optional. If specified, the - rpcport option is overridden. Use [host]:port to identify ipv6 address. The address format is the same as - rpcallowip.

Wallet options

-addresstype                #What type of address is used ("legacy", "p2sh segwit", or "bech32", default: "p2sh segwit")
-disablewallet              #Do not load wallet and disable wallet RPC calls
-discardfee=<amt>           #Rate (in BTC/kB)
-fallbackfee=<amt>          #Charge rate (in BTC/kB), which is used when charge estimation data is insufficient (default: 0.0002)
-keypool=<n>                #Set the key pool size to < n >
-mintxfee=<amt>             #If the cost (in BTC/kB) is less than this value, the cost of creating the transaction is considered to be zero (default value is 0.00001).
-paytxfee=<amt>             #Fees added to transactions sent to you in BTC/kB (default: 0.00)
-rescan                     #Rescan the block chain of wallet transactions lost at startup
-salvagewallet              #Attempt to recover private key from damaged wallet at startup
-wallet=<path>              #Specify the wallet database path, and multiple wallets can be loaded multiple times. If the path is not absolute, relative to < walletdir >; if the path does not exist, create the path (as the directory containing the wallet.dat file and the log file). For backward compatibility, it will also accept the names of existing data files in < walletdir >. )
-walletdir=<dir>            #Specify the directory to save the wallet (default: < dataDir > / wallets, if the directory does not exist, use < dataDir >)
-walletnotify=<cmd>         #Command to execute when wallet transaction changes

Service Management:

Function

bitcoind -conf=/data/bitcoin/bitcoin.conf -daemon

Stop it

bitcoin-cli stop

Other common commands:

bitcoin-cli getnetworkinfo              #View network status

bitcoin-cli getpeerinfo                 #View network nodes

bitcoin-cli getblockchaininfo           #View blockchain information: such as synchronization progress

bitcoin-cli help                        #View all commands

The bitcoin cli command uses:

Command format:

bitcoin-cli [options] <command> [params]
bitcoin-cli [options] -named <command> [name=value]...
bitcoin-cli [options] help                      #Get command help
bitcoin-cli [options] help <command>            #Get command help for command

Options:

-conf=<file>                #Specify the profile path. The relative path will be prefixed with the datadir location. Default filename: bitcoin.conf
-datadir=<dir>              #Specify data storage location
-getinfo                    #Get general information from the remote server. Unlike server-side RPC calls, the result of - getinfo is the result of multiple non atomic requests. Some entries in the results may represent results from different states (for example, wallet balances may come from different blocks of the reported chain state)
-named                      #Pass the specified parameter instead of the location parameter
-rpcclienttimeout=<n>       #HTTP request timeout (in seconds), 0 means no timeout. Default 900
-rpcconnect=<ip>            #Send command to the specified IP node, default 127.0.0.1
-rpccookiefile=<loc>        #The path of the authentication cookie. The relative path is prefixed with the datadir address. Default: data dir
-rpcpassword=<pw>           #Password for JSON-RPC connection
-rpcport=<port>             #Port of JSON-RPC connection
-rpcuser=<user>             #User name for JSON-RPC connection
-rpcwait                    #Wait for RPC server to start
-rpcwallet=<walletname>     #Initiate an RPC connection to a non default RPC server. Need to match exactly the parameters passed to bitcoin cli
-stdin                      #Read additional parameters from standard input, one per line, until the end of EOF/Ctrl-D (recommended for sensitive information, such as passwords). When used with - stdinrpcpass, the first line of standard input is used as the RPC password.
-stdinrpcpass               #Read the first line of standard input as the RPC password. When used in conjunction with - stdin, the first line of standard input is the RPC password.

Posted by Rianna on Fri, 22 Nov 2019 11:35:07 -0800