chaeplin
Well-known member
* 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 1
This part use github src to compile to setup basic environment.
#########################
1. login to ec2 ami
2. disable root login and sudo to root
http://aws.amazon.com/articles/1233
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html
3. update system
4. add swap
* add line to /etc/fstab
5. install files
read binary wallet compatibility : https://github.com/darkcoinproject/...#dependency-build-instructions-ubuntu--debian
6. change system setting
* enable sysstat
* you can skip this system monitoring part.
* sysstat utilities are a collection of performance monitoring tools.
* add iptables rule
* add a line to /etc/rc.local between # and 'exit 0'
* do not use this rule for other vm.
* rule for ec2 ami + ec2 security group.
* /etc/iptables
* test iptables
7. reboot system
8. do step 1 and 2(login and switched to root)
*** if you don't want compile, you can skip step 9, 10, 11.
9. install darkcoin(git, compile, strip, copy)
10. logout root
11. as ubuntu user
If you want more powerpool password do this, and use the result to darkcoin.conf.
You do not need to remember this password. It's used to connect rpc.
Anytime you can change it(after darkcoind is stopped)
This is output of darkcoind.
* make and edit ~/.darkcoin/darkcoin.conf
run darkcoind
check sync status
compare block height(no) with http://explorer.darkcoin.io/chain/DarkCoin or http://drk.poolhash.org/graph.html
use 'tail -f ~/.darkcoin/debug.log' to see log.
Continued.. in PART II
* 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 1
This part use github src to compile to setup basic environment.
#########################
1. login to ec2 ami
Code:
ssh -i downloaded_pemfile ubuntu@ami_public_ip
2. disable root login and sudo to root
http://aws.amazon.com/articles/1233
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html
Code:
sudo passwd -l root
sudo su -
3. update system
Code:
apt-get update
apt-get dist-upgrade
4. add swap
Code:
dd if=/dev/zero of=/swapfile bs=1M count=1024
Code:
mkswap /swapfile
swapon /swapfile
* add line to /etc/fstab
Code:
/swapfile swap swap defaults 0 0
5. install files
Code:
apt-get install build-essential libssl-dev libboost-all-dev libdb5.1 libdb5.1-dev libdb5.1++-dev
Ubuntu precise has packages for libdb5.1-dev and libdb5.1++-dev, but using these will break binary wallet compatibility, and is not recommended.
Code:
apt-get install git ntp make g++ gcc autoconf cpp ngrep iftop sysstat
6. change system setting
Code:
update-rc.d ntp enable
* enable sysstat
* you can skip this system monitoring part.
* sysstat utilities are a collection of performance monitoring tools.
change line in /etc/default/sysstat
* /etc/default/sysstat : "ENABLED="true"
change line in /etc/cron.d/sysstat
* /etc/cron.d/sysstat : sar 10 min to 1 min :
5-55/10 * * * *
to
*/1 * * * *
* add iptables rule
* add a line to /etc/rc.local between # and 'exit 0'
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/sbin/iptables-restore < /etc/iptables
exit 0
* do not use this rule for other vm.
* rule for ec2 ami + ec2 security group.
* /etc/iptables
Code:
#-----
*filter
:INPUT ACCEPT [1038:145425]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [434:87191]
-A INPUT -i eth0 -p tcp -m tcp --dport 9998 -j REJECT --reject-with tcp-reset
-A INPUT -i eth0 -p tcp -m tcp --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m tcp --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j DROP
-A INPUT -i eth0 -p tcp -m conntrack --ctstate NEW -m tcp --dport 9999 -j ACCEPT
-A INPUT -i eth0 -p tcp -j ACCEPT
-A OUTPUT -o eth0 -j ACCEPT
COMMIT
#-----
* test iptables
Code:
/sbin/iptables-restore < /etc/iptables
iptables -L -v -n
7. reboot system
Code:
reboot
8. do step 1 and 2(login and switched to root)
*** if you don't want compile, you can skip step 9, 10, 11.
9. install darkcoin(git, compile, strip, copy)
Code:
cd /usr/local/src/
git clone https://github.com/darkcoinproject/darkcoin.git
cd darkcoin/src/
Code:
time make -f makefile.unix "USE_UPNP:=-" "USE_IPV6:=0"
strip darkcoind
cp darkcoind /usr/bin
10. logout root
Code:
exit
11. as ubuntu user
Code:
mkdir ~/.darkcoin
If you want more powerpool password do this, and use the result to darkcoin.conf.
You do not need to remember this password. It's used to connect rpc.
Anytime you can change it(after darkcoind is stopped)
Code:
darkcoind
This is output of darkcoind.
Code:
> darkcoind
Error: To use darkcoind, you must set a rpcpassword in the configuration file:
/home/ubuntu/.darkcoin/darkcoin.conf
It is recommended you use the following random password:
rpcuser=darkcoinrpc
rpcpassword=Z9u831PBcGvuQdassadasVQFZb5381EoadnjAebc
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %s | mail -s "DarkCoin Alert" [email protected]
* make and edit ~/.darkcoin/darkcoin.conf
Code:
#----
## change this
rpcuser=any_user_name_you_want_you_should_change_this_do_not_forget_
## change this
rpcpassword=any_password_you_like_name_you_want_you_should_change_this_do_not_forget
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
#--------------------
# change change_this_to_your_ec2_public_ip_ami_public_ip to public ip address which you connected by ssh
externalip=change_this_to_your_ec2_public_ip_ami_public_ip
#---------------------
run darkcoind
check sync status
compare block height(no) with http://explorer.darkcoin.io/chain/DarkCoin or http://drk.poolhash.org/graph.html
use 'tail -f ~/.darkcoin/debug.log' to see log.
Code:
darkcoind
darkcoind getinfo
darkcoind getmininginfo
tail -f ~/.darkcoin/debug.log
Continued.. in PART II
Last edited: