Lessons Learned from Windows Worker Setup

Santiago Velez, [18.06.20 10:25]
SUCCESS! I’ve been able to successfully self-stake 50,000 VID on my Worker and enter into the bonding process. Once the 10 day trial period is complete I will initiate my worker for work. Lot’s of lessons learned. Here are some of those lessons:

  1. Before you do ANYTHING, make sure that you have at on your Ethereum wallet at least 0.1 ETH (~$20) and at least 50,010 VID ERC20 tokens. Don’t even bother unless you have these minimums. Why? both blockchains are modelled around needing ‘gas’ to transact (nothing is for free, not even simple compute operations). So you need a little extra ETH on one side of the bridge to pay Ethereum PoW miners, and a little extra VID on the other side of the bridge to pay the VideoCoin network algo. This was not discovered without a lot of pain and help by the VC team. Thanks guys!

  2. Configuration of the Docker process on the local device is essential before you run the commands. This means that you have to give Docker the permission to mount local hard drive storage. Think about that, Docker is an isolated container environment from your computer (by design!) so you have to allow it to extend outside of it’s own universe into your PC (and you do so by allocating some hard drive space, in this case a specific subdirectory in which it has permissions to read / write processes to). This is super important. Here what it looks like on my end:

In the above I allocated C:\Users\Santiago\VideoCoin to the Docker. This is important because it has to access files like your Ethereum keyfile & the environment file needed to setup the worker. Give it access of FAIL!

The other main lessons learned were account setups. This process requires a lot of supplemental software. You need a Docker account to use containers, you need an Infura account to communicate with the Ethereum mainnet without running your own full Ethereum node, and you need wallets on both blockchains. You obviously also need to register an account with VideoCoin in order to register your worker and obtain the worker Client ID. Here is my worker with Client ID: 7405b9b2-299b-4b0c-977d-f28d0e717868 , worker name: “BDC- Prototype - i9-9900K @ 3.6 GHz”

Next lesson learned. The Docker commands can be run from either Windows command prompt (CMD.EXE) w/ admin priviliges or a tool like Git Bash. In all circumstances, the directory you need to navigate to needs to be the same directory that contains both your Ethereum keyfile (named something like ETH.json) and the environment file for the machine (vars.env). This directory should be the same one you have Docker to access above, so that it can read those files and communicate with the mainnets of both Ethereum & VideoCoin.

Here is an example of the syntax I used to first FUND my account, assuming my ethereum key (UTC.json) is stored under a directory C:\Users\Santiago\VideoCoin

C:\Users\Santiago\VideoCoin>docker run --rm -it --env=“ETH_RPC_URL=https://mainnet.infura.io/v3/INFURAACCOUNTID” -v C:/Users/Santiago/VideoCoin:/tmp videocoinnetwork/staker fund 50050 -k /tmp/UTC.json -s PASSWORD

Take note in the above a few things. The spacing, the quotations, etc. I made my INFURA account ID and my PASSWORD anonymous so you need to supply your own. Note the directory structure before :/tmp (I spent 1/2 a day getting this right :sob: because I’m not a developer). Also note that I funded it with 50,000 + 50 to ensure that when I get to the next step I have some VID as gas.

After you FUND it, you have to accept the terms of service of the VideoCoin network by typing “YES” not Y, the letters Y - E - S. I know, I’m an idiot, this tripped me up about 3 times, so attention to detail is required. The expected response after successfully funding the account is:

By running this command, you agree to the “VideoCoin Network Worker Terms of Service” [https://storage.googleapis.com/videocoin-network-policies/VideoCoinNetworkWorkerTermsofService.html] and “VideoCoin Network Delegator Terms of Service” [https://storage.googleapis.com/videocoin-network-policies/VideoCoinNetworkDelegatorTermsofService.html]. Please read these terms and type YES if you agree: YES
INFO[0014] account 0x5ca10ec3f005BaEE952Ff80fdFc8CA1C80912C9d has been successfully funded on native network version=dev

OK, so now you’ve funded the account. You then need to stake the minimum Worker amount, right now it’s 50,000. So you repeat the above docker command only you substitute the word ‘fund’ with the appropriate staking command and/or quantities of VID.

Before you use stake you have to first add VID to the stake process, so BEFORE you actually stake you have to run “stake add”, so it looks like this:

C:\Users\Santiago\VideoCoin>docker run --rm -it --env=“ETH_RPC_URL=https://mainnet.infura.io/v3/INFURAACCOUNTID” -v C:/Users/Santiago/VideoCoin:/tmp videocoinnetwork/staker stake add 50050 -k /tmp/UTC.json -s PASSWORD

NOW, you run stake.

C:\Users\Santiago\VideoCoin>docker run --rm -it --env=“ETH_RPC_URL=https://mainnet.infura.io/v3/INFURAACCOUNTID” -v C:/Users/Santiago/VideoCoin:/tmp videocoinnetwork/staker stake 50050 -k /tmp/UTC.json -s PASSWORD

You can always probe your machine / staking account via the PROBE command. It looks like this when you do so:

C:\Users\Santiago\VideoCoin>docker run --rm -it --env=“ETH_RPC_URL=https://mainnet.infura.io/v3/INFURAACCOUNTID” -v C:/Users/Santiago/VideoCoin:/tmp videocoinnetwork/staker probe -k /tmp/UTC.json -s PASSWORD

This is what it returns back:

address: 0x5ca10ec3f005BaEE952Ff80fdFc8CA1C80912C9d
self stake: 50000
delegated stake: 0
native: 49.99978025
erc20: 0

If you try and run the worker BEFORE the 10 day bonding period ends you are met with this message (couldn’t help myself because I’m just that type of person):

C:\Users\Santiago\VideoCoin>docker run --rm --env-file vars.env videocoinnetwork/worker:latest
time=“2020-06-18T14:12:41.799895637Z” level=info msg=“current state is BONDING” version=v1.0.0-everest-9bb45a7
time=“2020-06-18T14:12:41.799946737Z” level=fatal msg=“failed to start, state must be BONDED” version=v1.0.0-everest-9bb45a7

@devadutta You are the bomb, thanks for cutting the bonding period from 10 days to 5 min, my worker is BONDED and running on the network!!!

Thank you @Santiago_Velez for this great writeup!

1 Like

Thank you for the write up, it helps!

Now I have some questions.
I hope you can help answer.

Question1:
The command you used to fund the account,

C:\Users\Santiago\VideoCoin>docker run --rm -it --env=“ETH_RPC_URL=https://mainnet.infura.io/v3/INFURAACCOUNTID” -v C:/Users/Santiago/VideoCoin:/tmp videocoinnetwork/staker fund 50050 -k /tmp/UTC.json -s PASSWORD

is the last “PASSWORD” the PROJECT SECRET from Infura?

Question2:
You send 50 extra vid tokens for self staking.
I see that you staked all 50050 instead of 50000.
This works, right?
I don’t have to leave extra 50 on the wallet, right?

Thanks for your help!

The “PASSWORD” should be your eth keystore file password.

You do not have to leave 50 extra vid in the wallet but you do need to account for a small amount of VID that will be used as gas.

Thank you for your reply!

It helps a lot!

Thank you for this great write up. I have a few questions, can i use a MEW account? And how do i give permissions for docker to access a certain directory?

You would need the keystore file for the MEW account that you want to use.