Need Help Stopping and Starting NXT



  • Ok, so we stated burstpowernetwork.ml, have a testing pool and wallet there. Tweaking the settings for NXT means restarting the wallet sometimes. That is not an easy task sometimes. A simple CTRL+C is good most of the time, but often that sticks. Using either task manager or closing the console window is not the way to go, but sometimes that is the only choice. About half the time if we do this, the wallet will never start again until the DB has been replaced. NXT starts in its own window and if working stays open. Any error and it shuts down.

    The code line going in is

    start "BURST" "%%~$path:f" -cp burst.jar;lib\*;conf nxt.Nxt
    

    On our server the PATH is set so the line is actually...

    start "BURST"  java.exe -cp burst.jar;lib\*;conf nxt.Nxt
    

    I gather that is saying to use java.exe with burst.jar as a library and nxt.Nxt(within the lib) as a loading point for the config. I have extracted the jar and don't really have the time to pick through and find that point where the console is opened. If so, I would simply put a java pause in and that way I could see an error and go from there. The nxt logs are not great at all. Set all the settings to FINE and still just get the basics. I either need a better shut down method or a better start up method.



  • I can add that I saw a post here that had a soluton, but I will have to play and tweak. It posted to use a method like this.

    java -jar start.jar STOP.PORT=<port> STOP.KEY=<password>
    

    I just need to figure how to get the other parameters in there, something like.

    java -jar burst.jar\*; nxt.Nxt STOP.PORT=<port> STOP.KEY=<password>
    

  • admin

    @morantis Try this:

    java -cp burst.jar;lib*;conf nxt.Nxt STOP.PORT=<port> STOP.KEY=<password>
    


  • I am in a bit. Just got the pool and server back up and running so I want it to be for a while. I am sure we lost people on the first day(even though it is testing) because they saw the announcements and there was nothing there. It is just that I tweak the pool settings and the NXT settings and want to implement right away. NXT settings will, of course, need a service restart.


  • admin

    @morantis I'd test on a separate machine, get it working properly, then put it on the pool.



  • @haitch Yeah, well after today I figured on having a synced and ready to go backup.


  • admin

    @morantis You don't want to know how many wallets I have running .... 😉



  • @haitch Lol, I can just imagine someone with less coding experience giving up. I am not saying that my experience is that much, but I see a lot of people referring to the appdata folder and this and that. It is a Java library and code, lol, I removed the appdata folder and settled to one folder, right on c drive, named Burst. I just do not like the debugging set up of NXT. I cannot get the log files to say much at all and then there is Jetty running and Java. I appreciate using batch files for ease, but Windows 10 is ridiculous with associations and doing what it is told. One minute, you right click a JS or Java file and say open with, say Wordpad for a quick peek and it goes right for trying to run the script. The next minute, nope. Sometime I just want to look really quick and not wait for a full blown IDE to open a file. Just saying, and I am pretty damend sure that the pool software is written that it is going to have to be on Windows. That means running a Windows VPS server and that is a real pain. No quick SSH, but full bore remote desktops and crap. I am through venting now, lol, thank you for your time...


  • admin

    @morantis The pool looks like you're running a derivative of the Uray pool code - that should be able to run on anything. If you need a VM to run it on, let me know and I'll set you one up for free.



  • @haitch I might do that. Trying a few VM's or VPS's is not a big deal, but this pool is actually a small part of a bigger project that we are putting together. I would not usually be on the same part so long, but I feel that a project that does not follow through on things they feel are less important will find that they have very little to worry about soon enough when the whole thing fails. Every client, every aspect of any business is a vital part, no matter how big or small.



  • Well, I looked and as long as the jar zipped back up right I could mod the code to stop and wait for user input right before exiting on an error in NXT.

     catch (Exception e)
          {
            Logger.logErrorMessage(e.getMessage(), e);
            System.exit(1);
    

    that is the code at the end of the init() function in the NXT class inside the burst.jar.

    I could do it easy and not deal with user input

     catch (Exception e)
          {
            Logger.logErrorMessage(e.getMessage(), e);
            Thread.sleep(5100);
            System.out.println("Console will exit in 5 seconds");
            System.exit(1);
    }
    

    I may play with it as I have seen others wondering what error was right before shutdown.