Difference between revisions of "HowTo run NodeCore"

From VeriBlock Wiki
Jump to: navigation, search
(Update to remove testnet references and include a link to the latest nodecore version in the doc)
Line 8: Line 8:
  
 
== Overview == <!--T:3-->
 
== Overview == <!--T:3-->
NodeCore is the service that runs the VBK blockchain. It is written in Java, and runs on Windows, Linux, and mac.
+
NodeCore is the service that runs the VBK blockchain. It is written in Java, and runs on Windows, Linux, and Mac.
  
 
<!--T:4-->
 
<!--T:4-->
Line 34: Line 34:
  
 
<!--T:9-->
 
<!--T:9-->
<pre>chmod a+x nodecore</pre>
 
 
|}
 
|}
  
 
<!--T:10-->
 
<!--T:10-->
When you first run NodeCore, it will create several other files in a new testnet folder (nodecore.properties, veriblock.nodecore.log, nodecore.dat, etc...), and load the existing blockchain.
+
When you first run NodeCore, it will create several other files in a new mainnet folder (nodecore.properties, veriblock.nodecore.log, nodecore.dat, etc...), and load the existing blockchain.
  
 
<!--T:11-->
 
<!--T:11-->
NodeCore may take several minutes to load all the blocks in the blockchain. See the highest block at https://TestNet.Explore.Veriblock.org. This shows the number of blocks your local instance must load. NodeCore will create a cache file such that when you restart it they will load faster next time.
+
NodeCore may take several minutes to load all the blocks in the blockchain. See the highest block at https://explore.veriblock.org/network-stats. This shows the number of blocks your local instance must load to be in sync with the chain. NodeCore will create a cache file such that when you restart it they will load faster next time.
  
 
== FAQ == <!--T:12-->
 
== FAQ == <!--T:12-->
Line 56: Line 55:
  
 
<!--T:17-->
 
<!--T:17-->
As a mainnet, new versions of NodeCore will be released. Upgrading is relatively fast.
+
Since mainnet is now live, updating is very fast.
  
 
<!--T:18-->
 
<!--T:18-->
If you do NOT have a previous wallet/address/balance, then this is easy, just download and run the new NodeCore.
+
If you do NOT have a previous wallet/address/balance download the latest nodecore found here https://explore.veriblock.org/api/stats/download.
  
 
<!--T:19-->
 
<!--T:19-->
If you do have a wallet/address/balance that you want to carry over, this is still easy, just make sure you do the following:
+
If you do have a wallet/address/balance that you want to carry over make sure you do the following:
  
 
<!--T:20-->
 
<!--T:20-->
# Make sure you have a backup of your wallet! You could copy the mainnet folder, or use the [[NodeCore_CommandLine#importwallet]] command from the NC_CLI.
+
# Make sure you have a backup of your wallet! You can copy the mainnet folder which contains your wallet.dat, or use the [[NodeCore_CommandLine#importwallet]] command from the NC_CLI.
# Unzip NodeCore to a new folder location - do not overwrite your previous version
+
# Ensure that you unzip your newlyl downloaded NodeCore to a new folder location - do not overwrite your previous version
 
# In the new version:
 
# In the new version:
## Create a mainnet folder (probably in "nodecore-0.X.X\bin")
+
## Create a mainnet folder in most likely in the "nodecore-0.X.X/bin" directory.
## Copy in your previous wallet.dat and walletconfig.dat files into "nodecore-0.X.X\bin\mainnet".
+
## Copy in your previous wallet.dat and walletconfig.dat files into the "nodecore-0.X.X/bin/mainnet" directory.
# When you run NC_CLI getinfo on the new version, you should see your previous wallet and balance
+
# Run your new version of nodecore and start to sync.
 +
# When you run NC_CLI getinfo on the new version of the running nodecore, you should see your previous wallet and balance.
  
=== How to upgrade NodeCore PoW and keep your Bitcoin testnet wallet === <!--T:22-->
+
=== How to upgrade NodeCore PoW and keep your Bitcoin wallet === <!--T:22-->
  
 
<!--T:23-->
 
<!--T:23-->
When upgrading your PoP miner, you can copy the file "bitcoin-pop-testnet.wallet" from the bin folder of your current PoP miner directory to the bin folder of your new PoP miner.
+
When upgrading your PoP miner, you can copy the file "bitcoin-pop.wallet" from the bin folder of your current PoP miner directory to the bin folder of your new PoP miner.
  
 
=== How to specify a data directory for NodeCore === <!--T:24-->
 
=== How to specify a data directory for NodeCore === <!--T:24-->
Line 93: Line 93:
 
<!--T:28-->
 
<!--T:28-->
 
# nodecore.properties will be in ~/data/nodecore.properties
 
# nodecore.properties will be in ~/data/nodecore.properties
# /testnet folder will be in ~/data/testnet
+
# /mainnet folder will be in ~/data/mainnet
 
</pre>
 
</pre>
  
Line 106: Line 106:
 
<!--T:31-->
 
<!--T:31-->
 
# nodecore.properties will be in C:\data\nodecore.properties
 
# nodecore.properties will be in C:\data\nodecore.properties
# /testnet folder will be in C:\data\testnet
+
# /mainnet folder will be in C:\data\mainnet
 
</pre>
 
