DEV Community

Cover image for How to config a Cyberyen Full Node over Tor
Cykuza
Cykuza

Posted on • Edited on

How to config a Cyberyen Full Node over Tor

CYBERYEN FULL NODE OVER TOR

Cyberyen includes many things, among which anonymity is one of the distinguishing features. When Cyberyen is used outside of the MWEB protocol, transactions are pseudonymous, and while it is true that a transaction does not identify a user or wallet, there is the possibility of partial privacy breaches by methods that can identify the sender of a transaction with an IP address.

So if you care about your digital privacy – keep reading.

Prerequisites:

• A Linux-based server (Debian/Ubuntu recommended)
• Basic command-line knowledge
Enter fullscreen mode Exit fullscreen mode

Create a New User
Create a new user that you'll use to run the Cyberyen node. Replace <user_name> with your desired username:

$ sudo useradd -s /bin/bash -d /home/<user_name> -m -G sudo <user_name>
Enter fullscreen mode Exit fullscreen mode

Create password:

$ sudo passwd <user_name>
Enter fullscreen mode Exit fullscreen mode

Switch to the new user account:

$ su <user_name>
Enter fullscreen mode Exit fullscreen mode

Setup SSH
If you are using a VPS or other cloud machine which you can access via SSH, or your machine already has SSH enabled you can skip this step.

Both Ubuntu 18.04 LTS Desktop and Server come without SSH service enabled by default, which we need to be able to access remotely our machine, but you can easily enable it by just one command.

$ sudo apt-get install openssh-server
Enter fullscreen mode Exit fullscreen mode

This command will install OpenSSH, which provides free SSH connectivity tools and supports all SSH protocol versions. OpenSSH encrypts all the traffic to eliminate possible eavesdropping, connection hijacking, and other attacks.

Note: The default port for SSH is 22, but you can configure it to run on a port of your choice by editing the config file at /etc/ssh/sshd_config, and apply the changes by restarting the service sudo /etc/init.d/ssh restart.

If you have UFW firewall running on your machine, you will need to allow incoming SSH connections. Type the following command:

$ sudo ufw allow ssh
Enter fullscreen mode Exit fullscreen mode

After running it you should see the output below.

Output
Rules updated
Rules updated (v6)
Enter fullscreen mode Exit fullscreen mode

Note: If you changed the default SSH port (22) to a custom port, you will need to open that port instead.

For example, if the ssh daemon listens on port 4242, then use the following command to allow connections on that port:

sudo ufw allow 4242/tcp
Enter fullscreen mode Exit fullscreen mode

Once setup the SSH configuration proceed to the real deal.

Install packages
Install some packages needed for compilation of cyberyen’s source code:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ sudo apt-get install autoconf libtool pkg-config libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libevent-dev libcanberra-gtk-module libdb++-dev libfmt-dev -y
Enter fullscreen mode Exit fullscreen mode

Compile Cyberyen
In order to compile cyberyen, clone the source code repository from Github:

$ cd ~ 
$ git clone https://github.com/cyberyen/cyberyen.git
Enter fullscreen mode Exit fullscreen mode

Build the code:

$ sudo chmod 775 -R ~/cyberyen && cd cyberyen
$ sudo ./autogen.sh
$ sudo ./configure --disable-wallet --without-miniupnpc
$ sudo make install
Enter fullscreen mode Exit fullscreen mode

Strip unnecessary symbols and copy the binaries to /usr/bin:

$ sudo strip src/cyberyend src/cyberyen-cli src/cyberyen-tx
$ sudo cp -a src/cyberyend src/cyberyen-cli src/cyberyen-tx /usr/bin
Enter fullscreen mode Exit fullscreen mode

Configure Cyberyen to use Tor
Before staring syncing the blockchain history, configure some settings for the cyberyen node:

$ cd ~
$ mkdir .cyberyen
$ cat > .cyberyen/cyberyen.conf << EOF
daemon=1
rpcallowip=127.0.0.1
rpcuser=${CYBERYEN_RPC_USER:-cyberyen}
rpcpassword=${CYBERYEN_RPC_PASSWORD:-$(openssl rand -hex 24)}
rpcport=58382
listen=1
txindex=1
onlynet=onion
maxconnections=20
EOF
Enter fullscreen mode Exit fullscreen mode

Installing Tor on Ubuntu is pretty straightforward and easy:

$ sudo apt install tor
Enter fullscreen mode Exit fullscreen mode

After the installation is complete check the configuration and ensure all of these configurations in /usr/share/tor/tor-service-defaults-torrc:

DataDirectory /var/lib/tor
PidFile /var/run/tor/tor.pid
RunAsDaemon 1
User debian-tor

ControlSocket /var/run/tor/control GroupWritable RelaxDirModeCheck
ControlSocketsGroupWritable 1
SocksPort unix:/var/run/tor/socks WorldWritable
SocksPort 9050

CookieAuthentication 1
CookieAuthFileGroupReadable 1
CookieAuthFile /var/run/tor/control.authcookie

Log notice syslog

ControlPort 9051
Enter fullscreen mode Exit fullscreen mode

Restart the Tor service:

$ sudo /etc/init.d/tor restart
Enter fullscreen mode Exit fullscreen mode

Allow cybereynd to access to Tor, by adding it to that user group. Replace <user_name> with the Ubuntu account username you are operating under.

$ sudo usermod -a -G debian-tor <user_name>
Enter fullscreen mode Exit fullscreen mode

Launch Cyberyen over Tor:

$ cyberyend
Enter fullscreen mode Exit fullscreen mode

Follow the logs and monitor progress of the node syncing using tail:

$ tail -f ~/.cyberyen/debug.log
Enter fullscreen mode Exit fullscreen mode

Fetching getnetworkinfo should result in IPv4 and IPv6 flags set to false and Tor to true. This ensures that the operation of our node is private:

$ cyberyen-cli getnetworkinfo
Enter fullscreen mode Exit fullscreen mode

Don't forget about security measures and firewall settings.

Here is the place to contact us:
Support [Matrix]

Thanks C¥kuza.

Image description

Top comments (0)