Withdraw PLI from Plugin Node

Whenever you setup a plugin node, a dedicated wallet will be generated and it is unique to that plugin node address. It is necessary to sufficiently fund your Plugin node with XDC for transaction fee & PLI for oracle fee.
So what if you want to withdraw a portion of this to your wallet?
Step 1) Every plugin node generates the unique wallet and generates the private key in database
Step 2) You can find the “private key’” for your wallet in “Keys” table in postgres
Step 3) With sudo user, you can view the json value in the table
Step 4) Copy down the json into a json file(let’s say — Test.json)
Step 5) Import this json into metamask to view your XDC / PLI balance

Step 1) Login into Postgres

sudo -u postgres -i

Point to right database

/c plugin_mainnet

Step 2) Apply following Query

select json from keys LIMIT 1;

Step 3) Copy the json values into a test file

copy the complete json values into a test file.. say test.json
For ex — below data(mock) for your reference..
{“id”: “afa354f-8a9a-4cb2-ba22–8bc19d842b7d”, “crypto”: {“kdf”: “scrypt”, “mac”: “04d3dd0f3f2b44444f9350560bfa828b3658703676636c2751993c983d9b40c6”, “cipher”: “aes-128-ctr”, “kdfparams”: {“n”: 262144, “p”: 1, “r”: 8, “salt”: “6d99ff17d887763d3774aa5bc00631e2a79763be68884af1e4f262cd8cd0828”, “dklen”: 32}, “ciphertext”: “3bfee9e6ed917f1b335e95df5554ebc72c80e63979027e74634f2aebf08f02f1”, “cipherparams”: {“iv”: “eb3bcbabf6d871c829e5948da9a690c0”}}, “address”: “bb4d8683f2924473c579c539436810d5ac28aab3”, “version”: 3}

Step 4) Add Xinfin mainnet in Metamask using “Add a network” option

Step 5 - Now choose “Import account” and select JSON file as type. (Pass word should be same as your keystore password which you entered while you setup Plugin Node)

Note — this step will take some time so please be patient also ensure, your node is running and the Plugin UI is logged in (localhost:6688)
You can see the address loaded and showing the right balance of XDC & PLI
to view the PLI balance, click “Import token”
Step 6 — Copy paste the PLI mainnet smart contract address (prefix to be changed from XDC to 0x) and click “Add custom token”