https://en.bitcoin.it/w/api.php?action=feedcontributions&user=Phylum&feedformat=atomBitcoin Wiki - User contributions [en]2024-03-28T13:32:17ZUser contributionsMediaWiki 1.30.0https://en.bitcoin.it/w/index.php?title=Running_Bitcoin&diff=8572Running Bitcoin2011-05-19T20:41:05Z<p>Phylum: /* Sample Bitcoin.conf */</p>
<hr />
<div>There are two variations of the official bitcoin program available; one with a graphical user interface (usually referred to as just “Bitcoin”), and a 'headless' version (called [[bitcoind]]). They are completely compatible with each other, and take the same command-line arguments, read the same configuration file, and read and write the same data files. You can run one copy of either Bitcoin or bitcoind on your system at a time (if you accidently try to launch another, the copy will let you know that Bitcoin or bitcoind is already running and will exit).<br />
<br />
__TOC__<br />
==Command-line arguments==<br />
<br />
Give Bitcoin (or bitcoind) the -? or –help argument and it will print out a list of the most commonly used command-line arguments and then exit:<br />
<br />
Usage:<br />
bitcoin [options] <br />
bitcoin [options] <command> [params] Send command to -server or bitcoind<br />
bitcoin [options] help List commands<br />
bitcoin [options] help <command> Get help for a command<br />
Options:<br />
-conf=<file> Specify configuration file (default: bitcoin.conf)<br />
-gen Generate coins<br />
-gen=0 Don't generate coins<br />
-min Start minimized<br />
-datadir=<dir> Specify data directory<br />
-proxy=<ip:port> Connect through socks4 proxy<br />
-addnode=<ip> Add a node to connect to<br />
-connect=<ip> Connect only to the specified node<br />
-nolisten Don't accept connections from outside<br />
-noupnp Don't attempt to use UPnP to map the listening port<br />
-upnp Attempt to use UPnP to map the listening port<br />
-paytxfee=<amt> Fee per KB to add to transactions you send<br />
-server Accept command line and JSON-RPC commands<br />
-daemon Run in the background as a daemon and accept commands<br />
-testnet Use the test network<br />
-rpcuser=<user> Username for JSON-RPC connections<br />
-rpcpassword=<pw> Password for JSON-RPC connections<br />
-rpcport=<port> Listen for JSON-RPC connections on <port> (default: 8332)<br />
-rpcallowip=<ip> Allow JSON-RPC connections from specified IP address<br />
-rpcconnect=<ip> Send commands to node running on <ip> (default: 127.0.0.1)<br />
-keypool=<n> Set key pool size to <n> (default: 100)<br />
-rescan Rescan the block chain for missing wallet transactions<br />
-rpcssl Use OpenSSL (https) for JSON-RPC connections<br />
-? This help message<br />
<br />
==Bitcoin.conf Configuration File==<br />
All command-line options (except for -datadir and -conf) may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file.<br />
<br />
The configuration file is a list of setting=value pairs, one per line, with optional comments starting with the '#' character.<br />
<br />
The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, Bitcoin (or bitcoind) will look for a file named 'bitcoin.conf' in the bitcoin [[data directory]], but both the data directory and the configuration file path may be changed using the -datadir and -conf command-line arguments.<br />
{|<br />
! Operating System<br />
! Default bitcoin datadir<br />
! Typical path to configuration file<br />
|-<br />
| Windows<br />
| %APPDATA%\Bitcoin\<br />
| :\Documents and Settings\username\Application Data\Bitcoin\bitcoin.conf<br />
|-<br />
| Linux<br />
| $HOME/.bitcoin/<br />
| /home/username/.bitcoin/bitcoin.conf<br />
|-<br />
| Mac OSX<br />
| $HOME/Library/Application Support/Bitcoin/<br />
| /Users/username/Library/Application Support/Bitcoin/bitcoin.conf<br />
|}<br />
<br />
==Sample Bitcoin.conf==<br />
Here is a sample bitcoin.conf file, containing every option set to its default value.<br />
<br />
# bitcoin.conf configuration file. Lines beginning with # are comments.<br />
<br />
<br />
# Network-related settings:<br />
<br />
# Run on the test network instead of the real bitcoin network.<br />
#testnet=1<br />
<br />
# Connect via a socks4 proxy<br />
#proxy=127.0.0.1:9050<br />
<br />
##############################################################<br />
## Quick Primer on addnode vs connect ##<br />
## Let's say for instance you use addnode=4.2.2.4 ##<br />
## addnode will connect you to and tell you about the ##<br />
## nodes connected to 4.2.2.4. In addition it will tell ##<br />
## the other nodes connected to it that you exist so ##<br />
## they can connect to you. ##<br />
## connect will not do the above when you 'connect' to it. ##<br />
## It will *only* connect you to 4.2.2.4 and no one else.##<br />
## ##<br />
## So if you're behind a firewall, or have other problems ##<br />
## finding nodes, add some using 'addnode'. ##<br />
## ##<br />
## If you want to stay private, use 'connect' to only ##<br />
## connect to "trusted" nodes. ##<br />
## ##<br />
## If you run multiple nodes on a LAN, there's no need for ##<br />
## all of them to open lots of connections. Instead ##<br />
## 'connect' them all to one node that is port forwarded ##<br />
## and has lots of connections. ##<br />
## Thanks goes to [Noodle] on Freenode. ##<br />
##############################################################<br />
<br />
# Use as many addnode= settings as you like to connect to specific peers<br />
#addnode=69.164.218.197<br />
#addnode=10.0.0.2:8333<br />
<br />
# ... or use as many connect= settings as you like to connect ONLY<br />
# to specific peers:<br />
#connect=69.164.218.197<br />
#connect=10.0.0.1:8333<br />
<br />
# Do not use Internet Relay Chat (irc.lfnet.org #bitcoin channel) to<br />
# find other peers.<br />
#noirc=1<br />
<br />
# Maximum number of inbound+outbound connections.<br />
#maxconnections=<br />
<br />
<br />
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)<br />
<br />
# server=1 tells Bitcoin to accept JSON-RPC commands.<br />
#server=1<br />
<br />
# You must set rpcuser and rpcpassword to secure the JSON-RPC api<br />
#rpcuser=Ulysseys<br />
#rpcpassword=YourSuperGreatPasswordNumber_385593<br />
<br />
# How many seconds bitcoin will wait for a complete RPC HTTP request.<br />
# after the HTTP connection is established. <br />
rpctimeout=30<br />
<br />
# By default, only RPC connections from localhost are allowed. Specify<br />
# as many rpcallowip= settings as you like to allow connections from<br />
# other hosts (and you may use * as a wildcard character):<br />
#rpcallowip=10.1.1.34<br />
#rpcallowip=192.168.1.*<br />
<br />
# Listen for RPC connections on this TCP port:<br />
rpcport=8332<br />
<br />
# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind<br />
# running on another host using this option:<br />
rpcconnect=127.0.0.1<br />
<br />
# Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate<br />
# with Bitcoin -server or bitcoind<br />
#rpcssl=1<br />
<br />
# OpenSSL settings used when rpcssl=1<br />
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH<br />
rpcsslcertificatechainfile=server.cert<br />
rpcsslprivatekeyfile=server.pem<br />
<br />
<br />
# Miscellaneous options<br />
<br />
# Set gen=1 to attempt to generate bitcoins<br />
gen=0<br />
<br />
# Use SSE instructions to try to generate bitcoins faster.<br />
#4way=1<br />
<br />
# Pre-generate this many public/private key pairs, so wallet backups will be valid for<br />
# both prior transactions and several dozen future transactions.<br />
keypool=100<br />
<br />
# Pay an optional transaction fee every time you send bitcoins. Transactions with fees<br />
# are more likely than free transactions to be included in generated blocks, so may<br />
# be validated sooner.<br />
paytxfee=0.00<br />
<br />
# Allow direct connections for the 'pay via IP address' feature.<br />
#allowreceivebyip=1<br />
<br />
<br />
# User interface options<br />
<br />
# Start Bitcoin minimized<br />
#min=1<br />
<br />
# Minimize to the system tray<br />
#minimizetotray=1<br />
<br />
==Platforms==<br />
===Windows===<br />
<br />
====Start automatically====<br />
To configure the Bitcoin client to start automatically:<br />
<br />
Settings -> Options<br />
<br />
then mark the checkbox titled:<br />
[X] Start Bitcoin on window system startup<br />
[[{{ns:file}}:Client_Settings_Options.png]]<br />
<br />
====Generate on startup====<br />
To configure the Bitcoin client so that mining on startup is automatic:<br />
Configure bitcoin.conf as follows:<br />
gen=1<br />
<br />
===Mac===<br />
<br />
===Linux===<br />
<br />
{{fromold|running_bitcoin}}<br />
[[Category:Technical]][[Category:Developer]]</div>Phylumhttps://en.bitcoin.it/w/index.php?title=Running_Bitcoin&diff=8571Running Bitcoin2011-05-19T20:38:13Z<p>Phylum: /* Sample Bitcoin.conf */</p>
<hr />
<div>There are two variations of the official bitcoin program available; one with a graphical user interface (usually referred to as just “Bitcoin”), and a 'headless' version (called [[bitcoind]]). They are completely compatible with each other, and take the same command-line arguments, read the same configuration file, and read and write the same data files. You can run one copy of either Bitcoin or bitcoind on your system at a time (if you accidently try to launch another, the copy will let you know that Bitcoin or bitcoind is already running and will exit).<br />
<br />
__TOC__<br />
==Command-line arguments==<br />
<br />
Give Bitcoin (or bitcoind) the -? or –help argument and it will print out a list of the most commonly used command-line arguments and then exit:<br />
<br />
Usage:<br />
bitcoin [options] <br />
bitcoin [options] <command> [params] Send command to -server or bitcoind<br />
bitcoin [options] help List commands<br />
bitcoin [options] help <command> Get help for a command<br />
Options:<br />
-conf=<file> Specify configuration file (default: bitcoin.conf)<br />
-gen Generate coins<br />
-gen=0 Don't generate coins<br />
-min Start minimized<br />
-datadir=<dir> Specify data directory<br />
-proxy=<ip:port> Connect through socks4 proxy<br />
-addnode=<ip> Add a node to connect to<br />
-connect=<ip> Connect only to the specified node<br />
-nolisten Don't accept connections from outside<br />
-noupnp Don't attempt to use UPnP to map the listening port<br />
-upnp Attempt to use UPnP to map the listening port<br />
-paytxfee=<amt> Fee per KB to add to transactions you send<br />
-server Accept command line and JSON-RPC commands<br />
-daemon Run in the background as a daemon and accept commands<br />
-testnet Use the test network<br />
-rpcuser=<user> Username for JSON-RPC connections<br />
-rpcpassword=<pw> Password for JSON-RPC connections<br />
-rpcport=<port> Listen for JSON-RPC connections on <port> (default: 8332)<br />
-rpcallowip=<ip> Allow JSON-RPC connections from specified IP address<br />
-rpcconnect=<ip> Send commands to node running on <ip> (default: 127.0.0.1)<br />
-keypool=<n> Set key pool size to <n> (default: 100)<br />
-rescan Rescan the block chain for missing wallet transactions<br />
-rpcssl Use OpenSSL (https) for JSON-RPC connections<br />
-? This help message<br />
<br />
==Bitcoin.conf Configuration File==<br />
All command-line options (except for -datadir and -conf) may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file.<br />
<br />
The configuration file is a list of setting=value pairs, one per line, with optional comments starting with the '#' character.<br />
<br />
The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, Bitcoin (or bitcoind) will look for a file named 'bitcoin.conf' in the bitcoin [[data directory]], but both the data directory and the configuration file path may be changed using the -datadir and -conf command-line arguments.<br />
{|<br />
! Operating System<br />
! Default bitcoin datadir<br />
! Typical path to configuration file<br />
|-<br />
| Windows<br />
| %APPDATA%\Bitcoin\<br />
| :\Documents and Settings\username\Application Data\Bitcoin\bitcoin.conf<br />
|-<br />
| Linux<br />
| $HOME/.bitcoin/<br />
| /home/username/.bitcoin/bitcoin.conf<br />
|-<br />
| Mac OSX<br />
| $HOME/Library/Application Support/Bitcoin/<br />
| /Users/username/Library/Application Support/Bitcoin/bitcoin.conf<br />
|}<br />
<br />
==Sample Bitcoin.conf==<br />
Here is a sample bitcoin.conf file, containing every option set to its default value.<br />
<br />
# bitcoin.conf configuration file. Lines beginning with # are comments.<br />
<br />
<br />
# Network-related settings:<br />
<br />
# Run on the test network instead of the real bitcoin network.<br />
#testnet=1<br />
<br />
# Connect via a socks4 proxy<br />
#proxy=127.0.0.1:9050<br />
<br />
##############################################################<br />
## Quick Primer on addnode vs connect ##<br />
## Let's say for instance you use addnode=4.2.2.4 ##<br />
## addnode will connect you to and tell you about the ##<br />
## nodes connected to 4.2.2.4. In addition it will tell ##<br />
## the other nodes connected to it that you exist so ##<br />
## they can connect to you. ##<br />
## connect will not do the above when you 'connect' to it. ##<br />
## It will *only* connect you to 4.2.2.4 and no one else.##<br />
## ##<br />
## So if you're behind a firewall, or have other problems ##<br />
## finding nodes, add some using 'addnode'. ##<br />
## If you want to stay private, use 'connect' to only ##<br />
## connect to "trusted" nodes. ##<br />
## If you run multiple nodes on a LAN, there's no need for ##<br />
## all of them to open lots of connections. Instead ##<br />
## 'connect' them all to one node that is port forwarded ##<br />
## and has lots of connections. ##<br />
## Thanks goes to [Noodle] on Freenode. ##<br />
##############################################################<br />
<br />
# Use as many addnode= settings as you like to connect to specific peers<br />
#addnode=69.164.218.197<br />
#addnode=10.0.0.2:8333<br />
<br />
# ... or use as many connect= settings as you like to connect ONLY<br />
# to specific peers:<br />
#connect=69.164.218.197<br />
#connect=10.0.0.1:8333<br />
<br />
# Do not use Internet Relay Chat (irc.lfnet.org #bitcoin channel) to<br />
# find other peers.<br />
#noirc=1<br />
<br />
# Maximum number of inbound+outbound connections.<br />
#maxconnections=<br />
<br />
<br />
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)<br />
<br />
# server=1 tells Bitcoin to accept JSON-RPC commands.<br />
#server=1<br />
<br />
# You must set rpcuser and rpcpassword to secure the JSON-RPC api<br />
#rpcuser=Ulysseys<br />
#rpcpassword=YourSuperGreatPasswordNumber_385593<br />
<br />
# How many seconds bitcoin will wait for a complete RPC HTTP request.<br />
# after the HTTP connection is established. <br />
rpctimeout=30<br />
<br />
# By default, only RPC connections from localhost are allowed. Specify<br />
# as many rpcallowip= settings as you like to allow connections from<br />
# other hosts (and you may use * as a wildcard character):<br />
#rpcallowip=10.1.1.34<br />
#rpcallowip=192.168.1.*<br />
<br />
# Listen for RPC connections on this TCP port:<br />
rpcport=8332<br />
<br />
# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind<br />
# running on another host using this option:<br />
rpcconnect=127.0.0.1<br />
<br />
# Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate<br />
# with Bitcoin -server or bitcoind<br />
#rpcssl=1<br />
<br />
# OpenSSL settings used when rpcssl=1<br />
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH<br />
rpcsslcertificatechainfile=server.cert<br />
rpcsslprivatekeyfile=server.pem<br />
<br />
<br />
# Miscellaneous options<br />
<br />
# Set gen=1 to attempt to generate bitcoins<br />
gen=0<br />
<br />
# Use SSE instructions to try to generate bitcoins faster.<br />
#4way=1<br />
<br />
# Pre-generate this many public/private key pairs, so wallet backups will be valid for<br />
# both prior transactions and several dozen future transactions.<br />
keypool=100<br />
<br />
# Pay an optional transaction fee every time you send bitcoins. Transactions with fees<br />
# are more likely than free transactions to be included in generated blocks, so may<br />
# be validated sooner.<br />
paytxfee=0.00<br />
<br />
# Allow direct connections for the 'pay via IP address' feature.<br />
#allowreceivebyip=1<br />
<br />
<br />
# User interface options<br />
<br />
# Start Bitcoin minimized<br />
#min=1<br />
<br />
# Minimize to the system tray<br />
#minimizetotray=1<br />
<br />
==Platforms==<br />
===Windows===<br />
<br />
====Start automatically====<br />
To configure the Bitcoin client to start automatically:<br />
<br />
Settings -> Options<br />
<br />
then mark the checkbox titled:<br />
[X] Start Bitcoin on window system startup<br />
[[{{ns:file}}:Client_Settings_Options.png]]<br />
<br />
====Generate on startup====<br />
To configure the Bitcoin client so that mining on startup is automatic:<br />
Configure bitcoin.conf as follows:<br />
gen=1<br />
<br />
===Mac===<br />
<br />
===Linux===<br />
<br />
{{fromold|running_bitcoin}}<br />
[[Category:Technical]][[Category:Developer]]</div>Phylum