Skip to content

Master Node Installation

Lotus Mile edited this page Nov 29, 2018 · 12 revisions

OS Supported

  • Linux Centos 7.x

System Requirements

Minimum

  • 2 GB RAM
  • 1 CPU core
  • 60GB HDD

Recommended

  • 8 GB RAM
  • 8 CPU cores
  • 512GB SDD

Installation from rpm files

Install Node

$ rpm -ivh https://github.com/mile-core/mile-files/blob/master/mile-0.4x-46.x86_64.rpm?raw=true # install binaries 
$ rpm -qi mile # check installations

Install Mile Shell

$ rpm -ivh https://github.com/mile-core/mile-files/blob/master/mileshell-0.4x-1.x86_64.rpm?raw=true
$ rpm -qi mileshell 

Uninstall rpm

Uninstall Mile Node

$ rpm -e mile

Uninstall Mile Shell

$ rpm -e mileshell

Update Mile Node and Shell from RPM

$ rpm -Uvh https://github.com/mile-core/mile-files/blob/master/mile-0.4x-46.x86_64.rpm?raw=true
$ rpm -Uvh https://github.com/mile-core/mile-files/blob/master/mileshell-0.4x-1.x86_64.rpm?raw=true

Configure YUM

Add yum repo

$ vi /etc/yum.repos.d/mile.repo 

Copy and paste to mile.repo file

[mile]
name=Mile Unity Foundation
gpgcheck = 0
enabled=1 
baseurl=https://repo.mile.global/mainnet/

Run yum install

$ yum install mile
$ yum install mileshell

Downloads only

Node rpm file

$ wget -O mile-0.4x-46.x86_64.rpm https://github.com/mile-core/mile-files/blob/master/mile-0.4x-46.x86_64.rpm?raw=true

Shell rpm file

$ wget -O mileshell-0.4x-1.x86_64.rpm https://github.com/mile-core/mile-files/blob/master/mileshell-0.4x-1.x86_64.rpm?raw=true

Join Mile Testnet

Download testnet genesis block

$ wget -O genesis_block_testnet.txt https://github.com/mile-core/mile-files/blob/master/genesis_block_testnet.txt?raw=true 

Replace genesis block

$ cp ./genesis_block_testnet.txt  /etc/mile/genesis_block.txt

Note: Mainnet Genesis block is already included in rpm package above

Launching your own Mile Node

Start Node

$ systemctl start mile

Check Status

$ systemctl status mile

Stop

$ systemctl stop mile

Manage Node by Mile Shell

Start shell on Node host

$ shell.chaos 

Start shell on remote mode

$ shell.chaos -i your.node.address 

Shell commands

Blockchain info
Project name              : "Mile"
Version                   : "1"
Base assets               : "10000.00000"
Supported transaction     : "RegisterNodeTransactionWithAmount, UnregisterNodeTransaction, TransferAssetsTransaction, CreateTokenRateVoting, PostTokenRate, GetTokenRate, EmissionTransaction, UpdateEmission"
Supported assets          : "xdr tokens, mile tokens"

[chaos@mile]> 
[chaos@mile]> help
| N: | Section name:        | Content:                         |
|----+----------------------+----------------------------------|
|  0 | settings             | Settings for shell               |
|  1 | node wallet          | Settings for node wallet         |
|  2 | local wallet         | Settings for local wallet        |
|  3 | blockchain           | Blockchain operations            |
|  4 | transaction          | Binary transaction               |
|----+----------------------+----------------------------------|

Type 'help <N>' or 'help <Section name>' to see commands
OK
[chaos@mile]> 

Exit from Mile Shell

[chaos@mile]> exit

Create Wallet Ciphered Container

[chaos@mile]> create local wallet <name-of-your-node-wallet> password <strong-password-phrase>

Copy Ciphered Container file to Node host

$ scp ./wallets/<name-of-your-node-wallet>.* root@<your.node.ip.address>:/etc/mile/wallets/
$ ssh root@<your.node.ip.address>
# vi /etc/mile/mile.xml 

Replace mileglobal <NodeWalletPassword>mileglobal</NodeWalletPassword> on your <strong-password-phrase>

Add your existing wallet to local wallet db

[chaos@mile]> create local wallet from keys <name-of-your-existing-wallet> public key <public_key> private key <private_key> [password <strong-password-phrase>]

Transfer XDR or MILE from your existing wallet to Node wallet

[chaos@mile]> transfer asset transaction mile from local <name-of-your-existing-wallet> to <node_wallet_public_address> amount 10000.00000  [password <strong-password-phrase>]

Make Emission if you have no XDR but you have MILE

