Create Your Participant

Developers building PolySwarm participants (Microengines, Ambassadors & Arbiters) need to be familiar with two projects:

  1. polyswarm-client: the PolySwarm "client library" that provides the abstract classes and methods upon which you will build your participant. polyswarm-client will be automatically configured for your participant via participant-template.
  2. participant-template: template scaffolding around polyswarm-client that we will customize for your participant.

Together, these projects provide you with the tools necessary to stay up to date with the latest PolySwarm features, while offering virtually unlimited flexibility in terms of dictating your participant's behavior.

PolySwarm participants built outside of the participant-template / polyswarm-client ecosystem are UNSUPPORTED.

Customize participant-template

Building an Arbiter is not yet supported by participant-template.

Install cookiecutter

participant-template is a cookiecutter project. We'll need to install cookiecutter in our PolySwarm virtualenv:

pip install cookiecutter

With cookiecutter installed, point cookiecutter to PolySwarm's participant-template:

cookiecutter https://github.com/polyswarm/participant-template

cookiecutter will present you with a series of prompts that allow you to customize the template to your participant.

Respond to participant-template Prompts

participant-template will present a series of prompts:

  • participant_type: The type of participant you're building.
  • platform: The platform on which your participant will operate.
  • participant_name: Your participant's name.
  • participant_name_slug: Accepting the default is recommended. A "sluggified" version of your participant's name.
  • project_slug: Accepting the default is recommended. A "sluggified" version of your participants type + name.
  • author_org: The name of your organization.
  • author_org_slug: Accepting the default is recommended. A "sluggified" version or your organization's name.
  • package_slug: Accepting the default is recommended. A "sluggified" version of your organization's name + your participant's name.
  • author_name: Your name.
  • author_email: Your e-mail address.

Once complete, you should have a new directory, named what was set as your project_slug.

Finalizing Your Participant

これまでのところ、cookiecutterparticipant-template のみをカスタマイズしています。自分で作成する必要がある項目が少しあります。 Search for CUSTOMIZE_HERE in your participant's directory to quickly identify all the components that require customization.

Next Steps

With participant-template's prompts complete, you're ready to move on to implementing your participant. Use the navigation menu to the left to continue to development instructions for your participant type.