A little tutorial for those who want to try to run a "Slimweb" node (for Linux/Unix) with the "acme-minitools".
You can read what the tool does
in the README file.
Requirements:
- a server or virtual server (a cheap one will be enough, 1 GB virtual RAM or more recommended) or alternatively a PC which is connected permanently to the Internet with a static IP.
- Slimcoin full node (0.5 client or higher)
- Apache Jena (for database tools)
- Apache Jena Fuseki 2 (the server that provides the data to the clients, like gateways etc.)
- Python 3.5+ with the following libraries:
requests and
rdflib (install them via pip)
- Git (recommended, as it's alpha software and you may want to update it frequently)
Disk space:
- ~300 MB for Jena and Fuseki
- ~2 GB for Slimcoin blockchain
- ~1 GB for a partial blockchain with OP_RETURN transactions (enough to be part of the "Slimweb")
- additionally, ~7 GB for a full blockchain installation (not covered in this guide, it is not necessary for Slimweb but useful if you want to process various queries about the blockchain)
Jena + Fuseki InstallationDownload Fuseki and Jena from the following source:
https://jena.apache.org/download/The current version is 3.6, you will be fine with the binary distributions.
Unpack them and install them in two folders of your choice.
In your
.bashrc, you need to add the following lines (replace
with the directory where you installed Jena):
export JENAROOT=${HOME}/
PATH=${JENAROOT}/bin:${PATH}
Installation of ACME-minitools
Select a directory where you want to install the node. In this example, you install it in an "opt" folder in your home directory.
cd $HOME/opt
git clone https://github.com/d5000/acme-minitools.git
cd acme-minitools
Configuration
Open the file coin.ini.sample in the acme-minitools directory in a text editor.
- Insert the rpcuser and rpcpassword values from your Slimcoin configuration file (slimcoin.conf in your .slimcoin directory).
- Insert the folder where you installed Fuseki in the line "fusekidir="
- Create a data directory and insert it in the "datadir=" line.
Save the file to coin.ini.
Create databases / Run Fuseki
It is recommended to run Fuseki in Publication mode: In this case, the software will only save blocks in your database that contain OP_RETURN transactions (for example, Slimweb torrent hashes).
1. Create a folder for your databases.
2. Create a sub-folder there called pub_slmchain.
3. Go to the directory where you installed Fuseki.
4. Type in the following line (replace with the folder where you installed the databases) to run Fuseki in "publication mode":
./fuseki-server --loc=/pub_slmchain /pub_slmchain
It is recommendable that you use screen for that step as the server will run permanently.
Initial catchup
Start the Slimcoin daemon (slimcoind) and wait until it gets loaded. Go to the acme-minitools folder.
Start the command line utility:
python3 block2rdf-cli.py -P -l 15000
This will save all blocks that contain OP_RETURN transactions into your database. The "15000" is the number of loops the utility will run; one loop processes 100 blocks, so these numbers are enough for the current blockchain height (a mode that simply processes all blocks will be added soon). You can adjust these parameters, look at the --help option.
The script will run:
- until the number of loops is processed
- until you stop it - you can stop block2rdf.py at any time with CTRL-C, it will exit gracefully and save its progress.
- until the blockchain is complete.
As the first OP_RETURN transaction resides on block 966397, you can stop the utility with CTRL-C once it processes the genesis block; then run it with the following additional parameter:
python3 block2rdf-cli.py -P -l 5000 -o 966397
Let it catch up until the blockchain is complete and the script stops. This will take some hours.
Final configuration step
Insert the following line in your slimcoin.conf:
blocknotify=//acme-minitools/blocknotify.sh %s
This step ensures that the script is run every time the client detects a new block, so the blockchain is updated in real-time.
Start the Slimcoin daemon again and ... everything should work now.
How to test if your node works properly
Open a browser on your personal computer (not on the server!). Type in the following:
A control panel for Fuseki will open. Select pub_slmchain as dataset and insert http://:3030/pub_slmchain/query in the "SPARQL endpoint" form field. You can insert SPARQL queries in the big text data field. The following should provide you the last block height saved by the tool:
PREFIX ccy:
SELECT ?block ?height
WHERE {
?block ccy:height ?height
}
ORDER BY DESC(?height) LIMIT 1
For advanced users: You can use the Slimweb Gateway and change the server IP in the source code to the IP of your server. So you can try your node "live".
I will try to modify the Slimweb gateway soon so you can use it without having to include the IP manually.