Skip to content

General Bytes BATM Sumcoin (sumcoind) Configuration

5053s edited this page Jan 24, 2020 · 7 revisions

ATM Setup

How to Setup Sumcoin For General Bytes ATM's

Sumcoin Core (sumcoind) Configuration

The following example is based on the presumption that you have completed the prior steps of CAS installation on a hosted Internet server running Ubuntu 16.04 LTS, or higher, that the server is online, and the BATM has been successfully installed, configured, and tested for proper connectivity to the CAS.

A further presumption is that the sumcoind daemon has been installed, configured, and tested for proper use. This guide is merely designed to help you setup a working sumcoind daemon with a working CAS.

This is a step-by-step guide for adding sumcoind as a Hot Wallet Buy source. This is only an example and not to be construed as an endorsement for any particular exchange or wallet.

This has been tested on Sumcoin Core v 0.17.1.0

First, open a terminal window and login to your server as root.

Create an RPC token for CAS to communicate with sumcoind: The RPC token is designed to eliminate the need for hard-coded passwords in 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 during this step.

Download rpcauth.py on GitHub (all one line):

Not required if you compile your own binaries

wget https://raw.githubusercontent.com/sumcoinlabs/sumcoin/master/share/rpcauth/rpcauth.py -O ~/.sumcoin/rpcauth.py

May Be Deprecated

Modify the file permissions to allow the script to execute:

chmod +x ~/.sumcoin/rpcauth.py

Best Method

Then finally run the RPC token generator that you just installed and enabled:

Path,

root@root:~/sumcoin/share/rpcauth

./rpcauth.py AnyNameYouWantHere

Example Result

root@root:~/sumcoin/share/rpcauth$ ./rpcauth.py sumcoinatm

String to be appended to sumcoin.conf:

rpcauth=AnyNameYouWantHere:aac8dlfjsdfkjds876dfpdsfjhlsdlkfasd8plkdjf8d8984lndlkdfjsdflkjsadfkfjkhlkjhdjdfh3b90e44ddca2 Your password: T0Dx2VLjgikeTANOGosdifoIJH80Xn2E0Tcx-jdlh1GIcr8c=

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” for CAS. The token is put in the sumcoin.conf file (as described below).

A sample token is all one line and should look similiar to this:

AnyNameYouWantHere:aac8dlfjsdfkjds876dfpdsfjhlsdlkfasd8plkdjf8d8984lndlkdfjsdflkjsadfkfjkhlkjhdjdfh3b90e44ddca2

The generated password may look like:

T0Dx2VLjgikeTANOGosdifoIJH80Xn2E0Tcx-jdlh1GIcr8c=

Modify the sumcoin.conf configuration file:

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

Locate the Sumcoin Core configuration file.

  • sumcoin.conf in data dir -

Add (or modify) the following settings in the configuration file:

deprecatedrpc=accounts
deprecatedrpc=estimatefee
addresstype=legacy
server=1
daemon=1
rpcallowip=your_Server_IP_for_CAS
rpcuser=username 
rpcpassword=password
rpcport=3332

It should look something like this

https://pbs.twimg.com/media/D-YawFbUYAA-Eru?format=jpg&name=medium

The RPC (Remote Procedure Call) uses "credentials" to communicate between programs. It's required, and can be a security issue if insecure. Depending on the RPC settings and your firewall, you might expose your wallet to the world - and that would be unwise. Research the subject before randomly changing any settings.

Your RPC user credentials:

rpcuser=AnyNameYouWantHere
rpcpassword=DontUseThisMethod!YouHaveBeenWarned!

-(preferred)-

rpcauth=AnyNameYouWantHere:e5305a4d7e2c760b196882d2896f77$c5b5e7f6970f7c0544244189f45622887642dca2f36761bcecc1d8055fe8416d

Your end result should look like this Example in sumcoin.conf (Tested up to v0.17.1)

addresstype=legacy
deprecatedrpc=accounts
deprecatedrpc=estimatefee
server=1
daemon=1
rpcallowip=your_Server_IP_for_CAS
rpcport=3332
rpcauth=WalletName:bbc8fHC2jkeyojdlnlfnd89c1d61cee0aa70aa947e060617fd9231fac102b25cchh3jwls7bBb90e44ddca2

Use either the top method or bottom (preferred) method.

If using the first/top method, the rpcpassword is whatever you want it to be.
The “rpcuser/rpcpassword” method is deprecated because it is considered a security risk. If using the second/bottom method:
the "rpcauth" is all one line,

Replace the “rpcauth” info with the token generated in the previous step. RPC tokens (like this) are the preferred method of RPC authorization.

Start the sumcoind daemon (background process):

Once you have modified sumcoin.conf, (re)start the daemon:

root@root:./sumcoind -server -daemon

It may take several minutes for Sumcoin Core to completely start.

Sumcoin Core and CAS will not be able to communicate until Sumcoin Core has "warmed up". It may take a few minutes - or longer.

Ascertain that you have a default address. Use:

sumcoin-cli listaccounts

One of three things will be displayed:

  • "Sumcoin Core is still "warming up". Give it a few minutes and try again."

"Empty brackets {} indicate that no address exists. You must create one." Anything between the brackets means you can safely skip to the next part.

If you get empty brackets (result #2), then create a default Wallet Address and Account name by running:

sumcoin-cli getnewaddress "makeUpWalletNameBetweenQuotes"

You can safely skip this if you are CERTAIN one has already been created.

CAS will NOT work with Sumcoin Core unless at least one address exists!

NOTE: sumcoind may take several hours (or longer) to completely synchronize with the Sumcoin network. CAS will NOT work with sumcoind until the synchronization is COMPLETE. As of June 2019 the block size is 600 MB

Configure CAS to communicate with your Sumcoin Core wallet:

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 “RPCPassword” created by rpcauth.py earlier, or the one you made up (if you don't implement a token). For this example, we'll make the password just plain “rpcpw”.

Accountname: * Deprecated *

This is the account name of your wallet. An account name is not required for operation nor suggested. Account usage is deprecated in sumcoind, however it is useful to for operators to have a static address with a name. To view any existing accounts, type:

  • From command line
sumcoin-cli listaccounts
  • From Debug console

list accounts

This parameter may be safely omitted if only a default account exists (""). If you choose to specify an account, select one named in the list. Whether using the default ("") or not, we'll refer to it as "walletname" in the examples below.

IF RUNNING ON GB ATM CLOUD SERVER & wallet is on outside server

You will need to install this program on the wallet server

https://github.com/GENERALBYTESCOM/batm_public/tree/master/batm_ssh_tunnel

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

  • Enter the “Crypto Settings” menu in the left-hand column.
  • Click on the “+ ADD” button.
  • Create a suitable description, i.e. “sumcoind SUM”.
  • Select “SUM” for the required Crypto Currency* setting.
  • Set Configuration Cash Currency* to“USD” (or whatever your local currency might be).
  • Set Buy Rate Source to whatever source you prefer.
  • Set Minimum Cash Amount PerTransaction* to zero – this enables any sale.
  • Select your Hot Wallet Buy source to “sumcoin Core - sumcoind”.
  • Enter the Parameters for the Hot Wallet Buy source as determined in the previous step:

Example (typical):

“http:rpcuser:rpcpassword:IPaddressofDaemon:3332”

Click on “SUBMIT” to save your settings.

Finally, test it out by selecting Test Hot Wallet Buy/sell options from the RUN SUM SETTINGS TEST.

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

You should also now configure the Hot Wallet Sell using the same parameters if you implement it on a BATMThree (or other 2-way).

You're done!

Clone this wiki locally