VidPool Worker Setup

Configuration

TODO provide a centralized place for production configuration.

Below is the example of the configuration file.

{
"DataDir": "/state/",
"KeyFile": "<PROVIDE PATH TO THE WORKER KEY>",
"Password": "<PASSWORD FOR WORKER KEY>",
"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": "<PROVIDE CLIENT ID FROM VIDEOCOIN CONSOLE>",
"AuthURL": "d.dev.videocoin.network:5008"
}
}

Image

Pull image using:

docker pull registry.videocoin.net/vidpool/vidpool:latest

Persistent state

The application requires directory for persisting state for the safety and correctness of the application. Make sure to mount a directory from your local machine to docker instance, such as:

In the example below I created a directory /var/vidstate on my local machine. You can also put a config as config.json inside this directory, and application will pick it up.

docker run -ti -v /var/vidstate:/state -w /state registry.videocoin.net/vidpool/vidpool payout

Execution safety

VideoCoin pool software keeps track of the executed payouts. It does it by tracking last processed block. In the default configuration last processed block is stored on your file system. If it will be lost - manual intervention will be required to avoid processing same rewards twice.

In order to make it more robust you can deploy a simple smart contract on VideoCoin blockchain, the sole responsibility of this contract is to keep last processed block.

docker run -ti -v /tmp/vidconf:/state -w /state registry.videocoin.net/vidpool/vidpool deploy

After the contract is deployed, please update configuration parameter BlockContractAddress .

Following is the updated vidpool example configuration file:

{ 
  "DataDir": "/state/", 
  "KeyFile": "worker.json", 
  "Password": "*******",
  "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/xxxxxxxxxxxxxxxxxxxxxxxxxx",
  "Rate": { "Decimal": 0.10, "Unit": "year" }, 
  "Safety": 7,
  "GasPriceAddress": "0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C"
}

Example vidpool command usage:
docker run --rm -t -v /var/vidstate:/state -w /state videocoinnetwork/vidpool flat -c config.json

  • Place the configuration file (config.json) in container mounted volume i.e. /var/vidstate. Place the wallet keyfile worker.json aslo in the mounted volume.
  • map the mounted volume to the working directory with -w option
  • The above example is for Linux. For windows use the suitable mount volume path.
  • Use flat payment option to pay delegators using ERC-20 VID.
  • You may use --dryrun option to generate the payment report (suppress the actual payment)