- NR-BLOCKCOUNTER-V3 - |
!!! - NR-BLOCKCOUNTER-V3 - !!! !!! Blockchain Update "Block Counter" - Automate the time it takes to Update your Blockchain Database !!! !!! BLOCKCOUNTER IS A "CACS" ( COPY AND CODE STRIP ) OF "GUI-RUNNER V1.1" !!! |
!!!
WHERE POSSIBLE, PLEASE USE FILE / FOLDER
NAMES THAT DON'T HAVE SPACES IN THEM
!!! REGISTRY SETTINGS LOCATION - HKEY_CURRENT_USER\Software\VB and VBA Program Settings\APP-NAME\EXE-FILENAME !!! ANY PROBLEMS RUNNING "BLOCKCOUNTER", DELETE REGISTRY KEY "AUTOLOAD_BLOCKCOUNT_FILE_TICKBOX" !!! |
!!! "BLOCKCOUNTER-V3" USES
"GUI-RUNNER" EQUIVALENT
FILE / FOLDER STRUCTURE !!! ( "\BATS" , "\BLOCKCOUNTS" ) !!! ALL REGISTRY SETTINGS SHOULD STILL BE THE SAME !!! !!! PLEASE RE-SAVE ALL ".bat" FILES AFTER YOU UPGRADE !!! !!! YOU "WILL" UPGRADE, COS "BLOCKCOUNTER-V3" IS FAR SUPERIOR TO "BLOCKCOUNTER-V2" !!! :) !!! UPGRADE IS SIMPLE - JUST COPY / REPLACE ALL EXISTING "BLOCKCOUNTER.exe" FILES WITH COPIES OF THIS ONE !!! :) ALL "BLOCKCOUNTER.exe" FILES CAN NOW BE RUN FROM THE SAME "HOME FOLDER", AND ALL USE THE SAME FOLDERS CREATED BY THE FIRST FULLY CONFIGURED "BLOCKCOUNTER.exe" !!! !!! SORRY FOR ANY INCONVENIENCE !!! !!! |
!!! - BLOCKCOUNTER-V3 - WHAT YOU GET - !!! I left the following "NR"-"App Code", ALREADY coded in "GUI-RUNNER", in "BLOCKCOUNTER-V3" :- "BLOCKCOUNTER-V3", "obviously", cos that's where "V3" was originally "created", if you didn't already know... !!! :) "UPTIME-TIMER", "MULTI-PROCESS-WATCHER", "KITT HEARTBEAT", "NCS-LIGHTS". !!! ALL BLOCKCOUNTER "STATUS" MESSAGES WERE ALSO LEFT "CODED-IN" !!! :) |
Designed to be run AFTER a Crypto QT / DAEMON is started, and BEFORE the Crypto QT / DAEMON is stopped. BLOCKCOUNTER saves the GETBLOCKCOUNT run command to a .BAT file which is generated using the Crypto Settings Window. The .BAT file is run on a user specified time interval loop to get the "Latest Block Count" output number, and write that number to a text file. The text file is loaded into the "Current Block Number" textbox in BLOCKCOUNTER, and compared to the number in the "Last Known Block Number" textbox. If this number is NOT identical, the "Last Known Block Number" textbox is updated with the "Current Block Number", GETBLOCKCOUNT is run again after the user specified time interval is reached, and the process repeats again...
There are 4 possible ends to this process: 1 - The GETBLOCKCOUNT loop continues until the block numbers are identical, and BLOCKCOUNTER auto-closes. 2 - The time set in the "OVERRIDE TIMER" reaches "00:00:00" and BLOCKCOUNTER auto-closes. 3 - The user stops the process using the "STOP" buttons. 4 - The GETBLOCKCOUNT loop continues forever...
If BLOCKCOUNTER is run using "NR-MULTILOADER", or "NODE-RUNNER.BAT" or an equivalent .BAT execution process, then the closing of BLOCKCOUNTER could then start the execution of a "CLI RPC STOP" command to shutdown the QT / DAEMON. "NR-BLOCKCOUNTER-V3.exe" can be copied and renamed to as many new files as required as all settings are saved separately in the Local Windows Registry. !!! THERE IS NO INBUILT FUNCTIONALITY TO START OR STOP THE CRYPTO QT / DAEMON, OR TO INTERACT WITH ANY WALLETS !!! |
BLOCKCOUNTER was originally designed to run the GETBLOCKCOUNT command "internally", which worked when the app was run as a standalone, but when BLOCKCOUNTER was run using NODE-RUNNER.BAT, the output from the GETBLOCKCOUNT command run by BLOCKCOUNTER interfered with the NODE-RUNNER.BAT output window and execution processing. I may "fix" this properly in the future, if I can figure out a better solution than using a .BAT file... suggestions welcome :) !!! Using a .BAT file to execute the GETBLOCKCOUNT command from BLOCKCOUNTER is my current "fix" to this problem !!! |
!!! BLOCKCOUNTER - "GETBLOCKCOUNT" - WHAT YOU NEED TO KNOW !!! The "GETBLOCKCOUNT" command displays the "Current Block Number". !!! WHEN OUTPUTTING THE BLOCK NUMBER TO A ".txt" FILE, A "CARRIAGE RETURN" / "END OF LINE, NEW LINE NEXT" CHARACTER IS ALSO OUTPUTTED !!! This means that when the "Current Block Number" is compared to the "Last Known Block Number", both automatically also have that character at the end aswell, by default. !!! THIS IS WHAT ORIGINALLY STOPPED "BLOCKCOUNTER V1 & V2" WORKING CORRECTLY AT "0" / "ZERO" BLOCKS... (sorry...) !!! !!! COMPARING "0 " AGAINST "0" FOR IDENTICAL DOESN'T WORK !!! !!! "BLOCKCOUNTER V3" NOW COMPARES "0" / "ZERO" BLOCK NUMBERS CORRECTLY !!! !!! GUI-RUNNER CAN BE USED TO COMPLETELY UPDATE A BLOCKCHAIN FROM "0" / "ZERO" BLOCKS TO THE LATEST BLOCK WITH NO PROBLEMS !!! |
!!! "BLOCKCOUNTER" - OVERRIDE TIMER - STOPS A "FOREVER LOOP" - EVERYTHING THERE FOR A REASON !!! :) |
TEXTBOX COLOURS (ForeColor / BackColor ) |
BLOCKCOUNTER V3 - RUN ORDER: NORMAL "RUN FUNCTIONALITY" |
BLOCKCOUNTER V3 - RUN ORDER: IDENTICAL BLOCK NUMBERS - !!! "TRIPLE-CHECK-TECH" !!! :) |
|
GREEN / BLACK THEN BLACK / CYAN |
COUNTDOWN TIMER |
Activates at "00:00:00" - Then checks if QT / DAEMON Process is
running. If process is running, starts AUTO-GETBLOCKCOUNT. !!! SEE FURTHER INFO BELOW !!! |
|
BLACK / YELLOW | AUTO-GETBLOCKCOUNT TIMER | Runs "C:\NODE-RUNNER-ROOT\GUI-RUNNER\BATS\APP-EXE-NAME-RUN-BLOCKCOUNTER-GBC.bat", then starts CLI PROCESS WATCHER TIMER. | |
BLACK
/ RED OR GREEN / BLACK |
CLI PROCESS WATCHER TIMER | Checks if "CLI"Process is still running - loops / waits until Process ISN'T running before continuing to start BLOCKCOUNT TEXTBOX UPDATER TIMER. | |
BLACK / PURPLE | BLOCKCOUNT TEXTBOX UPDATE TIMER | Reads CLI "GETBLOCKCOUNT" Output text from file - "\BLOCKCOUNTS\APP-EXE-NAME-LATEST-BLOCKCOUNT.LOG" And imports into "CURRENT BLOCK NUMBER" Textbox, then starts ZERO / EMPTY TEXTBOX CHECKER TIMER. | |
YELLOW / BLACK OR GREEN / BLACK |
ZERO / EMPTY TEXTBOX CHECKER TIMER | Checks the "CURRENT BLOCK NUMBER" isn't "0" or "" - If it is, loop back to COUNTDOWN TIMER and start again - Otherwise, start IDENTICAL CHECKER TIMER. | |
BLACK
/ CYAN OR GREEN / BLACK |
IDENTICAL CHECKER TIMER | If
"IDENTICAL" Textbox is "GREEN", do nothing. Else / Otherwise:- 1) - "HIDDEN BLOCK VERIFIER" Textbox is updated with "LAST KNOWN BLOCK NUMBER". 2) - "HIDDEN TRIPLE-CHECK" Textbox is updated with "LAST KNOWN BLOCK NUMBER". |
|
If the "CURRENT BLOCK NUMBER" is DIFFERENT to the "LAST KNOWN BLOCK NUMBER", then update the "LAST KNOW BLOCK NUMBER" with the "CURRENT BLOCK NUMBER", and loop back to COUNTDOWN TIMER and start again... | RUN 1) - If the "CURRENT BLOCK NUMBER" is the SAME as the "LAST KNOWN BLOCK NUMBER", then make "IDENTICAL" Textbox "GREEN", and start CHECKER TIMER. | ||
RUN 2) - If the "CURRENT BLOCK NUMBER" is the SAME as the "LAST KNOWN BLOCK NUMBER", start CHECKER TIMER. | |||
RUN 3) - If the "CURRENT BLOCK NUMBER" is the SAME as the "LAST KNOWN BLOCK NUMBER", start CHECKER TIMER. | |||
NONE OR GREEN / BLACK |
CHECKER TIMER | !!! NOTE - THERE IS A 3 SECOND DELAY BEFORE THIS TIMER STARTS !!! | RUN 1) - If "IDENTICAL" Textbox is "GREEN, make "VERIFYING" Textbox "PURPLE", and loop back to AUTO-GETBLOCKCOUNT TIMER. |
RUN 2) - If "VERIFYING" Textbox is "PURPLE", start VERIFY TIMER. | |||
RUN 3) - If "TRIPLE-CHECK" Textbox is "PURPLE" start TRIPLE-CHECK TIMER. | |||
BLACK / YELLOW OR GREEN / BLACK |
VERIFY TIMER | RUN 2) - If the "CURRENT BLOCK NUMBER" is the SAME as the "HIDDEN BLOCK VERIFIER" Textbox, then make "VERIFYING" Textbox "GREEN", make "TRIPLE-CHECK" Textbox "PURPLE" and loop back to AUTO-GETBLOCKCOUNT TIMER. | |
BLACK / GREEN OR GREEN / BLACK |
TRIPLE-CHECK TIMER | RUN 3) - If the "CURRENT BLOCK NUMBER" is the SAME as the "HIDDEN TRIPLE-CHECK" Textbox, then make "TRIPLE-CHECK" Textbox "GREEN", make "CONFIRMED" Textbox "GREEN" and start COMPLETED TIMER. | |
NONE | COMPLETED TIMER | If
"FINISHED WHEN IDENTICAL" Tickbox is ticked, make "TASK 8" and "TASK
9 " LIGHTS "GREEN" and MULTILOADER CONTINUES !!! If "FINISHED WHEN IDENTICAL" Tickbox ISN'T ticked, loop back to COUNTDOWN TIMER and start again, FOREVER... !!! :) |
|
NONE | OVERRIDE TIMER | ACTIVATES AT SOME POINT IF USER CONFIGURED... !!! :) | ACTIVATES AT SOME POINT IF USER CONFIGURED... !!! :) |
!!! IF ANY BLOCK NUMBER COMPARE FAILS, ALL 4 BLOCKCOUNTER "TRIPLE-CHECK-TECH" LIGHTS TURN BACK TO WHITE, AND COUNTDOWN TIMER STARTS AGAIN... !!! :) |
!!! "STANDALONE" BLOCKCOUNTER Vs "GUI-RUNNER" BLOCKCOUNTER !!! Both versions have "Process Watching" functionality to monitor the QT / DAEMON / CLI Processes. GUI-RUNNER is coded to ONLY run "internal" BLOCKCOUNTER IF QT / DAEMON Processes are RUNNING. THIS CHECK HAPPENS WHEN THE "Next Run" COUNTDOWN TIMER IS ACTIVATED AT "00:00:00" "Standalone" BLOCKCOUNTER is coded to check if QT / DAEMON Processes are RUNNING, BUT to also check if "Use Process Monitoring" Tickbox is ticked. UNTICKING "Use Process Monitoring" allows BLOCKCOUNTER to be run AGAINST A REMOTE NODE - Windows, LINUX, MAC, whatever - As long as "Networking" works, and the Remote Node is running QT / DAEMON, it should work... !!! MAKE SURE TO SPECIFY "connect=" IN THE CLI "CRYPTO-CONF.conf" FILE, AND "CLI" SHOULD WORK !!! I'm sure there used to be an "rpcconnect=" aswell, but I checked, and it doesn't seem to be listed anymore... !!! CURRENTLY UNTESTED BY ME, BUT LIKE I SAID, IT SHOULD WORK... !!! !!! UNTICKING "Use Process Monitoring" MEANS BLOCKCOUNTER WILL STILL RUN "CLI GETBLOCKCOUNT" EVEN IF QT / DAEMON ISN'T RUNNING !!! |