Difference between revisions of "HowTo run NodeCore/zh-cn"

From Veriblock Wiki
Jump to: navigation, search
(Created page with "要查看安装NodeCore的操作指南,请参阅:NodeCore_Operations")
(Updating to match new version of source page)
 
(46 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
<languages/>
 
<languages/>
 +
<div class="mw-translate-fuzzy">
 
参见: [[Main_Page]], [[NodeCore_Operations]]
 
参见: [[Main_Page]], [[NodeCore_Operations]]
 +
</div>
  
 
__TOC__
 
__TOC__
  
 +
<div class="mw-translate-fuzzy">
 
==概述==
 
==概述==
 
NodeCore是运行VBK区块链的服务。 它采用Java编写,可以在Windows,Linux和Mac上运行。
 
NodeCore是运行VBK区块链的服务。 它采用Java编写,可以在Windows,Linux和Mac上运行。
 +
</div>
  
 
要查看安装NodeCore的操作指南,请参阅:[[NodeCore_Operations]]
 
要查看安装NodeCore的操作指南,请参阅:[[NodeCore_Operations]]
  
== Steps ==
+
To see a quickstart to get NC running fast, see: [[NodeCore_QuickStart]]
  
Unzip the package:
+
To modify the nodecore.properties file, see: [[Nodecore.properties]]
 +
 
 +
== 步骤 ==
 +
 
 +
解开压缩包:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! Windows
 
! Windows
! Mac and Linux
+
! Mac Linux
 
|-
 
|-
| Unzip the nodecore-*.zip file In the bin folder, then run nodecore.bat
+
| 解压缩nodecore-*.zip文件到bin文件夹中,然后运行nodecore.bat
| Unzip to your preferred directory, then run nodecore.
+
| 解压缩到首选目录,然后运行nodecore。
  
Note: On Linux & Mac systems, you may need to make the nodecore shell script executable by running the following command:
+
注意:在Linux和Mac系统上,您可能需要通过运行以下命令来让nodecore shell脚本可执行:
  
 +
<div class="mw-translate-fuzzy">
 
<pre>chmod a+x nodecore</pre>
 
<pre>chmod a+x nodecore</pre>
 
|}
 
|}
 +
</div>
  
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.
+
<div class="mw-translate-fuzzy">
 +
当您第一次运行NodeCore时,它将在新的testnet文件夹(nodecore.properties,veriblock.nodecore.log,nodecore.dat等)中创建其他几个文件,并加载现有的区块链文件。
 +
</div>
  
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.
+
<div class="mw-translate-fuzzy">
 +
NodeCore可能需要几分钟才能加载区块链中的所有块。 请参阅https://TestNet.Explore.Veriblock.org上的当前最高区块。 这显示了本地NodeCore必须加载的块数。 NodeCore将创建一个缓存文件,以便在重新启动程序时,下次加载的速度更快。
 +
</div>
  
 
== FAQ ==
 
== 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 ===
+
有关更多背景信息,请参阅: https://en.bitcoin.it/wiki/Block_timestamp
  
As a testnet, new versions of NodeCore will be released. Upgrading is relatively fast.
+
===如何在升级NodeCore的同时保留钱包===
  
If you do NOT have a previous wallet/address/balance, then this is easy, just download and run the new NodeCore.
+
<div class="mw-translate-fuzzy">
 +
由于当前正处于测试网络之中,将相比平时更为频繁的发布新版本的NodeCore;因为组件的更新进程会较快。
 +
</div>
  
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:
+
<div class="mw-translate-fuzzy">
 +
如果您没有以前的钱包/地址/余额,那么操作很简单,只需下载并运行新的NodeCore即可。
 +
</div>
  
# Make sure you have a backup of your wallet! You could copy the testnet folder, or use the [[NodeCore_CommandLine#importwallet]] command from the NC_CLI.
+
<div class="mw-translate-fuzzy">
# Unzip NodeCore to a new folder location - do not overwrite your previous version
+
如果您有要继续使用的钱包/地址/余额需要迁移,这仍然很容易,只需确保执行以下操作:
# In the new version:
+
</div>
## Create a testnet folder (probably in "nodecore-0.X.X\bin")
 
## Copy in your previous wallet.dat and walletconfig.dat files into "nodecore-0.X.X\bin\testnet".
 
# When you run NC_CLI getinfo on the new version, you should see your previous wallet and balance
 
  
[[File:Nodecore_import_1.png|400px]]
+
<div class="mw-translate-fuzzy">
 +
#确保您有钱包的备份! 您可以复制testnet文件夹,或使用NC_CLI中的[[NodeCore_CommandLine#importwallet]]命令。
 +
#将NodeCore解压缩到新的文件夹位置,请注意不要覆盖以前的版本。
 +
#在新版本中:
 +
##创建一个testnet文件夹(一般在“nodecore-0.X.X \ bin”中)
 +
##将之前的wallet.dat和walletconfig.dat文件复制到“nodecore-0.X.X\bin\testnet”中。
 +
#当您在新版本上运行NC_CLI getinfo命令时,您应该可以看到之前的钱包和余额。
 +
</div>
  
=== How to upgrade NodeCore PoW and keep your Bitcoin testnet wallet ===
+
<div class="mw-translate-fuzzy">
 +
===如何升级NodeCore PoW并保留比特币testnet钱包===
 +
</div>
  
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.
+
<div class="mw-translate-fuzzy">
 +
升级PoP挖矿程序时,可以将文件“bitcoin-pop-testnet.wallet”从当前PoP挖矿程序目录的bin文件夹复制到新PoP挖矿程序的bin文件夹中。
 +
