How to Install
Prepare Environment and Files
Please prepare the following environment and files.
-
Server (a number of server units which will be running as a node)
Following are the recommended specifications:- CPU: 4 Core or more
- Memory: 8GB or more
- Hard Disk: 250GB or more
- Number of Nodes: 4 units or more
- The transactin will be approximately 100tx/sec with the specifications above.
-
Prepare the mijin files
The following files will be delivered from Tech Bureau, Corp..
- The folder "mijin_install_files" contains:
- serverjars ... mijin's program file
- nemesis-mijinnet.bin ... a setting file of an account which creates the initial block (uneditable)
- config-user.properties ... a setting file for each nodes (editable)
- peers-config_mijinnet.json ... a setting file to connect each nodes (editable)
- startnem.sh ... mijin's start file (uneditable)
- nemesis-accounts.txt
- An account that has been set up in the namesis-mijinnet.bin.Please make sure to take care with the information on the address, the Public Key, the Private Key.。
Setting up Server Environment
In order to start the mijin, the following setting is needed for each server.
- Create a mijin account
- Install necessary softwares (Java8, Screen)
- Set-up the port
Since the current mijin v.1 is created with the software of 'Java8', 'Java8' would be necessary to start the mijin Also, 'Screen' is used for an automatic start when rebooting the server. 7895 and 7778 are used as the defaulted ports, though other ports can be used as well. If the ports are not 7895 and 7778, please make sure to enter the port numbers in the port section in config-user.properties and peers-config_mijinnet.json which are listed later on.
About Changing Initial Account to New Account for higher security
In order to avoid letting the third party, including Tech Bureau, to know the account being set for each nodes, it may be bothering a little bit, but the followings steps are required as a safe environment. Convert it into a Private blockchain which is managed by a corporate by sending XEM to a separate account from 'Change Running Account of Node and Initial Account' while mijin is running.
The following is the overall process. The details are followed below.
- create a new account in each nodes
- send all XEM owned by the initial account to the new account
- suspend the all node except one node, and set the new account that receieves the XEM as a starting account, then reboot mijin
- wait for a day for the 'importance' to be reflected on the new accounts
- once the 'importance' has been reflected to the new account, set the new account in the rest node as a starting account
Method to Change Account
1. Generating Account
Please issue the account from the host of the running node from below. Account can be issued more than one, however, the information on the account address, the Public Key, and the Private Key will not be recorded on mijin once it is issued. So please take a note on the account information.
2. Checking Owning XEM on Initial Account
Here is to check how much XEM is owned by the initial account which is not used for mijin that is running.
3. Send XEM from Initial Account to New Account
After figuring out how much XEM is owned, it is time to send the XEM to the new account.
4. Check Transaction Record on Blockchain
Let's check that the XEM has been sent to the account, as well as check there is no balance in the initial account.
5. Edit config-user.properties
Followings are the editting sections.
// enter the Private Key of the account that receives the XEM nis.bootKey = 56f3366cce8c643cbfbd4884ad9ed231e58915e64998ed667edcaf2ad05816cd
6. Edit peers-config_mijinnet.json
Download the file from the running node, and enter the Public Key of the account that has been set for nis.bootKey to the public-key of the changing node.
{ "_info": "this file contains a list of all trusted peers and can be shared", "knownPeers": [ { "endpoint": { "host": "27.133.131.154", "port": 7895, "protocol": "http" }, "identity": { "name": "mijin01", "public-key": "442159366e13c9b899e53d4f0b64e6139910a6679fc30d6941e234de13f587e5" } } { "endpoint": { "host": "27.133.154.6", "port": 7895, "protocol": "http" }, "identity": { "name": "mijin02", "public-key": "f7321ebe78dc09dac511893984ac1e194dfcffa3c3c3224192156ee94c304780" } } . . . ] }
7. Upload the Files and Reboot mijin
Upload the following editted files and the nemesis-mijinnet.bin file to the node which will be changing the account, and then reboot the mijin.
- peers-config_mijinnet.json
- config-user.properties
- nemesis-mijinnet.bin
Following is the method to reboot.
$ ps aux | grep java
root 14925 2.0 82.3 8315404 837156 pts/2 Sl+ 18:20 4:53 java -Xms6G -Xmx6G -XX:+PrintGC -XX:+PrintGCDateStamps -Xloggc:./gc.txt -cp .:./serverjars/* org.nem.deploy.CommonStarter
root 15227 0.0 0.0 9032 660 pts/0 S+ 22:20 0:00 grep --color=auto java
in case of above, 14925 is suitable
// select the process number and suspend
$ kill -9 Process Number
// reboot mijin
$ screen -S mijin -d -m /home/mijin/startnem.sh
8. Check on mijin's Start
Check the condition on the mijin once it starts. Sometimes it may take a while (for few minutes) to re-start due to making a record on the memory to an activated address once it scans the retainling hashed database.
9. Delete Files
Create a back-up for the following files and delete them from the node on the running mijin.
- config-user.properties
- nemesis-mijinnet.bin
10. Same Process Method for other Nodes
Repeat the method from #1 to #9shown above for rest of each nodes, but please make sure to leave one of the nodes that runs initial account).
11. Check the 'importances' on the Account being Set
Here it is to check the importances (the authority to connect the blockchains) of the newly setted account. It will take a day to have the importances to be reflects after sending the XEM to the new account.
12. Transfer Rest of the Nodes to a New Account
When the 'isSet' is stated as '1' in the 'importance' of the newly setted account, set the new account in the rest node as a starting account. The method is as same as above.
Send the balance of XEM to other Accounts from the Initial Account
For the initial account that still has the balance of XEM, send all the balance to other account and make sure that there are no balance of XEM in the initial account. This will avoid a false use of the account.
- Remove all the balace of XEM in the initial account
- Check whether the transaction process has been successfully done after the switch of the account.
The following is the method.
1. Generate Receiver's Account
2. Check Balance of Sender's XEM
Here is to check the balance of XEM in the sender's account.
3. Send XEM to Created Account
4. Check Balance of XEM on Account
Check the balance of the XEM in the account to see that it has been successfully sent.
When the process above is completed, the XEM will disappear from the account of nemesis-accounts.txt which had been provided from Tech Bureau. The initial account will become just an account which cannot generate a transaction.
Revision History
- 2017年12月6日:第3版(よりセキュアに使うためにの手順変更)
- 2017年8月2日:第2版
- 2017年8月1日:初版