I am using that config for some time now, it seems to be working fine. But I would like to hear a feedback if this is good or bad practice. I thought about docker containers first as they might be safer thanks to providing some separation, but finally I ended with just subdirectories running different versions of decred binaries. It looks like : . |─ decred │ ├── 0.1.2 │ ├── 0.1.3 │ ├── 0.1.4 Within those directories are stored data for dcrd and dcrwallet thanks to configuration switches and I have access to all of them using different ports. It allows me to have seamless failover if anything goes down. It also ensures no missed votes when starting a new version (which is not upgrade, just add a new directory). It takes more time than just change binaries, but my wallet is recreated from seed every time and I can check for balances, errors, etc. The question is : is it a good idea or a bad one and (apart from getting out of sync sometimes) why ?
I don't see anything wrong with this as long as your computer is good enough to handle running more than one. I personally don't keep multiple at the same time for long term on the same system, but when I'm updating my systems that actually vote, I do install new versions into a new location while leaving the old version running in order to be sure there is no downtime. Once the new version is up and running, I stop the old version and remove it.
First of all thank you for replying my question on the other post. I'm don't programing so I had some doubts on your explanation. To have 2 daemon and wallets running do I need to open more ports at my AWS?
I would not open any ports at AWS, unless you want to provide full node access to the public. Search externalip here. There is a better explanation written by @chappjc - I saw it somewhere.
Thank you. Couldn't find more informartion on how to run another daemon and wallet at my AWS. These are my doubts: After download the new binaries when I try to run another daemon he will not donit because there is one already running. I have tried to copy the dcrd folder to another location but them my daemon stop running. Have been trying to update my binaries without having to stop my daemon as it take quite a while to come back and I would miss vote tickets. Have tried to do as your example creating a decred folder having the other binaries in separate folder but cannot run 2 at a time. Is there any different cmd when staring the 2nd Daemon? Thank you formyour help.
I have setup multiple wallets and multiple instances of dcrd on my AWS. You need to implement config files and specify different data directories and RPC ports for each instance. See my examples. You can leave your first decred instance to the default settings if you want, just for ease of management: First Instance (Left as Default) Create a directory with a name of your choice and place your decred binaries inside. Example: Contents of directory /home/ubuntu/decred1: dcrctl dcrd dcrticketbuyer dcrwallet Place your config files for the first instance in the following default Decred directories: home/ubuntu/.dcrd /home/ubuntu/.dcrwallet /home/ubuntu/.dcrctl Contents of dcrd.conf: Code: rpcuser=XXX rpcpass=XXX Contents of dcrwallet.conf: Code: username=XXX password=XXX enablestakemining=true balancetomaintain=10000000 ticketmaxprice=1 Contents of dcrctl.conf: Code: rpcuser=XXX rpcpass=XXX Start dcrd and dcrwallet as normal with no additonal arguments. Second Instance (Modified Settings) This is where things get a bit tricky. The binaries need to be launched with the extra command to specify a non-default directory for the configuration files. The config files will then specify a non-default data directory that this second instance will use to store the wallet and the blockchain. Create another directory under your home directory. This is where all things for instance 2 will reside. Example: cd /home/ubuntu mkdir decred2 Place your binaries for instance 2 inside this folder. Contents of directory /home/ubuntu/decred2: dcrctl dcrd dcrticketbuyer dcrwallet Inside of your decred2 folder, create hidden directories: .dcrd, .dcrwallet, and .dcrctl. Note the period in front of the folder name, which indicates the folder is hidden. Example: mkdir .dcrd mkdir .dcrwallet mkdir .dcrctl Your config files will need go in each of the above hidden folders, but this time the contents of each file need to be changed to the following. Example: $more /home/ubuntu/decred2/dcrd.conf Code: datadir=/home/ubuntu/decred2/.dcrd rpcuser=YYY rpcpass=YYY rpclisten=:8109 listen=:8108 $more /home/ubuntu/decred2/.dcrwallet/dcrwallet.conf Code: appdata=/home/ubuntu/decred2/.dcrwallet rpcconnect=127.0.0.1:8109 rpclisten=127.0.0.1:8110 rpccert=/home/ubuntu/decred2/.dcrwallet/rpc.cert rpckey=/home/ubuntu/decred2/.dcrwallet/rpc.key username=YYY password=YYY enablestakemining=true $more /home/ubuntu/decred2/.dcrctl/dcrctl.conf Code: rpcuser=YYY rpcpass=YYY rpcserver=localhost:8109 Now instance 2 is setup, but you need an easy way to launch it. I would suggest creating a script to pass the extra argument to the binaries. Here is how to create a script. Change back to your decred2 folder and create the following files which we will use as startup scripts: start_dcrd & start_dcrwallet. You can use any text editor of your choice. I prefer gedit if you're using the GUI, or pico if you're using the CLI. Example: cd /home/ubuntu/decred2 pico start_dcrd <press ctrl+o, enter, then ctrl+x> pico start_dcrwallet <press ctrl+o, enter, then ctrl+x> The contents of each script need to point the applicable binary to the directory with the modified configuration file. Example: $pico start_dcrd Code: ./dcrd -C .dcrd/dcrd.conf <press ctrl+o, enter, then ctrl+x> Same thing for your wallet: $pico start_dcrwalllet Code: ./dcrwallet -C .dcrwallet/dcrwallet.conf <press ctrl+o, enter, then ctrl+x> Now change the file type to an executable file: Code: chmod +x start_dcrd chmod +x start_dcrwallet Now, you are ready to start your second instance. Run the scripts you just created: Code: ./start_dcrd ./start_dcrwallet You can repeat this basic directory structure with more instances (decred3, decred4, etc), and the only things you need to change in the config files are the port numbers. And as always, let dcrd fully finish syncing before creating your wallet. You can copy the blockchain from instance 1 to instance 2 if you want using the following command: Code: cp /home/ubuntu/.dcrd/data/mainnet /home/ubuntu/decred2/.dcrd/mainnet
Thank you very much for your explanation. I will try to do it step by step on my AWS. Probably will try on my computer first so I make sure I do it right them go for the AWS. The config files I need to create them and insert the information you wrote? Replacing the xxx of course. Sorry for the basic questions but I have no knowledge on programing but until now I have been able to be doing the POS. Regards
Anytime! Unless your VPS is running your main wallet I don't see any issue to following the steps above on your VPS. Just skip to the "second instance" part and leave your primary one alone. I kinda wrote that guide in a rush so if something doesn't make sense just ask me about it on here! I don't know your Linux skill level, but these basic commands will be useful (and required!) in setting this up: ls = list all files and directories (excluding hidden) in current directory ls -a = list all files and directories (including hidden) in current directory pwd = print working directory cd = change directory Also look into the screen utility for your VPS. This will let you have multiple terminal instances in a CLI only environment.
I'm not following this discussion closely, but note that you don't need 2 daemons to run 2 wallets. Any number of wallets can connect to the same daemon. For the upcoming upgrade to dcrd that involves the new database and a necessary resync of the entire blockchain, I posted some suggested steps here: https://spool.cc/2016/09/migrating-to-new-db/ But for normal upgrades, I think it's not really necessary to do a tricky process like this. Just take it down for a second, update and start up again. Not likely to miss a block (and maybe vote), but if you are worried, I guess you can run another daemon but I would just do this on another machine to save trouble.