Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents updated for v.20

This is a step-by-step guide for adding a Bitcoin Cash (BitcoinABC) node as a Hot Wallet Buy source. This guide was created based on version 0.16.2 of the BitcoinABC node software. This is only an example and not to be construed as an endorsement for any particular exchange or wallet.

BitcoinABC  runs as a daemon on your VPS (bitcoind), controlled by a simple command interface (bitcoin-cli). Understand that this is not the same as accessing a Bitcoin Cash node run by someone else. This guide is for installing and operating your own node on your own server with CAS.

The following guide is written with instructions to be executed as root. This is discouraged, but simplicity is the goal in mind - not security. You should modify these procedures to safeguard your assets as needed. You will be a target for hackers, and your Bitcoin Cash will be at risk. You are strongly encouraged to implement any and all restrictions available to you to protect your server from unauthorized access. These enhancements however, are beyond the scope of this guide.

Before you begin:

The following example is based on the presumptions:

...

The bitcoind documentation further suggests you allow several days for the block chain to completely download! In our testing, it took over 24 hours.

Download and install the components:

First, open a terminal window and login as root. 

  • Alternately, sudo may be used, prepend “sudo” in the following CLI instructions as necessary. 

Add PPA installation functions to your server:

Code Block
apt-get install software-properties-common
  • It may already be installed. If so, great. No worries.

Download and install the Bitcoin Cash daemon on your server:

Code Block
add-apt-repository ppa:bitcoin-abc/ppa

...

Code Block
gpg: key F08490BA: public key "Launchpad PPA for Bitcoin ABC" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
Ok

Now update Ubuntu and start the installation:

Code Block
apt-get update
apt-get install bitcoind
  • The binary will be installed in /usr/bin and installation should normally only take a few minutes. 

Create the data directory and extract the .conf file:

Code Block
mkdir ~/.bitcoin
cd ~/.bitcoin
gunzip /usr/share/doc/bitcoind/examples/bitcoin.conf.gz
cp /usr/share/doc/bitcoind/examples/bitcoin.conf bitcoin.conf

Create an RPC token for CAS to communicate with BitcoinABC:

RPC is a method of communication between two programs. In this case, the two programs are CAS and BitcoinABC. The RPC token is designed to eliminate the need for hard-coded passwords in the involved configuration and script files. You will receive a password here ONCE. This password is required for CAS; it's your “RPC Password”. You must save it, preferably in a secure note file or database.

First, ensure that python is installed on your server:

Code Block
apt-get install python-minimal

Download rpcauth.py on GitHub 

  • You should already be in the ~/.bitcoin directory 

  • THIS IS ALL ONE LINE!

Code Block
wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/
share/rpcauth/rpcauth.py -O rpcauth.py

Modify the file permissions to allow the script to execute:

Code Block
chmod +x rpcauth.py

Finally, generate the token:

Code Block
./rpcauth.py AnyNameYouWantHere
  • Save the name you entered above, the resulting token, AND the generated password. You'll need it in the next step. 

  • The “AnyNameYouWantHere” is the “RPC User”, and 

  • the generated password is your “RPC Password”.

Modify the bitcoin.conf configuration file:

While you might (under certain circumstances) might want to start the daemon exclusively from a command line, we urge you to modify the following settings within bitcoin.conf and run bitcoind without parameters. Keep it simple!

Open the bitcoin.conf file:

Code Block
nano ~/.bitcoin/bitcoin.conf

Change or add the following settings:

