Skip to content

Instantly share code, notes, and snippets.

@Traxo7
Last active October 14, 2023 11:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Traxo7/5016efd0deec1af7ef52efcee27ad74b to your computer and use it in GitHub Desktop.
Save Traxo7/5016efd0deec1af7ef52efcee27ad74b to your computer and use it in GitHub Desktop.
Qortal Setup on Ubuntu VPS

This article goes through the process of setting up a headless Qortal node using Vultr VPS, and setting up a minting account for the node.
This is extremely useful if you want to mint 24/7 without having your Desktop PC running at all times.

Setup VPS

Register Vultr account and create a server

Register an account with Vultr (referral link, you get $100 credits): https://www.vultr.com/?ref=8976898-8H)

Deploy a new server,

  • Under "Choose Server" select Cloud compute
  • Under "CPU & Storage Technology" select Regular Performance.
  • Under "Server Type" select Ubuntu 22.04.
  • At the bottom, Turn Off auto backups. Rest of the form should be filled, change what you need and submit the form to finish deployment.
    (Wait a while until installation is completed, usually up to few minutes)

Install Qortal Core on the server

  • Connect to the server from your local machine:
    local@home:~$ ssh root@123.45.67.89 (use your VPS ip)

  • Download core, install dependencies and core:

root@vultr:~# git clone https://github.com/Qortal/qortal.git
root@vultr:~# sudo apt install maven

root@vultr:~# cd qortal/
root@vultr:~/qortal# echo '{}' > settings.json
root@vultr:~/qortal# mvn clean package

  • run the core:

root@vultr:~/qortal# tmux
in tmux screen:
root@vultr:~/qortal# java -jar target/qortal-4.1.3.jar (might be different version)
Press CTRL + B, then D to exit tmux.
Node is now running.

Add minting key

Make sure Qortal Core is running.
Navigate to home directory
cd

download the Qort tool script (source https://github.com/Qortal/qortal/blob/master/tools/qort):
root@vultr:~# wget https://raw.githubusercontent.com/Qortal/qortal/master/tools/qort

make the script executable
root@vultr:~# chmod +x qort

Generate API Key: root@vultr:~# curl -X POST "localhost:12391/admin/apikey/generate"

Assign minting account:
root@vultr:~# ./qort admin/mintingaccounts YOUR_MINTING_KEY

(optional) Confirm that minting keys are added:
root@vultr:~# ./qort -p admin/mintingaccounts

@Traxo7
Copy link
Author

Traxo7 commented Jun 4, 2021

To make API publicly available, add the following to the settings.json file:

"apiWhitelist": [
  "0.0.0.0/0",
  "::/0"
]

@Pigpig105
Copy link

If it's a private node (i.e. port 12391 isn't forwarded or accessible to anyone outside of the network) then the simplest way is to add this to settings.json:
"apiWhitelistEnabled": false
This will allow all connections to the node, and therefore will allow your UI to talk to it directly.

Alternatively, if you'd like more control over the node's security, you can set a manual whitelist with this setting:
"apiWhitelist": [
"::1",
"127.0.0.1",
"192.168.0.0/24"
]
(the third value "192.168.0.0/24" would need to be modified to allow a certain IP or range)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment