VIDPOOL on Windows

This brief tutorial is a help-guide on running VIDPOOL on Windows via the Docker container. This help guide assumes that the user has already successfully installed VIDPOOL on their machines per this developer documentation:

https://docs.videocoin.network/videocoin-pool-software

A few things to understand conceptually before we start.

  1. VIDPOOL is run PER WORKER NODE! This assumes you run an instance of VIDPOOL for 1 worker and many delegators. If you have multiple workers, each with their own delegators, you will have to run VIDPOOL with a seperate configuration file. You can use scripts to automate that process but that is outside the scope of this tutorial.

  2. You only need to run VIDPOOL periodically, it’s not a continuous process. We’ve chosen to have our payment scheduler to Delegators as monthly, so we run VIDPOOL automatically at the end of the month at 11:59 PM via an preprogrammed task scheduler.

  3. CAUTION: VIDPOOL can be run in (2) two modes: Dry-Run & Normal. The Dry-Run mode will simply collect data from the respective blockchains (Ethereum, VideoCoin) to calculate how much a Delegator is entitled from work performed during a period of time since the last time VIDPOOL was run. The Normal mode actually MAKES automated payments!!! This means funds will irreversibly be moved from your account (be it VID from your wallet or fiat from your Public Mint) to the Delegator’s wallet, so tread carefully!

  4. In addition to the two modes that VIDPOOL can be run in there are two types of payments that can be made, the first is a fiat payment for sharing worker proceeds from completed transcoding (this is called “PAYOUT” mode) and the second is paying out VID from the worker address (this is called “FLAT” mode). This is because VIDPOOL was designed originally for managing the Genesis VideoCoin pool that pays out VID to delegators). The difference betwee PAYOUT and FLAT isn’t just the type of payment being made (fiat vs. VID) it’s also whether or not an APR is being calculated over a period of time of Delegation. Very important!

The first thing I will discuss in detail is the configuration file (config.json) needed to run VIDPOOL because some of the details are important. Here’s what the internals of the config.json file look like, you can use a standard text editor like Notepad++ on Windows to edit it:

{
"DataDir": "/tmp/vidpooldata/",
"KeyFile": "worker-key.json",
"Password": "",
"StreamManagerAddress": "0xee714E6f2686929AE33614aAA332D67EaC9f5ede",
"StakingManagerAddress": "0xe535420fD393C202c5F47aAfDc210fF36f697584",
"WorkerChainURL": "https://symphony.dev.videocoin.net/",
"PaymentsChainURL": "https://rpc.tst.publicmint.io:8545/",
"LogLevel": "debug",
"PaymentURLSpec": "https://explorer.tst.publicmint.io/tx/%s/token_transfers"
"Auth": {
    "ClientID": "69cf5e81-5301-414f-9cd9-a39bbe06c0ff",
    "AuthURL": "d.dev.videocoin.network:5008"
}
}

A few things to note above.

  1. The configuration file, we’ll call it config.json, doesn’t need to be in the same relative path that you’ve given folder permissions to in the Docker environment but we chose to do so for simplicity. For example, in my case I gave Docker read/write privileges to the following directory on Windows: C:\Users\Santiago\VideoCoin. This is the same directory that I have the config.json file. It can be done other ways but this was simplest for me.

  2. The parameter KeyFile is the same Ethereum keyfile that the worker users when running the worker. I happened to name it UTC.json in this example which will become important in the run command.

  3. The parameter DataDir I named as “/state/” for simplicity to the directory structure I decided to use for where my config.json and UTC.json keyfile are stored relative to where I run Docker instance of VIDPOOL. I hope that makes sense!

Here’s what my config.json looks like for running VIDPOOL in DRY-RUN mode with the .json files in the same Data directory:

    {
  "DataDir": "/state/",
  "StreamManagerAddress": "0xA412ba6e9f341aA438E0551102713e583d9F8e8e",
  "StakingManagerAddress": "0xaDAE0F8b1cf953C79F8A397cC8D0A209EAF00944",
  "TokenAddress": "0x2c9023bbc572ff8dc1228c7858a280046ea8c9e5",
  "EscrowAddress": "0x314847CF2F4911c73E9E86005bdD901520C522B9",
  "WorkerChainURL": "https://symphony.videocoin.net/",
  "PaymentsChainURL": "https://rpc.publicmint.io:8545/",
  "LogLevel": "debug",
  "PaymentURLSpec": "https://etherscan.io/tx/%s",
  "EthereumChainURL": "https://mainnet.infura.io/v3/(YOUR INFURA PROJECT KEY)",
  "Rate": {
    "Decimal": 0.20,
    "Unit": "year"
  },
  "Safety": 7
}

Please note in the above I’ve hidden my INFURA PROJECT KEY but I’ve specified 0.20 for the “DECIMAL” field, to denote the intent to pay delegators on my Worker 20% at the time of the run. If this is run for a monthly fiat payment the VIDPOOL program will ignore the parameter “UNIT” or “Year” since it just calculates amounts to be transferred from the LAST time it was run, so there’s no need to calculate an APR paid monthly. This thing can do a lot!

Okay, brass tacks time. Let’s run VIDPOOL, first in DRY-RUN mode with a “FLAT” payment scheme, this means no payments will be initiated and your working on distributing fiat $ to your delegators via Public Mint:

Open up the CMD prompt on Windows and run the following command (please note the relative path structure for your .json files):

`C:\Users\Santiago> docker run  -t -v C:\Users\Santiago\VideoCoin:/state  -w /state videocoinnetwork/vidpool:v0.2.5  -c /state/config.json flat  -a 0x5ca10ec3f005BaEE952Ff80fdFc8CA1C80912C9d --dry-run --csv test.csv`

Please note the wallet address specified in the command, the syntax needs to be perfect including differentiating forward and backslashes, and the version needs to be the latest VIDPOOL version. This command will yield a “CSV” file that can be opened in excel. You can name it whatever you want but I named it Test. This is what the output looks like:

