Running a dedicated server
Although CoinPress provides peer node server hosting at no cost, running additional peers maximizes reliability and speed while promoting decentralization. Currently dedicated server builds are provided in generic binary form for Linux-x64 and OSX-x64 separately, with a Win-x64 executable server bundled with the wallet download. Server binaries are available on the coin info page.
Although servers will periodically check CoinPress.cc for additional nodes to add, the servers are completely self-contained and will work without the CoinPress API.
Note: Currently running the Win-x64 server and the wallet on the same machine simultaneously is not supported.
- Go Ethereum (Only for Linux/OSX. Included with the Windows version)
- .NET Core 2.0 (Likely already supported by your operating system if you’ve ran updates at all recently)
Installing Go Ethereum (Geth) can be very different between distributions. While .NET Core 2.0 may be already installed on your server, it’s unlikely that Geth is installed on a typical Linux or OSX install. A Geth.exe portable client is bundled with the Windows distribution and requires no installation.
An example of how to install Geth on an Ubuntu 16.04 server:
sudo apt-get update sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum
Installing .NET Core 2.x may be necessary if it’s not automatically supported by your operating system. On a completely stock (but updated) Ubuntu 16.04 server, the server binary ran without any issue.
Download the server
Download the server binaries from the coin info page in your account. If you didn’t register when creating a coin, the coin info page is available in the form of:
So for instance if you wanted to download the wallet or dedicated server for DankMemeCoin (DMC) it would be https://coinpress.cc/coins/dmc.
Running the server
If you’re running the Windows version, the server and the wallet are bundled together. You can’t run them both at the same time, but it’s likely they will both just work without any adjustment if you’ve run Windows Update anytime recently. To run the standalone server:
If you’re running, for example, Ubuntu 16.04, extract all files from the .zip file downloaded from the coin info page into a directory on your server. On a stock Ubuntu 16.04 server, “unzip” had to be installed first:
sudo apt-get install unzip
Then unzip the file you downloaded. Note that you may have to change the file name specified in this step to match the downloaded zip file name:
Enter the directory you just unzipped the files to:
Set permissions on the executable:
chmod +x ./MyCoinServer
Now you can run the server:
Changing the config
Once you’ve ran the server for the first time, there is a file named ServerConfig.json in the same directory with some configuration items that can be changed.
- AdditionalCommandLineArgs: Additional command line arguments to be fed to the Geth instance. Defaults to “–shh” to enable the whisper protocol.
- CacheSize: Size (in megabytes) of the Geth cache. Defaults to 128.
- DataDirectory: Change the directory where blockchain information is stored.
- Port: The port for Geth to accept connections. Defaults to 3906.
- RPCPort: Port for RPC. Defaults to 3907.
Automatically starting node on server boot
Create a file called /etc/systemd/system/coinpress.service with the following contents. You’ll need to update the path for ExecStart to wherever you extracted the MyCoinServer files above:
[Unit] Description=CoinPress Coin Service [Service] Type=simple ExecStart=/path/to/MyCoinServer [Install] WantedBy=multi-user.target
Now enable it to run at boot:
sudo systemctl enable coinpress
It won’t start automatically until you reboot the server. To start the server daemon run:
sudo systemctl start coinpress
If you’re behind a firewall like the vast majority of people in the world, you’ll want to forward the TCP/UDP ports 3904-3910 to whatever machine is running the server. The server will work in reduced functionality mode without the ports, but makes it reliant on the CoinPress API being up. Here’s a great guide on forwarding ports.
Servers will automatically join the network and communicate neighbor node information to other nodes.