Home

Awesome

Integration

Integrates prosopo repositories in a development environment

Prerequisites

Usage

git clone git@github.com:prosopo-io/integration.git

Development Environment Set Up

The following instructions explain how to set up a developer environment in which changes can be made to the various JavaScript packages.

Pull Submodules

Start by pulling submodules. Run the following command from the root of the integration repository.

git submodule update --init --recursive --force --checkout

Set up Containers

Setup your integration containers by running the following command from the root of the integration repository.

docker compose --file docker-compose.development.yml up -d

This does the following:

  1. Pulls and starts a substrate node container containing pre-deployed protocol, dapp-example, and demo-nft-marketplace contracts.
  2. Pulls and starts up a mongodb container.

Install node modules

Install the node modules and build the workspace by running the following command from the root of the integration repository.

npm i && npm run build

Set up a Provider

Providers are the nodes in the network that supply CATPCHA. Run the following command from the root of the integration repository to register a Provider and a Dapp in the Protocol contract and start the Provider API.

npm run setup && npm run start

You can simply run npm run start on subsequent runs.

Command Details

CommandDescription
npm run setupRegisters the Provider and a Dapp in the Protocol contract
npm run startStarts the provider API

Debugging and Testing a Frontend App

You can now start one of the frontend demos to begin receiving CAPTCHA challenges in the browser. See the READMEs in each of the demos for information on how to run them.

Running Tests

Stop your development environment, if it is running.

docker compose --file docker-compose.development.yml down

Set up the test environment and run the tests by running the following command from the root of the integration repository.

npm run test

This will create a test docker environment, register a test Provider, and create a test env file before running the tests in provider.