This post is meant to provide some information on what worked for me setting up a clean Apothem Masternode using XDC 2.0 code (v1.4.8-beta). Be aware there is a good chance what worked for me here won't necessarily work as development on XDC 2.0 continues. I also can't be 100% certain some of these issues weren't localized to me, so your mileage may vary. Use this as rough guide and please offer discussion below on what works/doesn't work for you.
I attempted to upgrade my 1.0 Apothem Masternode but was unsuccessful, likely due to user error on my part. I spent some time attempting to fix but in the end I decided to wipe the VPS and start over clean.
Before I wiped my VPS, I followed the general procedure ensuring I backed up my coinbase.txt and keystore/UTC--DateTime--Address file. This node was fully funded with 10 million Apothem XDC and was working as intended on 1.0 for over 6 months:
I followed Method 3 documented here:
As of this writing, the format of the .env has changed from:
There were two issues with Method 3 that I had to work around.
One: After filling in my NODE_NAME and CONTACT_DETAILS and starting up the node, nothing appeared to be happening. No xdcchain directory was created where it started to download the chain. Listing the container showed me it was in a reboot loop and inspecting the logs inside the container showed the problem was missing PRIVATE_KEYS in the .env:
sudo docker ps
sudo docker logs --tail 50 --follow --timestamps testnet_xinfinnetwork_1
I pulled out my private key (ciphertext) from my UTC--DateTime--Address file and used it in the .env and this allowed the node to start. I then:
- stopped the container.
- replaced the newly created coinbase.txt and copied over keystore\UTC--DateTime--Address from my backups.
- started up the container.
- deleted the new UTC--DateTime--Address file.
I'm currently waiting for it to sync from the beginning as the apothem.tar URL listed in the docs is no longer valid. The one for mainnet (xdcchain.tar) is still working as of this writing:
Two: NODE_NAME in the .env doesn't seem to pass to the docker container. I suspect this will be resolved very shortly, as it's likely just a minor bug. I resolved it setting the following for now and restarting the container:
Note that as of this writing, https://apothem.network/#stats exposes the IP address and XDC address of the XDC 2.0 instances. I suspect this will likely be resolved shortly.
Questions that came up during this exercise:
How does someone set up a completely new XDC Apothem 2.0 masternode without a previous private key? I assume they create an address manually in XDCPay or elsewhere, and export the private key to use.
Once I have an up-to-date chain, how can I save that to help with future migrations and/or share with others as needed? Is it as simple as tarring up my xdcchain folder only omitting my coinbase and keystore\UTC--DateTime--Address files? Or is it enough to tar up and save only xdcchain\XDC?
I need to start my node with the --enable-0x-prefix option but with the node startup script inside the container, it was difficult. I managed to make my needed changes and then create a copy of that image, and change docker-compose.yml to start my image instead. Is there a reason all the startup script info was moved into the docker container?