How to set up ec2 t1.micro Ubuntu for Masternode part 2/3 -2

chaeplin

Active Member
Core Developer
Mar 29, 2014
749
356
133
* Use this guide only for EC2 instance with Security-Group
* Using this guide on non-EC2 instances is very dangerous ( Especially iptables )


* This guide is valid for RC3(local/remote setup)
* local is home linux cold wallet holding 1K DRK
* remote is server with empty wallet


I. Part 1/3 EC2 Setup
https://darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-1-3.240/

II. Part 2/3 AMI Setup
https://darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-2-3.241/
https://darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-2-3-2.1754/

III. Part 3/3 Masternode update
https://darkcointalk.org/threads/how-to-set-up-ec2-t1-micro-ubuntu-for-masternode-part-3-3.262/


* cat >> blabla << EOF blablabla EOF things are removed.
* This guide is valid for RC3(local/remote setup)
* local is home linux cold wallet holding 1K DRK(With private ip address)
* remote is server with empty wallet
* You can use darkcoind or darkcoind-qt

* if public ip of remote is changed, change masternodeprivkey
* if you see log like "(ip_yours) dropped (banned)", restart darkcoind


* brief steps
- setup ami to compile normal darkcoind
- compile darkcoind and run, sync
- make an encrypted wallet holding 1000 DRK using home pc
- download RC darksend
- replace darkcoind


Part II

###### USING LOCAL LINUX MACHINE
12. Install linux, Update, add iptables, remove command history
13. make 1000 DRK encryped wallet.dat
* install new wallet
* do sync
* check account address 0 / getaccountaddress 0
* https://www.darkcointalk.org/thread...ternode-requirements-masternode-payments.225/
* send 1000 DRK to that address
* encypt wallet
* backup wallet

* iptables rule and darkcoin.conf for local linux machine
* local machine will not open any port to outside except ssh to local private network.
* local darkcoind will not listen port 9999
Code:
#-----
*filter
:INPUT ACCEPT [1038:145425]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [434:87191]
#
-A INPUT -i lo -j ACCEPT
#
-A INPUT -p tcp -m tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -j DROP
#
COMMIT
#-----
Code:
#
rpcuser=any_user_name_you_want_you_should_change_this
rpcpassword=any_password_you_like_name_you_want_you_should_change_this
rpcallowip=127.0.0.1
listen=0
server=1
daemon=1
logtimestamps=1
addnode=23.23.186.131
#
###### USING LOCAL LINUX MACHINE
14. If local wallet is stable version, download rc binary for Masternode, run
15. Make masternodeprivkey
Code:
darkcoind masternode genkey
this_command_emit_long_long_keyphrase_and_is_used_in_local_remote_setup

###### USING LOCAL LINUX MACHINE
16. add more conf to darkcoin.conf
Code:
#
addnode=23.23.186.131
masternode=1
masternodeprivkey=this_command_emit_long_long_keyphrase_and_is_used_in_local_remote_setup
masternodeaddr=change_this_to_your_ec2_public_ip_ami_public_ip:9999
#

##### Using remote machine
17. download RC Masternode / ubuntu user
Visit https://www.darkcoin.io/getstarted.html
Download latest vesrion of Masternode(Currentely RC version)
Or visit https://github.com/darkcoinproject/darkcoin-binaries/tree/master/rc

Code:
cd ~/.darkcoin
wget https://github.com/darkcoinproject/darkcoin-binaries/raw/master/rc/darkcoin-0.10.11.6-linux.tar.gz
tar xfvz darkcoin-0.10.11.6-linux.tar.gz
cp darkcoin-0.10.11.6-linux/bin/64/darkcoind .
ls -la
darkcoind stop
18. change darkcoind link
* you can place darkcoind to /usr/bin/ :
Code:
 sudo cp darkcoind /usr/bin/
* if darkcoind is placed in /usr/bin/ , step 18 is not needed.

Code:
sudo su -
cd /usr/bin
mv darkcoind darkcoind.old
ln -s ~ubuntu/.darkcoin/darkcoind .
logout
19. edit darkcoin.conf
Code:
cd ~/.darkcoin
* if you have skipped previous compile step 9, 10, 11, read step 11, and make ~/.darkcoin/darkcoin.conf
* add lines to ~/.darkcoin/darkcoin.conf
* masternodeprivkey is copied from local machine
Code:
#------------
masternode=1
masternodeprivkey=this_command_emit_long_long_keyphrase_and_is_used_in_local_remote_setup
addnode=23.23.186.131
#----------
run darkcoind
Code:
darkcoind
#### LOCAL and REMOTE
20. as RC1 ~ require passphrase
Code:
cd ~/
ln -sf /dev/null .bash_history
###### USING LOCAL LINUX MACHINE
21. stop darkcoind and run again
Code:
darkcoind stop
darkcoind
* check darkcoind version
Code:
darkcoind getinfo
* check connection status
Code:
netstat -an | grep 9999
darkcoind getinfo
22. start masternode
Code:
darkcoind masternode start passphrase_of_wallet
or type passphrase_of_wallet on the next line
Code:
darkcoind masternode start `head -1`

23. check log. check if ip is listed in masternode checking site.
24. if listed, local wallet and linux can go offline.
Code:
darkcoind stop
* if public ip of remote is changed, change masternodeprivkey
* if you see log like "(ip_yours) dropped (banned)", restart darkcoind

* if locale error is happen, check locale env.
* command locale show current locale env.
[email protected]:~$ darkcoind help
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted (core dumped)
Code:
locale
LANG=en_US.UTF-8
locale
 
Last edited by a moderator: