Wallets, no matter the type, are merely programs. They run on a computer, and communicate with CAS by various means. Usually, the program is a "daemon", a type of program on a Linux-based server that runs in the background. No matter which type, the program runs on a public server and listens for applications to connect and send/receive information.

Each daemon listens on a certain "port". The port is specific to each server and the daemon(s) it runs. The Internet address of the server ("host") and the port it listens on must be correctly specified in CAS for a successful data conversation.

note

See below for a discussion on port forwarding: https://generalbytes.atlassian.net/wiki/spaces/ESD/pages/1002733610/Node+Tutorial+Generic#Port-Forwarding

The General Bytes CAS supports many different cryptocurrencies. Each one requires different parameters, and this is turn varies by the wallet provider you elect to use. This information may be known definitively to GB, and the wallet will be pre-populated with wallet providers (e.g. Coinbase, Kraken, etc). Other wallets are unknown to GB, but you have the option of using those wallets if you can acquire the required parameters from the wallet provider.

This article is intended to help with you determine those parameters.

RPC is an acronym for Remote Procedure Call. It is the method commonly used for programs running on Internet servers to communicate with each other. The parameters required in Crypto Settings are for RPC communication.

General Bytes support will never ask you for your RPC credentials, nor should you offer them. This information permits access to your funds, and we would be reckless in accepting that responsibility. You must do this part yourself.

Parameters must be precise. The slightest typo will cause the whole conversation to fail. Every piece must be supplied by your wallet provider, or in the case of local nodes, it must match exactly the node configuration. The  parameters required may include:

Protocol: this is the format used to transfer information. This is always "http".

Host: this is the IP address of the server hosting the wallet. If you have installed, configured and implemented your own node, then you should already know the IP address of the server you installed the node on. If it's a local node, then you'll most likely use 127.0.0.1

Port: specified by the wallet operator, it's a 4-5 digit number and varies by the type of wallet. The operator may not use the conventional port suggested by the community, you should verify with the operator. Some examples of conventional ports:

User: this is the "user" portion of the RPC credentials given to you by the wallet operator. If you created your own node, then you set your own "user".  RPC credentials are entirely different than account credentials, and the two are rarely identical.

Password: this is the "password" for the RPC user specified above. If you use a wallet provider, use the password they specify for your account. This may be the same as your user password, or it may be different, and it is completely dependent upon the wallet provider's discretion.

Account: this is typically set when everybody uses the same user/password (above). This identifies your account from everyone else's. In some cases "account" identifies your wallet name, as specified by the wallet provider. When implementing a local BTC node, you may have many different wallets for different purposes or BATM's.

Example:

A typical sample "parameter" for a local Bitcoin Core node (bitcoind) will look something like:

http:TheDutch:6szuvplZHgwKWrif_Ms2StzICOJLp4jbwsPRgPiKDqA=:123.123.123.123:8332:PITCO

When you have configured your parameters correctly, test them:

If you've entered the correct parameters, the appropriate tests will show green:

And that's it. You're ready to start selling crypto!


Port Forwarding

You need 2 servers to share information? There’s many ways to do that, but the most private & secure method (so far) implements an SSH tunnel.

SSH is “Secure Shell”, and it’s basically an encrypted exchange of data between your computer & another. In the case of an SSH “tunnel”, you’re not involved. The computers talk to each other, with all the security & privacy guaranteed by SSH. This article covers some solid basics, but doesn’t pretend to teach network security. Get professional help if you value your money & the business that generates it.

Typically, once an SSH tunnel is established, it is left in service the entire time. It’s never turned off (though it can be) but needs to be started every time that one (or the other) computer is rebooted.

The GB Wallet Tunnel was created to simplify this process. It is encouraged, but not required. You can use either approach.

The SSH tunnel must be key-based. Yes, you can use a login password instead, but it’s so insecure that I won’t even discuss it. We’re using keys; end of discussion.

At this point, you’ll need to know your RPC port. That’s the agreed-upon channel that the 2 computers will carry on their conversation. Every flavor of node communicates on it’s own special, dedicated port. Read the docs if you don’t yet know your port. You can’t move forward without it.

Found: port

Terminology

Let’s agree on a few terms to avoid confusion below.

Create a key pair.

The node will we “dialing out” to CAS, so we’ll create the key pair on the node.

  1. Login to your node.

  2. Create a type “ed25519” public key pair:

ssh-keygen -t ed25519

Found: identity_private_key

You’ll need to view the public key for the next step.

cat $HOME/.ssh/id_ed25519.pub

Authorize the key.

We need to authorize the public key. The public key is shared with systems that you want to access. They authorize your public key by adding it to a list.

Open another Terminal window & login to your CAS server.

Type:

wget -qO - ipv4.icanhazip.com

results in your CAS' public IP address. You’ll need that in the next step.

Found: CASIP

Now let’s authorize your public key:

  1. Open the authorization list:

    mkdir $HOME/.ssh
    nano $HOME/.ssh/authorized_keys
  2. Copy & Paste the public key file contents (press Ctrl-Shift-V to paste into nano).

  3. Exit and save (Ctrl-X, then “Y”).

Typing this:

cat $HOME/.ssh/authorized_keys

should display something like this:

If no errors, then you’re good to move on to the next step. The key entered will only work for a login that has it listed in their file. Multiple users can add that public key. In this example, the user’s login name is “demo” (see the “demo@blackbox” prompt?).

Found: username ( = “demo” in this example)

Assemble the SSH parameters.

You started reading this article with the port in hand. Read the docs!

The login username and CASIP address are determined by your CAS server credentials.

The private key was created in the first step.

Try the tunnel.

First, make sure you’ve set it up properly so far. Fill in the correct parameters here:

ssh -i $HOME/.ssh/id_ed25519 demo@123.123.123.123

This should result in an SSH login prompt on your CAS server.

Exit the connection (type “exit”) if no errors are shown.


We’re ready to proceed if there were no errors so far.

Type this (with the correct parameters inserted) to create a tunnel to your CAS server:

ssh -f -N -i $HOME/.ssh/id_ed25519 -R 8090:127.0.0.1:8090 demo@123.123.123.123

If successful, the tunnel is now running quietly in the background.

Test it.

Your relevant CAS Crypto Setting tests should now pass, as though the node were running on your CAS server. NOTE: you must modify your CAS Crypto Setting parameter’s “host” when using an SSH tunnel.

note

When using an SSH tunnel like this, the RPC port “appears” to be local to CAS.

  • The local IP is: 127.0.0.1 and is typically what you’ll enter as the node IP when the tunnel is used.

  • CAS will chat with the remote node locally, never knowing that the node is on another server.

An example using the same parameters provided in the first section of this article:

http:TheDutch:6szuvplZHgwKWrif_Ms2StzICOJLp4jbwsPRgPiKDqA=:127.0.0.1:8332:PITCO

  • Note that the node’s “host” IP has been changed to 127.0.0.1

When using an SSH tunnel like this, the RPC port “appears” to be local to CAS.

  • The local IP is: 127.0.0.1 and is typically what you’ll enter as the node IP when the tunnel is used.

  • CAS will chat with the remote node locally, never knowing that the node is on another server.

An example using the same parameters provided in the first section of this article:

http:TheDutch:6szuvplZHgwKWrif_Ms2StzICOJLp4jbwsPRgPiKDqA=:127.0.0.1:8332:PITCO

  • Note that the node’s “host” IP has been changed to 127.0.0.1