-
Notifications
You must be signed in to change notification settings - Fork 2
How to mine RNG Beta2 EN
Table of Contents
- Hardware Requirements
- Environment Configuration
- Linux
- MacOS
- Windows
- Deployment
- Run
- Request for test currency
- Create a deposit contract
- Management and Maintenance
- Recommended: 4 core CPU, 8GB RAM, 200GB storage, public IP or URL (optional)
- Minimum: 2 core CPU, 2GB RAM, 100GB diskspace, public IP or URL (optional)
Open a terminal session and execute the following command:
sudo apt install curl make g++
Open a terminal session and execute the following commands:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
After the installation is complete, enter the following commands in the terminal to check the installation results:
node -v
npm -v
sudo apt-get install git
sudo apt-get install sqlite3
sudo npm install pm2 -g
After the installation is complete, enter the following command to check if the installation was successful:
pm2 --version
Download the official Mac installation package: node-v8.15.1.pkg
After the installation is complete, enter the following command in the terminal to check the installation results:
node -v
npm -v
The system usually comes bundled with git and does not need to be installed. However, if the git command cannot be executed, please follow the system prompts to complete the installation.
Again, the system comes bundled with it, and should not need to be installed.
Execute the following command in the terminal:
sudo npm install pm2 -g
Download the official Windows installation package: node-v8.15.1-x64.msi
Download the official Windows installation package: Git
Open a PowerShell terminal as an administrator and execute the following command:
npm install --global --production windows-build-tools
This command installs Python 2.7 and Visual Studio Build Tools 2017. After the installation is successful, configure npm:
npm config set msvs_version 2017
Open the Windows Environment Variables dialog by executing the following command:
rundll32 sysdm.cpl,EditEnvironmentVariables
Add the following variable, and then add Python2.7 to the PATH variable:
- GYP_MSVS_VERSION = 2017
- Add the Python2.7 installation directory "%HOMEPATH%.windows-build-tools\python27" to the PATH variable
Visit the sqlite website: www.sqlite.org/download.html
Download the two zipped packages: sqlite-dll and sqlite-tool
Extract the two packages, as an administrator, into the "C:\WINDOWS\system32" folder.
Run "git bash" as an administrator and execute the following command:
npm install pm2 -g
The following deployments and configurations are platform independent and the same across operating systems. Windows systems can execute the commands in "git bash".
https://github.com/ringnetwork/rng-supernode
git clone https://github.com/ringnetwork/rng-supernode.git
The purpose of installing the wallet is to associate the deposit security and Coinbase addresses with the wallet address. This will facilitate the observation of mining revenue, and ensure the safety of SuperNode's funds.
- Download the wallet at https://github.com/ringnetwork/rng-wallet/releases - For now the wallet is only available for Windows. Note: When the wallet is first launched, make sure to select the full account mode so it downloads the complete ledger, otherwise it will not be able to trade.
- Follow the wallet prompts, save your mnemonic seed, as well as take note of your device address and wallet address - Where to find your Device Address: Go to the wallet main page -> Click "wallet" in the lower-right corner -> Click on the upper-right corner of the wallet page to enter the "Settings" page -> then you will find your device address.
- Enter the SuperNode directory:
cd ./rng-supernode
- Edit conf.js using your preferred editor. - Set your IP address and port to let other nodes discover you:
exports.port = xxxx;//your local open port
exports.myUrl = 'ws://IP or URL: xxxx';//your public IP or URL: your public network port
- (optional) Assign device address to exports.safe_device_address:
exports.safe_device_address = "your device address";
- (optional) Assign wallet address to exports.safe_address:
exports.safe_address = "Your App Wallet Address";
- (optional) Assign wallet address to exports.coinbase_address:
exports.coinbase_address = "your wallet address"; / / can be different from safe_address
- Note: Double quotes must be added before and after the device address
- Confirm the result of the modification
cat ./conf.js
Example of a modified conf.js:
/*jslint node: true */
"use strict";
/**
* for version control
*/
exports.clientName = 'supernode-horsen';
exports.minClientVersion = '1.1.0';
exports.WS_PROTOCOL = 'ws://';
// https://console.developers.google.com
exports.pushApiProjectNumber = 0;
exports.pushApiKey = '';
exports.port = 9193;
exports.myUrl = 'ws://119.28.213.23:9193';
exports.bServeAsHub = true;
exports.bSaveJointJson = true;
exports.bLight = false;
exports.bServeAsRpc = true;
exports.rpcInterface = '127.0.0.1';
exports.rpcPort = 6553;
exports.debug = false;
// byzantine
exports.IF_BYZANTINE = true;
// this is used by wallet vendor only, to redirect bug reports to developers' email
exports.bug_sink_email = 'admin@example.org';
exports.bugs_from_email = 'bugs@example.org';
exports.HEARTBEAT_TIMEOUT = 300*1000;
exports.initial_peers = [
"ws://119.28.44.246:9193",
];
exports.storage = 'sqlite';
exports.deviceName = 'Supernode';
exports.permanent_pairing_secret = 'randomstring';
// change the address to your own
exports.safe_address = "VWQ3WFTSUSVODREJASHZSHGWIZRUP6GV"; //Your wallet address
exports.safe_device_address = "0RSXLDX5GVTK73KXXAK4LSJWWVB72EI52"; //Your device address, found in wallet settings
exports.coinbase_address = "VWQ3WFTSUSVODREJASHZSHGWIZRUP6GV"; //Your wallet address can be different from safe_address
exports.bSingleAddress = true;
exports.THRESHOLD_DISTANCE = 6;
exports.MIN_AVAILABLE_WITNESSINGS = 100;
exports.bPostTimestamp = false;
exports.start_mining_round = 0;
exports.maxWorkderCount = 0;
exports.KEYS_FILENAME = 'keys.json';
console.log('finished witness conf');
It is recommended to install the dependencies with domestic images:
npm install
It takes about several minutes depending on the network.
Start SuperNode with pm2 and run it in the background:
pm2 start start.js --name supernode
After the startup is successful, check the running log. (For more on how to use pm2, see their quick-start guide)
pm2 logs supernode
You can see the SuperNode address in the log, such as:
...
Wed Apr 03 2019 16:00:35 GMT+0800 (CST): To release the terminal, type Ctrl-Z, then 'bg'
Wed Apr 03 2019 16:00:35 GMT+0800 (CST): my address: FAXUS4CYZNXE4EQDFOGOXT33IGHBX3SY
...
In the log, FAXUS4CYZNXE4EQDFOGOXT33IGHBX3SY is the SuperNode address. The SuperNode address can receive tokens for creating a deposit contract.
Enter your "public network IP / URL: port" in the browser. If you can see information such as "Upgrade Required" then network communication is working.
- Add WeChat: “RNG Privacy Coin Angel” and apply to join the mining discussion group.
- After joining the mining group, send your SuperNode address and myUrl to receive the test currency.
- Follow the next steps to create a deposit contract to enable mining.
- Bill the SuperNode address and wait for the SuperNode to receive the token (about 10 seconds).
- Keep the SuperNode running, open a new terminal locally on the SuperNode or create a new SSH connection to the SuperNode, and then execute the following command in the new terminal:
curl --data '{"jsonrpc":"2.0", "id":1, "method":"createMinerAddress", "params":[1000000] }' http://127.0.0.1:6553
Among them, 1000000 is the amount of the deposit contract, the value cannot be 0, and cannot be greater than the amount of money to the SuperNode address.
If the deposit contract is created successfully, it will return the following format:
{"jsonrpc":"2.0","result":"W3MMU32YURN6XISK5YADI4QQXKRH5INK","id":1}
Among them, "W3MMU32YURN6XISK5YADI4QQXKRH5INK" is the deposit contract address of the SuperNode.
After the deposit contract is successfully created, the SuperNode will start the mining process after the balance of the book is over. The prompt information and meaning are as follows:
- Start Mining -- Mining has started
- Mining Success -- Successful mining
- Coinbase Reward -- Get mining rewards If you can see the mining reward in the wallet, the SuperNode node is deployed normally.
You can pay more Tokens to the SuperNode deposit contract, reducing the PoW difficulty.
Linux:
~/.config/rng-supernode/
MacOS:
~/Library/Application Support/rng-supernode/
Windows:
%LOCALAPPDATA%\rng-supernode
Super Node data files:
- keys.json: key file containing the mnemonic of the SuperNode
- log.txt: log file for the mining program
- *.sqlite: database files
Linux:
~/.config/rng-wallet-beta2/
MacOS:
~/Library/Application Support/rng-wallet-beta2/
Windows:
%LOCALAPPDATA%\rng-wallet-beta2
Go to the SuperNode program directory and execute:
git pull
Then, update the dependency package:
npm install
In this way the conf.js file is not overwritten, and there is no need to reconfigure the SuperNode network, secure address, and Coinbase address.
Enter the data directory, open the key.json file directly with the editor of this article, or view the file in the terminal.
cat key.json
tail -f log.txt | grep connection
Example of execution results:
Mon Apr 08 2019 16:43:09 GMT+0800 (CST): 13 incoming connections,
12 outgoing connections,
0 outgoing connections being opened
For more information on SuperNode management and maintenance, see Super Node RPC.
Basics
- Home
- Getting Started
- User Documentation
- Design Discussions
- FAQ
- Code of Conduct
Contributing
Mining
Infrastructure
Exchange integrations
R&D
RingNetwork Community
RingNetwork Governance
Risk Management
Ring Network Internals
- Unit Header Data Structure
- Detailed validation logic
- P2P Protocol
Misc