[chaos@mile]> emission transaction xdr node <name-of-your-node-wallet> password <strong-password-phrase>

Register Master Node

[chaos@mile]> register node with amount transaction local wallet <name-of-your-node-wallet> address <your.node.ip.address> amount 10000.00 password <strong-password-phrase>

Where amount must be greater or equal then 10000XDR and less or equal 100000XDR.

Check Wallet state

[chaos@mile]> get local wallet state <name-of-your-node-wallet>
Wallet                  : "master-node000"
xdr                     : "<your node XDR balance>"
mile                    : "<your node MILE balance>"
Tags                    : "Node"
Node address            : "<your.node.ip.address>"
Last transaction id     : "xxxxx"
Is transactions exist   : "yes"
Freeze mile             : "0"
OK

where Tags must be "Node".

Now deposit on the wallet locked in XDR and the node has become a Master Node.

Download and compile cli wallet to manage your wallet and node wallet state supported also Ubuntu and OSX

$ ./mile_cli_wallet --help
Allowed options:
  --help                                produce help message
  --debug                               print debug messages
  -w [ --wallet ] arg                   create wallet from random (-w "random")
                                        or secret phrase
  -u [ --url ] arg (=http://lotus000.testnet.mile.global/v1/api)
                                        RPC url
  -m [ --method ] arg                   blockchain command
  -p [ --params ] arg (={})             blockchain params
  -r [ --reconnections ] arg (=3)       try to connect again reconnection times
                                        if any connection error occurred

Methods: 
	get-blockchain-info 
	get-blockchain-state 
	get-network-state 
	get-nodes 
	get-current-block-id 
	get-block --params '{"id":1}'
	get-wallet-state --params '{"public-key": "...bHqSm8WTuY3gB9UXD..."}' 
	get-wallet-transactions --params '{"public-key": "...bHqSm8WTuY3gB9UXD..."}' 
	send-transfer --params '{"private-key": "...bHqSm8WTuY3gB9UXD...", "to":"...pXg1MF4qxZTEsL..", "amount": "100", "asset-code":0, "description":"send my money back!"}' 
	send-emission --params '{"private-key": "...bHqSm8WTuY3gB9UXD...", "asset-code":0}'
	register-node --params '{"private-key": "...bHqSm8WTuY3gB9UXD....", "amount": 10000.00, "address": "xxx.yyy.zzz.www"}'
	unregister-node --params '{"private-key": "...bHqSm8WTuY3gB9UXD...."}'
	vote-for-rate -p '{"private-key": "...bHqSm8WTuY3gB9UXD....", "amount": 1.21}'

Register Master Node

To start XDR minting on your wallet you must create .wallet file with private and public key.

Create wallet file contains private and public keys

$ mile_cli_wallet -o -w random > ./<name-of-your-wallet>.wallet

Then copy this file on node host

$ scp ./node.wallet root@<your.node.address>:/etc/mile/wallets/

The minimum deposit amount on the wallet should be at least 10.000 XDR.

Make an emission center

To issue the XDRs you have to have some MILE coins. You can buy MILE at the open market. Also you can manage transfers with MILE Wallet. Then you should make emission of XDR (lock MILE) with amount what you intend to lock on your node. $ mile_cli_wallet -u https://lotus000.i.mile.global/v1/api -m send-emission -p '{"private-key": "the private key of your node wallet", "asset-code":10000}'

Check the wallet state

$ mile_cli_wallet -u https://lotus000.i.mile.global/v1/api -m get-wallet-state -p '{"public-key": "the public key of your node wallet"}' 

Also you can check the wallet state on MILE Wallet or Mile Explorer. Transaction can be rejected by blockchain. The current version of the cli wallet does not support transaction completions, so if state of your node wallet is not changed during next 3 blocks you should repeat this operation.

Register Master Node Completion

$ ./mile_cli_wallet -u https://lotus000.i.mile.global/v1/api -m register-node -p '{"private-key": "the private key of your node wallet", "amount": 10000, "address":"your.node.ip.address"}'

Then you should check your node wallet state to make sure your node is still a Master Node of MILE blockchain.

Checking Node state

$ mile_cli_wallet -u https://lotus000.i.mile.global/v1/api -m get-wallet-state -p '{"public-key": "the public key of your node wallet"}' 

Response looks like this:

{"address":"your.node.ip.address","balance":[{"amount":"....","code":"0"},{"amount":".....","code":"1"}],"exist":"1","preferred-transaction-id":"981444529","tags":["Node"]}, where tags must contain "Node" world.

Safe trip!

Clone this wiki locally