zoldur / OlympicCoin

MIT License
2 stars 3 forks source link

great guide, but how to automatically recover after reboot? #3

Open aleqx opened 6 years ago

aleqx commented 6 years ago

Many thanks for the script and guide here: https://github.com/zoldur/OlympicCoin/blob/master/README.md

The problem with using this hot/cold wallet setup is that if the VPS is rebooted, then the masternode must be re-registered manually from the GUI wallet by pressing "Start" in Masternodes > My masternodes > Start.

Otherwise payment is lost as the masternode can no longer ping the network to say it's up and running.

If the VPS is rebooted, the Olympicd daemon is started automatically, but it cannot ping the network because it hasn't received the registration (the "Start" from the GUI wallet). Logs show this every minute:

2018-05-12 18:48:09 CActiveMasternode::ManageStatus() - Checking inbound connection to '<IP>:26667'
2018-05-12 18:48:09 CActiveMasternode::GetMasterNodeVin - Could not locate specified vin from possible list
2018-05-12 18:48:09 CActiveMasternode::ManageStatus() - Could not find suitable coins!
2018-05-12 18:48:09 CActiveMasternode::Dseep() - Error: masternode is not in a running status
2018-05-12 18:48:09 CActiveMasternode::ManageStatus() - Error on Ping: masternode is not in a running status

What's the best way to properly automate the entire process? If a manual "Start" is needed, then it kind of defeat the whole process of having a VPS and I might as well cron a job every 5 minutes in Windows ...

zoldur commented 6 years ago

You cannot fully automate the process. Whilst Olympic daemon will automatically start on the VPS, you still need to start your node in the wallet.

aleqx commented 6 years ago

That's not ideal ... one may lose payment this way (e.g. on vacation and VPS is rebooted due to a power cut).

How about importing the private key of the stake address on the VPS, and copying the masternode.conf file on the VPS too, making the VPS a capable masternode without the need for a cold wallet? Are there any pitfalls apart from the risk of getting hacked and losing the coins?

aleqx commented 6 years ago

I did the above and the masternode appears to start and registers itself with the network:

2018-05-12 21:02:43 CActiveMasternode::ManageStatus() - Checking inbound connection to '<IP>:26667'
2018-05-12 21:02:43 CActiveMasternode::ManageStatus() - Is capable master node!
2018-05-12 21:02:43 CActiveMasternode::Register() - RelayElectionEntry vin = CTxIn(COutPoint(<TXID_SNIP>, 1), scriptSig=)
2018-05-12 21:02:44 CActiveMasternode::Dseep() - RelayMasternodeEntryPing vin = CTxIn(COutPoint(<TXID_SNIP>, 1), scriptSig=)
2018-05-12 21:03:44 CActiveMasternode::Dseep() - RelayMasternodeEntryPing vin = CTxIn(COutPoint(<TXID_SNIP>, 1), scriptSig=)

And masternode status gives 1:

# Olympicd masternode status
{
    "vin" : "CTxIn(COutPoint(<TXID_SNIP>, 1), scriptSig=)",
    "service" : "<IP>:26667",
    "status" : 1,
    "pubKeyMasternode" : "QT97HwsyLy4eY7nZbzYk8k3gV6jtw7GJbb",
    "notCapableReason" : ""
}
zoldur commented 6 years ago

Yes, it is possible to make a hot wallet, but I would not recommend that unless you are Linux savvy.

aleqx commented 6 years ago

I'm a linux dev, no worries. Is anything else needed apart from what I said above?