Go to PolySwarm

Hosting Your Web Service


Once your Engine is working as you want in the Development Community, make sure the Webhook HTTP Server's hosting meets our requirements. Unless your Engine meets these requirements it won't pass verification for access to public communities. We will not tell you which products and services to use, what we will do here is describe the requirements and allow you to select your preferred products and services.

Publicly accessible via HTTPS

The web service accepting Webhook calls must be accessible over the open internet using HTTPS. Also, the webhook url must be a FQDN, but it can include a path.

If you are using Nginx Unit in production, they have a handy set of docs for setting up TLS and Certbot.

Support the rate limit

When creating your Webhook in PolySwarm UI, you can set a daily rate limit to control tha maximum number of bounties your Engine will receive in one 24hr period. If your Engine cannot support the configured rate limit, it is likely to fail to accept or fail to respond to too many Bounties, which can result in PolySwarm marking your Engine as Failed. If your Engine is in the Failed state, it will not receive bounties. Additionally, to get out of the Failed state, the Engine must go through the verification process again to resume access to public communities. So, make sure your hosting method allows your Engine access to enough processing power to support the configured rate limit.

High Bandwidth for Workers in File Engines

Engines that process FILE artifacts will download a lot of files, perhaps on the scale of 1 million per day, but limited by your Rate Limit setting. With many simultaneous bounties this can add up to a lot of bandwidth. Slowdowns due to limited bandwidth can cause the Engine results to arrive late to PolySwarm or prevent your webservice from receiving webhook calls. Late results do not participate in the reward process, thus will not receive NCT rewards for correct verdicts. So, make sure your hosting method provides sufficient bandwidth to support the quantity of files defined by your rate limit.

Migrating from development Webhook

If you used ngrok, or another testing server, in earlier stages of Engine development, we need to switch your Engine's Webhook configuration to refer to your production server. You will want to do this transfer before requesting verification.

Webhooks are immutable in PolySwarm, Engines are not. This is a short multi step process to switch the Engines' Webhook.

  1. Create a new Webhook for the production server.
  2. Test the Webhook to get verified
  3. Move the Engine to the disabled state.
  4. Edit the Engine and change the Webhook to the newly created Webhook.
  5. Delete the old, now-unused Webhook.
  6. Move the Engine back into the development state.
  7. Test your Engine using your Development Community.

Next Steps

With your Engine's Web Service ready for production operation, the next step is to add NCT tokens to your PolySwarm Account.

2021 © PolySwarm Pte. Ltd.