delegator tx start end rate duration rate per second duration (seconds) stake amount cumulative
0x1874989cCb31eEf7ED4ac1ac000EB3D476263B16 0x216cc47925eb90c6d19ddaec8258551ab45076bfe5ff8b457472d50de2c6e2b2 10339814 10342583 0.2/year 10h7m23s 6.34196E-09 36443 3E+18 6.9336E+14 6.9336E+14
0x1874989cCb31eEf7ED4ac1ac000EB3D476263B16 0x216cc47925eb90c6d19ddaec8258551ab45076bfe5ff8b457472d50de2c6e2b2 10342583 11016439 0.2/year 2497h35m45s 6.34196E-09 8.99E+06 0 0 6.9336E+14
0x2F01b5dbB27173663Bb3a6eBB4E4FC503f6fC257 0xee373eed5939e9acf6c1b6baa5f338398aaac06ec7976655b186ea687375c11f 10391408 10738190 0.2/year 1285h16m21s 6.34196E-09 4.63E+06 1.35E+22 3.96146E+20 3.96146E+20
0x2F01b5dbB27173663Bb3a6eBB4E4FC503f6fC257 0xee373eed5939e9acf6c1b6baa5f338398aaac06ec7976655b186ea687375c11f 10738190 11016439 0.2/year 1030h15m36s 6.34196E-09 3.71E+06 0 0 3.96146E+20
0x4B1FDe356E2D5eF91d2Eb1aA03C2724092FcB11B 0x3dd26f68d0ef838f7412719adeed371af6585da75f293c2f2804f65d52871110 10348322 10351237 0.2/year 11h1m28s 6.34196E-09 39688 5E+22 1.2585E+19 1.2585E+19
0x4B1FDe356E2D5eF91d2Eb1aA03C2724092FcB11B 0x3dd26f68d0ef838f7412719adeed371af6585da75f293c2f2804f65d52871110 10351237 11016439 0.2/year 2465h1m53s 6.34196E-09 8.87E+06 0 0 1.2585E+19
0x859942147a9f109cB4207Dcb030783D1fF7dea4C 0x61058679993aff7e65343cea2e082b001a9798a303f6e5713e1302309970dad7 10341149 10566634 0.2/year 838h15m26s 6.34196E-09 3.02E+06 5.10546E+22 9.77097E+20 9.77097E+20
0x859942147a9f109cB4207Dcb030783D1fF7dea4C 0x61058679993aff7e65343cea2e082b001a9798a303f6e5713e1302309970dad7 10566634 11016439 0.2/year 1664h26m51s 6.34196E-09 5.99E+06 0 0 9.77097E+20
0x8d2d6b523db4d84025D4b963E93462C1c0e39D47 0x751183bd7778ffea22a653cb2c982a84f00153f786c3b6e1d57ace907ab59675 10401850 10401902 0.2/year 10m54s 6.34196E-09 654 1.25E+22 5.18455E+16 5.18455E+16
0x8d2d6b523db4d84025D4b963E93462C1c0e39D47 0x751183bd7778ffea22a653cb2c982a84f00153f786c3b6e1d57ace907ab59675 10401902 11016439 0.2/year 2276h30m47s 6.34196E-09 8.20E+06 3.125E+21 1.62422E+20 1.62474E+20
0xA00843f36f6ab2E04a5f951D88b098Cd1bE02bc3 0xa10338deed1d1557b939e6e4ab6ebfb1a004fce61218fcb81ec35168f7033229 10341809 10612882 0.2/year 1007h13m30s 6.34196E-09 3.63E+06 2.32343E+21 5.34296E+19 5.34296E+19
0xA00843f36f6ab2E04a5f951D88b098Cd1bE02bc3 0xa10338deed1d1557b939e6e4ab6ebfb1a004fce61218fcb81ec35168f7033229 10612882 11016439 0.2/year 1493h6m13s 6.34196E-09 5.38E+06 0 0 5.34296E+19
0xA6b9B90a22E71fa4D67206E2e805F6dA3BeC8E74 0x9ea7dd8718d9654e8dac5ec533c07b7df24887599952adb4e3f86c280b453656 10552049 10651811 0.2/year 369h48m21s 6.34196E-09 1.33E+06 4E+22 3.37722E+20 3.37722E+20
0xA6b9B90a22E71fa4D67206E2e805F6dA3BeC8E74 0x9ea7dd8718d9654e8dac5ec533c07b7df24887599952adb4e3f86c280b453656 10651811 11016439 0.2/year 1348h59m45s 6.34196E-09 4.86E+06 0 0 3.37722E+20
0xD2E4C8A0a2848604680D7c60d60e8E099e8142c1 0x6423b65acbbb9e8810765c97563f2b076b599923bdee8f4419f060031958bbbe 10383164 11016439 0.2/year 2346h9m50s 6.34196E-09 8.45E+06 6.20096E+20 3.32157E+19 3.32157E+19
0xe682901a60bbC0D069CdbBf2306E8b798b24d320 0x7a2699b7d42d4ed4bd56fef2edb62379da4ec08fe6f033511be79fee2e88839e 10415737 10531311 0.2/year 429h37m58s 6.34196E-09 1.55E+06 1.6E+22 1.56943E+20 1.56943E+20
0xe682901a60bbC0D069CdbBf2306E8b798b24d320 0x7a2699b7d42d4ed4bd56fef2edb62379da4ec08fe6f033511be79fee2e88839e 10531311 11016439 0.2/year 1795h39m49s 6.34196E-09 6.46E+06 0 0 1.56943E+20

If you want to actually make the payments on PublicMint of fiat you need to change the run type from “FLAT” to “PAYOUT”. An example command to Dry-Run before you do it (WHICH I HIGHLY RECOMMEND) with would look like this:

docker run -t -v C:\Users\TestUser\VideoCoin:/state -w /state videocoinnetwork/vidpool:v0.2.5 -c /state/config.json payout -a worker-address --dry-run --csv rewards-dry.csv

To make it run officially after you’ve reviewed the output file, change the command to this (Make sure to remove ‘- -dry-run’:

C:\Users\Santiago> docker run -t -v C:\Users\Santiago\VideoCoin:/state -w /state videocoinnetwork/vidpool:v0.2.5 -c /state/config.json payout -a 0x5ca10ec3f005BaEE952Ff80fdFc8CA1C80912C9d --csv test.csv

I hope this helps all, please feel free to contact me on Telegram @SantiagoVelez or over email if you need help. Santiago@blockdigitalcorp.io

@devadutta @Ram_Penke @BluBlu Gentlement, if you see an error, please correct in comments below and I’ll revise the tutorial. Thanks!