Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Commit

Permalink
mark rpcuser / rpcpassword / maxconnections optional; increase open f…
Browse files Browse the repository at this point in the history
…iles; add bsdmainutils build dependency
  • Loading branch information
Eagle[TM] committed Jan 7, 2017
1 parent 686275e commit 2f019ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
13 changes: 8 additions & 5 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ to your `.bashrc`, `.profile`, or `.bash_profile`, then logout and relogin:
We currently recommend bitcoin core 0.13.2 stable. If your package manager does not supply
a recent bitcoind or you prefer to compile it yourself, here are some pointers for Ubuntu:

$ sudo apt-get install make g++ python-leveldb libboost-all-dev libssl-dev libdb++-dev pkg-config libevent-dev
$ sudo apt-get install make bsdmainutils g++ python-leveldb libboost-all-dev libssl-dev libdb++-dev pkg-config libevent-dev
$ sudo su - bitcoin
$ cd ~/src && wget https://bitcoin.org/bin/bitcoin-core-0.13.2/bitcoin-0.13.2.tar.gz
$ sha256sum bitcoin-0.13.2.tar.gz | grep 621201189c0409cb17a5073278872dcdcfff1ea147ead6958b55e94416b896d7
Expand All @@ -120,7 +120,10 @@ Write this in `bitcoin.conf`:

daemon=1
txindex=1
maxconnections=8

rpcuser / rpcpassword options are only needed for non-localhost connections.
you can consider setting maxconnections if you want to reduce bitcoind bandwidth
(as stated above)

If you have an existing installation of bitcoind and have not previously
set txindex=1 you need to reindex the blockchain by running
Expand Down Expand Up @@ -283,14 +286,14 @@ If you intend to run the server publicly have a look at README-IRC.md

Electrum server currently needs quite a few file handles to use leveldb. It also requires
file handles for each connection made to the server. It's good practice to increase the
open files limit to 64k.
open files limit to 128k.

The "configure" script will take care of this and ask you to create a user for running electrum-server.
If you're using the user `bitcoin` to run electrum and have added it as shown in this document, run
the following code to add the limits to your /etc/security/limits.conf:

echo "bitcoin hard nofile 65536" >> /etc/security/limits.conf
echo "bitcoin soft nofile 65536" >> /etc/security/limits.conf
echo "bitcoin hard nofile 131072" >> /etc/security/limits.conf
echo "bitcoin soft nofile 131072" >> /etc/security/limits.conf

If you are on Debian > 8.0 Jessie or another distribution based on it, you also need to add these lines in /etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive otherwise the limits in /etc/security/limits.conf will not work:

Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fi
if [ ! id -u $user >/dev/null 2>&1 ]; then
echo "adding user $user"
useradd $user
echo "$user hard nofile 65536" >> /etc/security/limits.conf
echo "$user soft nofile 65536" >> /etc/security/limits.conf
echo "$user hard nofile 131072" >> /etc/security/limits.conf
echo "$user soft nofile 131072" >> /etc/security/limits.conf
fi


Expand Down Expand Up @@ -110,13 +110,13 @@ chown $user:$user $logfile

bitcoind_user=$(read_config "bitcoind_user")
if ! [ "$bitcoind_user" ]; then
read -p "rpcuser (from your bitcoin.conf file): " -r
read -p "rpcuser (from your bitcoin.conf file, leave empty for localhost): " -r
write_config "bitcoind_user" $REPLY
fi

bitcoind_password=$(read_config "bitcoind_password")
if ! [ "$bitcoind_password" ]; then
read -p "rpcpassword (from your bitcoin.conf file): " -r
read -p "rpcpassword (from your bitcoin.conf file, leave emtpy for localhost): " -r
write_config "bitcoind_password" $REPLY
fi

Expand Down
2 changes: 1 addition & 1 deletion electrum-server
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ case "$1" in
fi

echo "Starting server as daemon"
cmd="ulimit -n 65536 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
cmd="ulimit -n 131072 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
if [ `id -u` = 0 ] ; then
su $user -c "$cmd"
else
Expand Down
6 changes: 3 additions & 3 deletions electrum.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ pruning_limit = 100
[bitcoind]
bitcoind_host = localhost
bitcoind_port = 8332
# user and password from bitcoin.conf
bitcoind_user =
bitcoind_password =
# user and password from bitcoin.conf (not needed for localhost)
#bitcoind_user =
#bitcoind_password =

0 comments on commit 2f019ec

Please sign in to comment.