Developers Forum for XinFin XDC Network

s4njk4n
s4njk4n

Posted on • Updated on

How to Unstake SRX Node when Farmer Node Status = False

StorX has produced a guide on how to unstake SRX nodes but it applies to nodes where Farmer Node Status = TRUE :

StorX Network Knowledge Series: How to Unstake your SRX Node

Unstaking SRX nodes to withdraw the SRX is not presently possible if the node in question has its Farmer Node Status = FALSE so the first step is to get it back to Farmer Node Status = TRUE. (If you try to unstake an SRX node whilst it’s Farmer Node Status = False your tokens will be burned instead of returning to your wallet).

Below are 2 scenarios and possible solutions (depending on the actual cause of the Farmer Node Status = False)


Scenario 1:

We recently reinstalled some SRX nodes where the VPS had encountered an unrelated Ubuntu issue. In the process, we noted that something in the VPS-provider's implementation of Ubuntu 20.04 installation had changed. The new nodes were not installing correctly and thus never connected to the SRX network. As such, the node status was not being set to True on the dashboard.

The solution in our case was to reinstall the OS on the VPS and then immediately run these commands as soon as the VPS OS was installed (before reinstalling the SRX node software):

   apt update
   dpkg --configure -a
   apt upgrade
Enter fullscreen mode Exit fullscreen mode

At some point whilst the commands above are running you will reach a bright pink/purple screen in the terminal asking you to select an option. Here we selected to "keep the existing copy of the file already installed".

Then after that process we continued with the commands below. You will note some duplication of the commands. It was an odd quirk of the VPS provider we were using that they needed to be run twice. Doing so on other VPS providers will not cause any problems so the simplest default is probably for anyone doing the same process to run them twice as we have:

   apt autoremove
   apt update
   apt upgrade
   apt autoremove
Enter fullscreen mode Exit fullscreen mode

Then install the SRX node via the Method 1 Bootstrap script on the StorX Github as you normally would here:

StorX GitHub

The above process worked to bring all of our problematic nodes back online with Farmer Node Status = TRUE and they have been functioning fine since.

Once your node(s) reach Farmer Node Status = TRUE, you could then unstake the node as per the StorX guide linked at the top of this post.

In the event that the process above worked for you and you actually then decide to keep your StorX nodes active instead of unstaking, you may wish to take a look at these tools we created to administer multiple StorX nodes:

StorX Multinode Tools


Scenario 2:

StorX's offering is decentralised cloud storage. They have indicated they have some type of AI/process that discourages centralisation of too much of their storage capacity within limited IP ranges. (ie. they aim for geographical distribution of their storage capacity to strengthen uninterrupted service provision and data integrity).

We're only guessing but it could be possible that a node's Farmer Status being False could be a result of too much concentration of storage capacity at a particular VPS provider.

We have previously successfully migrated SRX nodes from one VPS host to another using Kasiimh1's BASH script that automates the process:

StorX Farmer Node Migration Tool

The benefit of using the script is that it benefits the network by copying any stored data over to the new VPS as well.

If the goal is also to unstake anyway then copying the data may be a moot point and you could in that case just as simply:

  • Deactivate the existing node (assuming it is even working), or simply just deactivate the whole VPS (or reinstall the OS to nuke the node software)
  • Buy a new VPS from a different hosting company
  • Install a new SRX node on the new VPS using the SAME XDC WALLET ADDRESS you used for the original node (ensuring of course that you dont have 2 nodes trying to run concurrently using the SAME XDC wallet address)
  • Then just wait for Farmer Node Status = TRUE on your StorX dashboard
  • Then unstake
  • After SRX tokens are safely back in your XDC wallet in a few days time, you could then just cancel both of the VPS plans

Items to note:

  • Whenever we’ve done something on our own nodes, we’ve always just tested on a single node and confirmed it is all working properly before repeating the process with other production nodes. Safety first.
  • Do not relinquish access to the VPS you originally ran your SRX node on until migration has completed successfully and you are certain that the reputation and staking are ok post-migration. Whilst there is uncertainty around the issue you’ll want to make sure you don’t lose control of that IP address (just in case you need to migrate back)).

If you encounter any issues please post them in the comments below so that future users can see any issues or changes that are needed to the process(es) over time.

Hope that is helpful guys :)


Discussion (0)