# Worker Setup - VidPool

### 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vividlabs.com/worker-hub/videocoin-pool-software/worker-setup-vidpool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
