Have you ever thought of staking your Spectre(XSPEC http://spectreproject.io) in Amazon Cloud? Or any of your VPS servers? Or even any of your old computers but get pushed back because of the difficult installation process?
Recently I spend quite some time to compile the source code to built a docker instance. It takes me quite a lot time, but now I'd like to share it out so you don't have to spend the time again. If you know what docker is, you probably know you will love this solution. Because it is simple, straight forward, and takes only seconds to run your wallet anywhere to start staking.
Yet another reason to use this v2.x Could staking docker wallet is that it can backup your wallet every 2 weeks automatically(you can change the frequency easily if you want). You probabaly don't know that you should backup your wallet so frequency -- you are risking of losing money! Please read: https://bitcoin.stackexchange.com/questions/13277/how-frequently-should-one-update-wallet-backup. Most of the altcoins are forked from Bitcoin, therefore has to follow the same backup rules.
First, please install Docker and Docker Compose to your AWS/VPS/Any Computer, by following this guide: https://docs.docker.com/compose/install/
Then, download source code from my GitHub repository:
git clone https://github.com/moremorecoin/spectredocker.git
Last, run it by:
cd spectredocker
sudo docker-compose up -d
If you want to build the docker instance on your own, simply go to the image folder and run the build.sh like this:
cd spectredocker/image sudo sh build.sh
After you got the docker built, go back to spectredocker folder to launch it:
cd .. sudo docker-compose up -d
After a few seconds, you should see there are wallet.dat file as well as other log files in SpectreConf folder, you can then copy your own wallet.dat file into SpectreConf folder to replace the auto-generated wallet.dat file. After Spectre wallet syncronized all the blocks, your staking will begin automatically.
If your wallet is encrypted, after you start the docker, you can run unlock_wallet_for_staking.pl to unlock your wallet for staking only:
perl unlock_wallet_for_staking.pl
You will be asked for password to unlock the wallet. After you type it in, the password will be passed to the docker instance to unlock the wallet. You don't have to write down your password into docker-compose.yml file anymore.
To check the wallet status, you can take a look at the log file SpectreConf/status.log. To get the progressive output, run:
tail -f SpectreConf/status.log
This file is updated every 10 minutes.
If you want to use command line on your own -- to see your wallet address, send coin, check balance etc, you can attach to the docker instance this way:
sudo docker exec -it spectredocker_xspec_1 bash
To show some commands for use:
spectrecoind help
After you are done, type 'exit' to leave the console.
If you want to turn off the wallet, simply run this command in the same folder of docker-compose.yml file:
sudo docker-compose down
By default, nothing will be sent out. If you want it to send the wallet file to your email, please follow the instruciton:
- Register an account at https://www.mailjet.com
- After login, click your username at top right corner then click "My account" -> "Master API Key & Sub API key management". You should find your main account API KEY and SECRET KEY. Please fill these two keys into your docker-compose.yml file.
- Fill in the "mail_to", "mail_sender_name", "mail_subject" and "wallet_backup_filename" so the wallet knows where to backup the file.
- The docker-compose.yml file should look like the following (the keys are just for example, not real):
version: '3'
services:
xspec:
restart: always
ports:
- 127.0.0.1:9999:9999
environment:
- Donate_portion_of_staking=0.1
#Register your own account at https://www.mailjet.com/
- mailjet_api_key=8923b85ca9b8e3bb87a57b303a76d23e
- mailjet_secret_key=123c30e4f2fae98fbc453db43703c565
#Backup wallet file to this email address
- mail_to=my_secret_email@Xmail.com
#when filling the following blanks, be creative
- mail_sender_name=Cloud Wallet
#title and content of the backup email
- mail_subject=Important file auto backup
#wallet filename, set it you don't want it to be wallet.dat
- wallet_backup_filename=another_file_name
volumes:
- ./SpectreConf:/root/.spectrecoin
image: morecoin/spectre:2.1
- Now you can restart your wallet to reload the configuration:
sudo docker-compose down
sudo docker-compose up -d
- Since you always use encrypted wallet, now unlock it for staking:
perl unlock_wallet_for_staking.pl
- Check the status.log for a few minutes to make sure the staking is started:
$ tail -f SpectreConf/status.log
Wallet starting up ...
Please use unlock_wallet_for_staking.pl to unlock wallet
Password received, trying to unlock wallet for staking
Wallet unlocked successfully
1516512758, Balance=999.99000000, Staking=false, Expetedtime=0
1516513358, Balance=999.99000000, Staking=true, Expetedtime=101769
1516513958, Balance=999.99000000, Staking=true, Expetedtime=101769
NOTE: It is risky to use the same wallet in multiple computers. If you want to use the desktop wallet, it's better stop the cloud wallet first, then copy the very latest wallet.dat to your desktop computer to start the wallet program.
If you want to change the frequency, please add REPORT_STATUS_FREQ_IN_SEC and BACKUP_WALLET_FREQ_IN_SEC into the environment section like this:
version: '3'
services:
xspec:
restart: always
ports:
- 127.0.0.1:9999:9999
environment:
#report status every 5 minutes
- REPORT_STATUS_FREQ_IN_SEC=300
#backup wallet every week
- BACKUP_WALLET_FREQ_IN_SEC=604800
... ...
... ...
My Spectre stealth address is smYkGuyCD4z55C4WxtLzkFpNJu8GtFfhLm5minQBvxDMyPLAVLdah2ZjBqTW13QBoCayQW5sVKQMxZNoVYsHV3t7btkDFRq8nMWiyU, please donate to help this project. By default, the docker wallet donates 10% of your staking incomes to the above address every time before it backups your wallet file, if you don't feel like this idea, please set Donate_portion_of_staking to 0 to disable it before you start the docker.
I tried my best to make it secure and easy to use, but you still have to do your own homework and use it at your own risk.