Scalable monitoring system for chia farming. Supports:
- Multiple distributed harvesters.
- Collects stats on: disks S.M.A.R.T., disk read access, plots, chia farming.
- Remote-UI panel with https access to server (all nodes & disks monitoring real-time).
- Download postgresql from postgresql.org
- Init db by executing: initdb.exe -D <db_folder>
- In <db_folder> edit pg_hba.conf change all METHOD to md5 as follows:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
- Execute: psql.exe -U postgres and enter your password, enter following commands: ALTER USER postgres WITH encrypted password 'your postgres password'; CREATE DATABASE chiamon; \q
- Stop and start postgresql service
- Execute: psql.exe -U postgres chiamon < chiamon\sql\db_1.sql
- Download tomcat from https://tomcat.apache.org as zip archive and extract all
- Goto tomcat\webapps directory and remove all files and folders here
- Create folder tomcat\webapps\ROOT\WEB-INF\lib and put jar from chiamon\target folder here
- Copy chiamon\cfg-tomcat\web.xml to tomcat\webapps\ROOT\WEB-INF
- Create folder tomcat\key. Now we are ready to create self signed certificate for your chiamon server. Find tool 'keytool' if you have java installed it must be on your path, if not, install java, go to java\bin. Execute following script: keytool -genkey -alias tomcat -keyalg RSA -keystore tomcat\key\mykey Remember your keystore password. Command will prompt 'Enter key password for ' just press enter.
- Now open tomcat\conf\server.xml and add new connector:
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
port="8443" maxThreads="200"
scheme="https" secure="true"
SSLEnabled="true">
<SSLHostConfig>
<Certificate
certificateKeystoreFile="tomcat\key\mykey"
certificateKeystorePassword="your keystore password"
type="RSA"
/>
</SSLHostConfig>
</Connector>
- Open tomcat\context.xml and add following inside :
<Resource name="jdbc/postgres" auth="Container"
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/chiamon"
username="postgres" password="your postgres password" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
- Create password for your tomcat user by executing: tomcat\bin\digest.bat -a SHA-256 -h org.apache.catalina.realm.MessageDigestCredentialHandler your_password you will get following result your_password:your_password_hash copy your_password_hash and edit file tomcat\conf\tomcat-users.xml by insert inside :
<role rolename="admin"/>
<user username="admin" password="your_password_hash" roles="admin"/>
comment all other users and roles.
- Open tomcat\conf\server.xml Find and modify line as follows:
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase">
<CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="sha-256" />
</Realm>
</Realm>
- Download postgresql driver for tomcat at 'https://jdbc.postgresql.org/download.html' and put it in tomcat\lib
- Tomcat is ready! Start it by typing: tomcat\bin\catalina.bat run
- Check if service is available by connecting from browser: https://127.0.0.1:8443/servlet/clientservice?cmd=db type 'admin' as username and your_password if everything is correct return should be like this "PostgreSQL 9.6.22, compiled by Visual C++ build 1800, 64-bit" Now your server is running and ready to accept connections from harvesters. If you are inside firewall and you need to access data by UI client from outside, tomcat default port should be open.
On each harvester node create folder 'chiamon' with following structure:
chiamon\logs - directory for logging
chiamon\target - directory for application, put main jar here
chiamon\node_log.xml - configuration file for logging
chiamon\harvester_node.ini - monitoring configuration
Configuring monitoring configuration file harvester_node.ini:
[init]
node_id - is used to identify each harvester
main_node_url - address of chiamon main server
main_node_user - user defined in tomcat, admin by default
main_node_pwd - encrypted password for user defined in tomcat
to get encrypted password run chiamon\convert_password.bat your_password and you will receive encrypted password
example: your password is 'secret'
execute: convert_password.bat secret
your receive following string
Password [secret] -> [BNrtrFijAiM=]
in ini file set:
main_node_pwd = BNrtrFijAiM=
main_node_send_stats_interval - how often your harvester will send stats on main node
[vars]
io_time_max_scan - max time used for disk scanning, if disk scan is not completed in time it will be stopped and result will return error
io_time_max_read - max time used for read file operations
http_time_max_send - max time used for send result to remote node
[logs]
path - path to chia main node logs
file_filter - read all logs with this file filter
rescan_interval - logs rescan interval
rescan_time_max - max time used for read logs operation
[disks]
this section is common for all disks and is used as parent for all disks
rescan_interval - disk rescan interval
file_filter - read files with this file filter
read_interval - read interval for reading files
read_files - number of files to read per iteration
read_block_size - size to read on each file
smarts_interval - disk smart read interval (0 if smart is disabled)
smarts_cmd - command to call smartctl tool from shell
if your want to read disks S.M.A.R.T. info you have to install smartctl tools
https://www.smartmontools.org/wiki/Download
it's available for windows and linux
make smartctl available on path or write full path in cmd
use for linux:
smarts_cmd = dev=$(df -P {path} | awk 'END{print $1}') && sudo smartctl -a $dev
use for windows:
smarts_cmd = smartctl -a {path}
also you can set smarts_cmd for each disk separately
smartctl requires admin rights for reading disks S.M.A.R.T.
so under linux you have to run sudo ./run_harvester_node.sh
undex windows you may run run_harvester_node.bat under admin if you want all info
windows do not require admin rights, but could skip some data if not in admin mode
[disk_N]
define each disk on this node
id - unique identifier through all nodes you have
name - visible name
path - path to disk where plots are
for linux path could be like that:
/path
/plots/{id}
for windows path could be like that:
c:\\
c:\\plots\\
size - declared size of disk, example: 10tb
run harvester monitoring by executing:
./run_harvester_node.sh
or
run_harverster_node.bat
check logs if everything works well
Check folder /cfg-sample which contains working configuration on linux for 3 harvesters showed on pictures below.
From any remote location you can access your harvesters.
Create folder 'chiamon' with following structure:
chiamon\logs - directory for logging
chiamon\target - directory for application, put main jar here
chiamon\client_log.xml - configuration file for logging
chiamon\client.ini - UI configuration
Configuring UI configuration file client.ini:
[init]
client_id - client unique identifier
main_node_url - url where tomcat is running
main_node_user - look harvester_node.ini
main_node_pwd - look harvester_node.ini
[vars]
stats_collect_time - display data in this interval
[ui]
autoscript - automatically open chart windows on start
you can select multiple, separated by comma, like this:
autoscript = logsfarm_plots_total_chart,logsfarm_plots_farmed_chart
run UI client by executing:
./run_client.sh
or
run_client.bat
check logs if everything works well
You can also run command-line tool 'run_profit_calculator' to calculate your profit with many details.
run_profit_calculator <total_net_space_in_tib> <your_space_in_tib> <coin_price_usd> [your_currency_to_usd_rate]
example (32 EiB total, 300 TiB yours, $200 per coin): run_profit_calculator 32_000_000 300 200
output:
- git clone https://github.com/jcodic/chiamon
- mvn clean compile assembly:single
you need java 1.8+ and maven installed or you may use compiled version from target folder
This soft is completely free & opensource and I don't make it for money,
but if you find this piece of software helpful and useful you can give me some donation to:
chia -> xch1ewvdfu0eknnsvrlw4unwh3eyyy5r72s9zjxafergnssee5rpmzlqsnr9nl
bitcoin -> bc1qq3k8zflkacmv8n3rnh4fcw76886y7z7j3mez59
bincoin cash -> qzdr7e925jy3pjngu2lncc0akkg66540pq74zje8v5
Thank you.