Code Block
server=1
rpcport=8332
rpcauth=AnyNameYouWantHere:e5305a4d7e2c760b196882d2896f77$c5b5e7f6970f7c0544244189f45622887642dca2f36761bcecc1d8055fe8416d
  • Replace the “rpcauth” info with the token generated in the previous step.

  • THE "rpcauth=..." IS ALL ONE LINE! (It won't fit properly on this web page.)

  • Save the file with Ctrl-X, accept the defaults, and press <Enter>.

Start the BitcoinABC node:

From Bitcoin.org: “When Bitcoin Core daemon first starts, it will begin to download the block chain. This step will take at least several days, and it may take much more time on a slow Internet connection or with a slow computer. During the download, Bitcoin Core will use a significant part of your connection bandwidth.”

...

You may also need to configure your firewall to allow inbound connections to port 8333.

See: Configuring Server Firewalls

Now assemble the required information for CAS:

  • User: this is the “RPC User” you created earlier. For this example we'll just say it's “rpcuser”.

  • Password: is the “RPC Password” created earlier.  For this example, we'll make the password “rpcpw”.

  • Accountname: this is the account name of your wallet. An “account” is neither required nor suggested. Account usage is deprecated in bitcoind, however to view any existing accounts, type:

...

  • On a newly installed server, the list is normally empty and may be safely ignored.

Next, add a new crypto-currency type to CAS:

  1. Enter the “Crypto Settings” menu in the left-hand column. 

  2. Click on the “+ ADD” button. 

  3. Create a suitable description, i.e. “Bitcoin Cash USD”.

  4. Select “BTC” for the required “Crypto Currency*” setting.

  5. Set Configuration Cash Currency* to “USD” (or whatever your local currency might be).

  6. Set “Buy Rate Source” to whatever source you prefer.

  7. Set “Minimum Cash Amount Per Transaction*” to zero – this enables any sale.

  8. Select your Hot Wallet Buy source to “BitcoinABC/BitcoinClassic Cash Core”.

  9. Enter the “Parameters” for the Hot Wallet Buy source as determined in the previous step.

...

  1. Click on “SUBMIT” to save your settings.

Finally, test it out:

 Select “Test Hot Wallet Buy” from the RUN BTC SETTINGS TEST.

  • Presuming everything was entered correctly, you should receive confirmation of success!

  • You should also now configure the “Hot Wallet Sell” if you implement it.

UNINSTALLING BITCOIND:

Uninstallation is essentially the reverse order of installation. The following procedures will also delete any unposted transactions and is completely irreversible. Any Bitcoin in your local wallet will be lost forever.

Note
  • THIS WILL DELETE ALL PENDING TRANSACTIONS IN YOUR LOCAL WALLET!!

  • THIS PROCEDURE MAY RESULT IN PERMANENT DATA AND/OR COIN LOSS!!

Change your Crypto settings in CAS:.

  • In CAS, navigate to “Crypto Settings” and update all settings that involve Bitcoin Cash.

Login to your terminal as root (or sudo – depending on how you installed bitcoind to begin with).

Shut down the bitcoind daemon:

Code Block
bitcoin-cli stop

Remove any startup references in crontab:

Code Block
crontab -e

Remove bitcoind from APT:

Code Block
apt-get remove bitcoind

...

Code Block
apt-get autoremove 

Remove the PPA reference within APT:

Code Block
add-apt-repository --remove ppa:bitcoin-abc/ppa

...

You may also need to configure your firewall to deny inbound connections to port 8333.

That's it.

...

 Bitcoin Cash (bitcoind) has been uninstalled from your server, however the data files are left behind. This final step deletes all traces of Bitcoin Cash on your server!!

...

Code Block
rm -rf /root/.bitcoin/

TROUBLESHOOTING BITCOIND:

The bitcoind daemon is demanding when implementing a full node. While discouraged by the Bitcoin community and General Bytes, you may elect to run a “pruning” node by inserting:

...

Additionally, you may discover that running a full node taxes your system dramatically. The following suggestions are offered to assist you in this regard. These pitfalls have nothing to do with CAS, and are offered merely as a courtesy to our valued customers. You are strongly encouraged to run a full node, run bitcoind from a script, and implement the bitcoin.conf file located in the bitcoind directory.

Excessive server CPU load:

  • Shut down any web server. Any unnecessary programs should be eliminated.

...

  • Change your SSH port – attempts to hack into your server become greatly reduced.

  • Implement fail2ban – it will reduce the effects of attacks against your server.

Excessive server memory usage:

Try reducing the number of heap arenas that bitcoind allocates by default. This should have an insignificant effect upon the program's performance, but may dramatically reduce your server's memory consumption. Add the following to your bitcoind startup script:

...