I’ve had to set up different versions of Omni Core on servers over the last year, here’s a short-cut reference for those trying to get started with algorithmic trading over the DEx, or trying to do managed smart properties and apps.
Open your bash shell and copy this into the command line:
wget -O omnicore-0.0.11.2-rel-linux64.tar.gz https://bintray.com/omni/OmniBinaries/download_file?file_path=omnicore-0.0.11.2-rel-linux64.tar.gz
Then unpack the tarball:
tar -zxvf omnicore-0.0.11.1-rel-linux64.tar.gz
Then go to the directory you just installed to:
Almost there, before we fire up omnicored, it’s essential to create a configuration file for bitcoin at root/.bitcoin/bitcoin.conf and set the following parameters:
Note: if you don’t intuitively know your way around a server, try a program like BitVise to shell in, it comes with an FTP client that loads up after logging into the bash shell terminal, and makes navigation and manipulation of files as easy as doing so in your local operating system.
txindex is essential to running Omni Core at all, when you try this process using the QT downloadable client a restart with txindex=1 is prompted, here we are doing it ourselves.
logtimestamps gets the logfile that should be included in the same folder as bitcoin.conf to track all transactions, you can omit this if you prefer.
server = 1 means you can skip including the -server flag that runs omnicored to listen for remote-procedure calls.
rpcuser = <enter your on user name here>
rpcpass = <enter your own password here>
allowip = <enter the ip of the server you’ll be using to run remote procedure calls on this node>
allowip gives some security to your operation by limiting mis-use of your node and any privatekey saved in it to a breach of the server ip specified, be sure to use pubkey encryption on your server.
Note: if you are going to run your code that does RPCs with Omnicore on the same sever, you can enter 127.0.0.1 for localhost.
Now we can run omnicored, if we hadn’t added the config entries, we’d want to add the -daemon and -server tags so it runs in the background and listens for RPCs:
./omnicored -daemon -server
Now wait patiently for a few days while the client proceeds to sync the Bitcoin blockchain. On a virtual private server or cloud-based instance, the incoming connections should be open by default and thus, the process shouldn’t take more than 2-3 days. If things take too long check your omnicore.log file in the .bitcoin folder to see time-stamps on each block coming in and get an idea of the progress, and if it’s going more slowly than 1 recent block per 10-20 seconds, make sure your server ports are open for incoming traffic.
Once your node has caught up with the blockchain, you can start working it from the command line or using RPCs via software packages like OmniTrade.js
For those who are new to server-based scripts, Cloud 9 is a free development environment that runs from your browser.
Finally, hosting a blockchain node requires a huge data foot-print, and most VPS providers simply don’t design their packages around hard drive space. However there is one that allows you to rent a 160 GB VPS that can host the blockchain for at least the next year, for an annual payment of <72 EUR. Now you may be wondering, is it secure to have a lot of funds on addresses controlled by a private key generated and saved inside a server?
The answer is no. Which is why the next tutorial is on multi-signature address management.