v1.1.0 was just released and it brings more information about your server. However there is more information to be released using a simple setting.
If you haven't already seen the previous blog, please go to https://codius.blog/codius-host-settings-part-1/
to see how to allocate more memory to your server. This guide acts as if you did NOT allocate more memory.
By default they have chosen to omit some of the information which is available for a host. By adding some settings you could easily show how many running contracts you have on your server to the world.
Let me show you!
Looking at https://codius.example.com/info
, with codius.example.com
being replaced with your own server, you can see the various info about your server. With an example being:
{
fullMem: false,
serverUptime: 1015355,
serviceUptime: 175826.952,
avgLoad: 0,
numPeers: 190,
currency: "XRP",
costPerMonth: 10,
uri: "https://codius.example.com"
}
To add more information about your host go to
/etc/systemd/system/
edit the file
codiusd.service
you should see a config like this:
[Unit]
Description=Codiusd
After=network.target nss-lookup.target
[Service]
ExecStart=/usr/bin/npm start
Environment="DEBUG=*"
Environment="CODIUS_PUBLIC_URI=https://codius.example.com"
Environment="COST_PER_MONTH=10"
WorkingDirectory=/usr/lib/node_modules/codiusd
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=codiusd
User=root
Group=root
[Install]
WantedBy=multi-user.target
Remember that
Environment="CODIUS_XRP_PER_MONTH=10"
was changed to
Environment="COST_PER_MONTH=10"
in the recent version. Both tells how much you charge for a contract on your server - in this example it is 10 XRP per month.
To add more info simply add:
Environment="CODIUS_ADDITIONAL_HOST_INFO=true"
Your config should now look like this:
[Unit]
Description=Codiusd
After=network.target nss-lookup.target
[Service]
ExecStart=/usr/bin/npm start
Environment="DEBUG=*"
Environment="CODIUS_PUBLIC_URI=https://codius.example.com"
Environment="COST_PER_MONTH=10"
Environment="CODIUS_ADDITIONAL_HOST_INFO=true"
WorkingDirectory=/usr/lib/node_modules/codiusd
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=codiusd
User=root
Group=root
[Install]
WantedBy=multi-user.target
Save the file.
Reload the daemon
systemctl daemon-reload
And then simply restart Codiusd
systemctl restart codiusd
Now if you go to https://codius.example.com/info
you should now also see a field runningContracts:0
which indicates the amount of contracts on your server!
Example:
{
fullMem: false,
serverUptime: 1015355,
serviceUptime: 175826.952,
avgLoad: 0,
numPeers: 190,
currency: "XRP",
costPerMonth: 10,
uri: "https://codius.example.com",
runningContracts: 0
}
Now lets look forward to volume :)