</div>
  
=== How to specify a data directory for NodeCore ===
+
===如何为NodeCore指定数据目录===
  
NodeCore can take a data directory ~d as part of the startup.
+
NodeCore可以将 数据目录 ~d 作为启动参数之一来运行。
  
Example for Linux:
+
Linux系统示例:
  
 
<pre>
 
<pre>
 
cd /<myDir>/nodecore-0.1.7/bin
 
cd /<myDir>/nodecore-0.1.7/bin
 
./nodecore -d ~/data/ > /dev/null 2>&1 &
 
./nodecore -d ~/data/ > /dev/null 2>&1 &
</pre>
 
  
# nodecore.properties will be in ~/data/nodecore.properties
+
<div class="mw-translate-fuzzy">
# /testnet folder will be in ~/data/testnet
+
 
 +
# nodecore.properties 位于 ~/data/nodecore.properties
 +
# /testnet 文件夹位于 ~/data/testnet
 
</pre>
 
</pre>
 +
</div>
  
Example for Windows
+
Windows系统示例:
  
 
<pre>
 
<pre>
Line 79: Line 105:
 
nodecore.bat -d C:\data
 
nodecore.bat -d C:\data
  
# nodecore.properties will be in C:\data\nodecore.properties
+
<div class="mw-translate-fuzzy">
# /testnet folder will be in C:\data\testnet
+
# nodecore.properties 位于 C:\data\nodecore.properties
 +
# /testnet 文件夹位于 C:\data\testnet
 
</pre>
 
</pre>
 +
</div>
 +
 +
<div class="mw-translate-fuzzy">
 +
=== 如何从特定地址发送余额? ===
 +
</div>
 +
 +
===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:
  
=== How to send from a specific address? ===
+
<pre>
 +
set NODECORE_LOG_LEVEL=WARN
 +
echo %NODECORE_LOG_LEVEL%
 +
nodecore.bat
 +
</pre>
  
As of 7/18/2018, the send command only sends from the default address, there is not a public way to select the address.
+
LINUX
  
A workaround is to call the setdefaultaddress (see: [[NodeCore_CommandLine#setdefaultaddress]] )
+
Run in same session, such as a screen:
  
Then 'send' will use that new address.
+
<pre>
 +
export NODECORE_LOG_LEVEL=WARN
 +
echo $NODECORE_LOG_LEVEL
 +
./nodecore
 +
</pre>
  
== Troubleshooting ==
+
== 故障排除 ==
  
=== NodeCore is stuck on a block ===
+
=== NodeCore同步到某个块时卡住 ===
  
Ideally this should not happen, but if it does first try restarting NodeCore.
+
理想情况下这不太可能会发生。但如果发生了这样的情况,首先应当尝试重新启动NodeCore。
  
=== Java out-of-memory ===
+
=== Java内存不足 ===
  
It is possible that you only have a 32-bit version of Java installed. 64-bit is highly recommended.
+
您安装的可能是32位版本的Java。 强烈建议使用64位的Java来避免这个问题。
  
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:
+
修改启动文件(windows的nodecore.bat,linux的nodecore)以增加内存限制。 将一个更大的值(例如“1024 MB”)写入DEFAULT_JVM_OPTS变量:
  
 
<pre>
 
<pre>
Line 107: Line 159:
 
</pre>
 
</pre>
  
=== NodeCore keeps turning off with "Application exit"  ===
+
=== NodeCore一直显示“应用程序退出”的提示并自动关闭 ===
  
If messages like:
+
如果消息像是这样:
 
<pre>
 
<pre>
 
INFO [main] n.Program [Program.java:133] Application exit
 
INFO [main] n.Program [Program.java:133] Application exit
 
</pre>
 
</pre>
  
Then something external is shutting off NodeCore (such as a server restart, external process kill, or something else).
+
这意味着外部的因素正在关闭NodeCore(例如服务器重启,外部进程终止或其他)。
  
=== Having trouble on a mac ===
+
===在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
+
在Mac上,您需要安装JDK(Java开发工具包)而不仅仅是JRE才能运行软件:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Latest revision as of 14:09, 8 January 2020

Other languages:
English • ‎中文(中国大陆)‎

概述

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

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

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

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

步骤

解开压缩包:

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 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 &

<div class="mw-translate-fuzzy">

# nodecore.properties 位于 ~/data/nodecore.properties
# /testnet 文件夹位于 ~/data/testnet

Windows系统示例:

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

<div class="mw-translate-fuzzy">
# nodecore.properties 位于 C:\data\nodecore.properties
# /testnet 文件夹位于 C:\data\testnet

如何从特定地址发送余额?

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

故障排除

NodeCore同步到某个块时卡住

理想情况下这不太可能会发生。但如果发生了这样的情况,首先应当尝试重新启动NodeCore。

Java内存不足

您安装的可能是32位版本的Java。 强烈建议使用64位的Java来避免这个问题。

修改启动文件(windows的nodecore.bat,linux的nodecore)以增加内存限制。 将一个更大的值(例如“1024 MB”)写入DEFAULT_JVM_OPTS变量:

DEFAULT_JVM_OPTS=-Xmx1024m

NodeCore一直显示“应用程序退出”的提示并自动关闭

如果消息像是这样:

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

这意味着外部的因素正在关闭NodeCore(例如服务器重启,外部进程终止或其他)。

在mac上遇到问题

在Mac上,您需要安装JDK(Java开发工具包)而不仅仅是JRE才能运行软件:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html