Standalone package configuration


#1

So it seems some people bother with changing config.properties of NIS, so I thought I will describe my configuration.

Basically, there’s NO need to do that, that’s what for we’ve made config-user.properties.
Any settings in config-user.properties, override the default ones.
There are actually two possible solutions. But first…

config-user.properties

First, I’m gonna share which variables I set in config-user.properties:

# This one's up to you
# nem.folder = ./nem

# useful on vps
nem.host = <YOUR_IP>
nem.network = testnet
nis.bootName = <your fancy name>
nis.bootKey = <HARVESTING KEY>

nis.shouldAutoHarvestOnBoot = true
nis.additionalHarvesterPrivateKeys =

# you might want one of those below
#nis.ipDetectionMode = 
#nis.additionalLocalIps = 
nis.unlockedLimit = 5
# I'm usually setting it to false on vps, so that node has to load all the chain
# when starting
nis.delayBlockLoading = false

Lazy man solution

Lazy man solution is to simply copy config-user.properties everytime you download new version,
either into package directory or into package/nis directory.

That’ll work obviously, but you’ll have to copy the file each time.

Lazier man solution

This one requires creating own starting script, but in the end it’s even lazier.
Directory structure looks as follows

├── config-user.properties
├── custom.startNis.sh
├── package
│   ├── libs
│   ├── mon
│   ├── ncc
│   ├── nis
│   ├   ... (more files here)
│   ├── nix.runNcc.sh
│   ├── nix.runNis.sh
│   ├── README.txt
│   ├── runNcc.bat
│   └── runNis.bat

Thanks to such setup, you’ll only need to replace whole packge dir.
Now the only important thing is what to put in custom.startNis.sh.

The crucial thing is to understand how class path works in java, most important thing is that ORDER on the class path matters, as that’s the order in which directories are searched for files opened as resources.

Standard nis start script looks like this

java -Xms512M -Xmx1G -cp ".:./*:../libs/*" org.nem.deploy.CommonStarter

but this is done in nis directory, so actual command is actually:

java -Xms512M -Xmx1G -cp "./nis:./nis/*:./libs/*" org.nem.deploy.CommonStarter

now if we go one directory up, it will look like this

java -Xms512M -Xmx1G -cp "./package/nis:./package/nis/*:./package/libs/*" org.nem.deploy.CommonStarter

The only thing left is how to force java to load our config-user.properties, solution is simple, we need to add CURRENT directory as first directory on class path, so final content of custom.startNis.sh looks like this:

java -Xms512M -Xmx1G -cp ".:./package/nis:./package/nis/*:./package/libs/*" org.nem.deploy.CommonStarter
# or if you want slightly more memory
#java -Xms1G -Xmx2G -cp ".:./package/nis:./package/nis/*:./package/libs/*" org.nem.deploy.CommonStarter

That’s all! :slight_smile:


NEM Supernode Rewards Program
Полезные ссылки для разработчиков
#2

wonderful, thanks!


#3

This is awesome


#4

#5

#6

This is really nice, but is there also something similar for logalpha.properties? I edit it to reduce the footprint of the log files on disk.