Standalone package configuration

So it seems some people bother with changing 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
Any settings in, override the default ones.
There are actually two possible solutions. But first…

First, I’m gonna share which variables I set in

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

# useful on vps = <YOUR_IP> = 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 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

├── package
│   ├── libs
│   ├── mon
│   ├── ncc
│   ├── nis
│   ├   ... (more files here)
│   ├──
│   ├──
│   ├── 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

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, solution is simple, we need to add CURRENT directory as first directory on class path, so final content of 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:

1 Like

wonderful, thanks!

This is awesome

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