Validating staking, deposit and withdrawal
Common steps for depositing and withdrawal
- Pre-requisite; your computer should be connected to the mainnet and blocks should be getting created. Instructions at: Connecting To Mainnet.
- Wait for all blocks to get downloaded from the previous step. You can check the latest block at DpScan.app. If you try to run the next set of steps before all blocks are downloaded, you might get gas related errors.
-
Open the appropriate shell window. Do not close the other shell window in which the mainnet is connected to.
-
Change to the folder where the blockchain node client is located.
-
This step is specific to Mac and Linux. Set the environment variable to the required library path. Remember that if you open a new Terminal window anytime, you will need to run this command again, to set the environment variable. You might want to add this environment variable to your shell profile.
-
Set the environment variables to point to the data folder and DP_RAW_URL.
Windowsset DP_KEY_FILE_DIR=$HOME/dp/data/keystore
set DP_RAW_URL=//./pipe/geth.ipc
export DP_KEY_FILE_DIR=$HOME/dp/data/keystore
export DP_RAW_URL=~/.ethereum/geth.ipc
export DP_KEY_FILE_DIR=$HOME/dp/keystore
export DP_RAW_URL=~/.ethereum/geth.ipc
In case you get any error related to DP_RAW_URL, try the following instead:
export DP_RAW_URL=$HOME/dp/geth
Depositing
- Pre-requisite; you should already have a quantum wallet with coins for staking. A minimum of 5,000,000 (5 million) coins are required for staking.
-
Create a quantum wallet for validating. This wallet will henceforth be called as the validator wallet. This wallet is different from the wallet from which you will be depositing the coins for staking. You will be prompted to enter a password. Ensure you use a strong password atleast 16 characters in length. You should never forget your password. If you don't remember it, the wallet will be useless and you cannot access any coins or tokens inside it.
- Once you execute the above command successfully, the quantum wallet will be created. Note down the address of this wallet from the output of the above command. This will be your validator quantum address.
-
You will also notice that a file has been created under the data\keystore location. This is your quantum wallet. An example is shown below:
Example: Path of the secret key file: data\keystore\UTC--2024-01-13T21-09-56.375263700Z--a553b8935988e6260b6e3c3ff5b340ee478b504b7166b4881365a9153c80a78c
- Backup the above wallet file in 3 different offline devices as explained in Prepare your device. You should not proceed to remaining steps until you backup the wallet.
- Remember that you will always need the password to use the wallet. If you don't remember it, the wallet will be useless and you cannot access any coins or tokens inside it. Consider noting down this password safely offline in a trusted location.
- Likewise, even if you remember the password, if the wallet file is lost or corrupted, you cannot access any coins or tokens. If the wallet is stolen and the password is not strong, the attacker can get all the coins or tokens in your wallet. Hence you should keep your wallet well protected.
- Copy the quantum wallet from which you are depositing the coins from, into the data\keystore folder.
-
Run the following command to deposit coins.
Replace DEPOSITOR_ADDRESS with the address of the wallet that has the coins to deposit. Ensure this wallet also has additional coins for gas fees for the transaction.
Replace VALIDATOR_ADDRESS with the address of the wallet for validating as specified in step 2.
Replace DEPOSITOR_AMOUNT with the number of coins you want to deposit. You should leave atleast 10000 coins in your account instead of depositing all coins; this is for gas fees for this deposit transaction and also future transactions when you want to withdraw the deposited coins. - If the above command is successful, you should see a confirmation message. After about 10 minutes, you may check the despoit balance by following the steps in the section below: Checking Staking Balance.
- You should proceed to immediately run the validator node by following the steps in . Otherwise you might loose coins due to inactivity slashing.
- For security reasons, you should move the depositor quantum wallet to a different device and also keep multiple backups offline. You shouldn't keep the depositor quantum wallet in the same computer that is running the blockchain node. Only the validator wallet should be kept on this computer. If you loose your depositor quantum wallet or forgot the password or it gets stolen, even if you have the validator wallet, you will not be able to get your deposited coins back. Keep both your depositor and validator wallets safe!
Checking Deposited Staking Balance
- Pre-requisite; you should already have staked coins and the validator node is running.
-
You can check the staked balance by running the following command:
Checking Block Mining Rewards
- Pre-requisite; you should already have staked coins and the validator node is running.
-
You can check the block mining rewards by running the following command:
Checking Validator List
- Pre-requisite; you should already have staked coins and the validator node is running.
-
You can check the list of validators by running the following command.
Withdrawing
- Pre-requisite; you should already have deposited coins for staking.
- Copy the depositor quantum wallet under the data\keystore folder if not already copied.
-
You can initiate the withdrawal of coins by running the following command.
-
If the above command is successful and the deposit completes, you can withdraw the staked coins after 256000 blocks have been created, by running the following command. This can be upto 60 days or more.