</pre>
  
 
=== How to send from a specific address? === <!--T:32-->
 
=== How to send from a specific address? === <!--T:32-->
 
+
https://wiki.veriblock.org/index.php?title=NodeCore_CommandLine#send <br />
As of NodeCore 0.3.11, the Send command now takes a from address: [[NodeCore_CommandLine#send]]
+
<pre>
 +
send <amount> <destinationAddress> [sourceAddress]
 +
</pre>
  
 
===How to set NodeCore log level===
 
===How to set NodeCore log level===

Revision as of 13:51, 12 September 2019

Other languages:

See: Main_Page, NodeCore_QuickStart, NodeCore_Operations, Nodecore.properties

Overview

NodeCore is the service that runs the VBK blockchain. It is written in Java, and runs on Windows, Linux, and Mac.

To see an operations guide for installing NodeCore, see: NodeCore_Operations

To see a quickstart to get NC running fast, see: NodeCore_QuickStart

To modify the nodecore.properties file, see: Nodecore.properties

Steps

Unzip the package:

Windows Mac and Linux
Unzip the nodecore-*.zip file In the bin folder, then run nodecore.bat Unzip to your preferred directory, then run nodecore.

Note: On Linux & Mac systems, you may need to make the nodecore shell script executable by running the following command:

When you first run NodeCore, it will create several other files in a new mainnet folder (nodecore.properties, veriblock.nodecore.log, nodecore.dat, etc...), and load the existing blockchain.

NodeCore may take several minutes to load all the blocks in the blockchain. See the highest block at https://explore.veriblock.org/network-stats. This shows the number of blocks your local instance must load to be in sync with the chain. NodeCore will create a cache file such that when you restart it they will load faster next time.

FAQ

How can block times be negative?

A negative age indicates the miner's clock was ahead.

For more background, see: https://en.bitcoin.it/wiki/Block_timestamp

How to upgrade NodeCore and keep your wallet

Since mainnet is now live, updating is very fast.

If you do NOT have a previous wallet/address/balance download the latest nodecore found here https://explore.veriblock.org/api/stats/download.

If you do have a wallet/address/balance that you want to carry over make sure you do the following:

  1. Make sure you have a backup of your wallet! You can copy the mainnet folder which contains your wallet.dat, or use the NodeCore_CommandLine#importwallet command from the NC_CLI.
  2. Ensure that you unzip your newlyl downloaded NodeCore to a new folder location - do not overwrite your previous version
  3. In the new version:
    1. Create a mainnet folder in most likely in the "nodecore-0.X.X/bin" directory.
    2. Copy in your previous wallet.dat and walletconfig.dat files into the "nodecore-0.X.X/bin/mainnet" directory.
  4. Run your new version of nodecore and start to sync.
  5. When you run NC_CLI getinfo on the new version of the running nodecore, you should see your previous wallet and balance.

How to upgrade NodeCore PoW and keep your Bitcoin wallet

When upgrading your PoP miner, you can copy the file "bitcoin-pop.wallet" from the bin folder of your current PoP miner directory to the bin folder of your new PoP miner.

How to specify a data directory for NodeCore

NodeCore can take a data directory ~d as part of the startup.

Example for Linux:

cd /<myDir>/nodecore-0.1.7/bin
./nodecore -d ~/data/ > /dev/null 2>&1 &
  1. nodecore.properties will be in ~/data/nodecore.properties
  2. /mainnet folder will be in ~/data/mainnet

Example for Windows

cd <myDir>\nodecore-0.2.1-r2\bin
nodecore.bat -d C:\data

# nodecore.properties will be in C:\data\nodecore.properties
# /mainnet folder will be in C:\data\mainnet

How to send from a specific address?

https://wiki.veriblock.org/index.php?title=NodeCore_CommandLine#send

send <amount> <destinationAddress> [sourceAddress]

How to set NodeCore log level

Currently NodeCore log level can be set through the NODECORE_LOG_LEVEL process environmental variable. Once set, NodeCore needs to be restarted.

The default is "INFO", which can create very large log files.

This impacts the "veriblock.nodecore.*.log" (which is the biggest log file). It does not affect the other, much smaller, log files.

WINDOWS

This is an example of setting it in Windows, and then starting NodeCore:

set NODECORE_LOG_LEVEL=WARN
echo %NODECORE_LOG_LEVEL%
nodecore.bat

LINUX

Run in same session, such as a screen:

export NODECORE_LOG_LEVEL=WARN
echo %NODECORE_LOG_LEVEL%
./nodecore

Troubleshooting

NodeCore is stuck on a block

Ideally this should not happen, but if it does first try restarting NodeCore.

Java out-of-memory

It is possible that you only have a 32-bit version of Java installed. 64-bit is highly recommended.

Modify the start file (nodecore.bat for windows, nodecore for linux) to increase the memory limit. Pass in a value, such as "1024 MB" into the DEFAULT_JVM_OPTS variable:

DEFAULT_JVM_OPTS=-Xmx1024m

NodeCore keeps turning off with "Application exit"

If messages like:

INFO [main] n.Program [Program.java:133] Application exit

Then something external is shutting off NodeCore (such as a server restart, external process kill, or something else).

Having trouble on a mac

On a Mac, you need to install the JDK (Java Development Kit) instead of just the JRE: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html