如何运行NodeCore

From Veriblock Wiki
Revision as of 07:16, 15 October 2018 by HakureiAnna (talk | contribs)
Jump to: navigation, search
Other languages:
English • ‎中文(中国大陆)‎

参见: Main_Page, NodeCore_Operations

概述

NodeCore是运行VBK区块链的服务。 它采用Java编写,可以在Windows,Linux和Mac上运行。

要查看安装NodeCore的操作指南,请参阅:NodeCore_Operations

步骤

解开压缩包:

Windows Mac 和 Linux
解压缩nodecore-*.zip文件到bin文件夹中,然后运行nodecore.bat 解压缩到首选目录,然后运行nodecore。

注意:在Linux和Mac系统上,您可能需要通过运行以下命令来让nodecore shell脚本可执行:

chmod a+x nodecore

当您第一次运行NodeCore时,它将在新的testnet文件夹(nodecore.properties,veriblock.nodecore.log,nodecore.dat等)中创建其他几个文件,并加载现有的区块链文件。

NodeCore可能需要几分钟才能加载区块链中的所有块。 请参阅https://TestNet.Explore.Veriblock.org上的当前最高区块。 这显示了本地NodeCore必须加载的块数。 NodeCore将创建一个缓存文件,以便在重新启动程序时,下次加载的速度更快。

FAQ

为什么区块时间的值为负?

时间为负说明矿工的时钟超前了。

有关更多背景信息,请参阅: https://en.bitcoin.it/wiki/Block_timestamp

如何在升级NodeCore的同时保留钱包

由于当前是一个测试网络,将更为频繁的发布新版本的NodeCore。 因为更新进程较快。

如果您没有以前的钱包/地址/余额,那么操作很简单,只需下载并运行新的NodeCore即可。

如果您有要继续使用的钱包/地址/余额需要迁移,这仍然很容易,只需确保执行以下操作:

  1. 确保您有钱包的备份! 您可以复制testnet文件夹,或使用NC_CLI中的NodeCore_CommandLine#importwallet命令。
  2. 将NodeCore解压缩到新的文件夹位置,请注意不要覆盖以前的版本。
  3. 在新版本中:
    1. 创建一个testnet文件夹(一般在“nodecore-0.X.X \ bin”中)
    2. 将之前的wallet.dat和walletconfig.dat文件复制到“nodecore-0.X.X\bin\testnet”中。
  4. 当您在新版本上运行NC_CLI getinfo命令时,您应该可以看到之前的钱包和余额。

Nodecore import 1.png

如何升级NodeCore PoW并保留比特币testnet钱包

升级PoP挖矿程序时,可以将文件“bitcoin-pop-testnet.wallet”从当前PoP挖矿程序目录的bin文件夹复制到新PoP挖矿程序的bin文件夹中。

如何为NodeCore指定数据目录

NodeCore可以将 数据目录 ~d 作为启动参数之一来运行。

Linux系统示例:

cd /<myDir>/nodecore-0.1.7/bin
./nodecore -d ~/data/ > /dev/null 2>&1 &

# nodecore.properties 会存在于 ~/data/nodecore.properties
# /testnet 文件夹会存在于 ~/data/testnet

Windows系统示例:

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

# nodecore.properties 位于 C:\data\nodecore.properties
# /testnet 文件夹位于 C:\data\testnet

How to send from a specific address?

As of 7/18/2018, the send command only sends from the default address, there is not a public way to select the address.

A workaround is to call the setdefaultaddress (see: NodeCore_CommandLine#setdefaultaddress )

Then 'send' will use that new address.

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