Integrates prosopo repositories in a development environment
- protocol
- provider
- contract
- procaptcha
- procaptcha-react
- client-example
- demo-nft-marketplace
- dapp-example
- ability to run bash scripts
- docker (tested on v20.10.8 / v20.10.11/ v20.10.14, used 4CPUs, 6GB of memory, 2GB of swap)
- docker compose v2+
git clone git@github.com:prosopo-io/integration.gitThe following instructions explain how to set up a developer environment in which changes can be made to the various JavaScript packages.
Start by pulling submodules. Run the following command from the root of the integration repository.
git submodule update --init --recursive --force --checkoutSetup your integration containers by running the following command from the root of the integration repository.
docker compose --file docker-compose.development.yml up -dThis does the following:
- Pulls and starts a substrate node container containing pre-deployed protocol, dapp-example, and demo-nft-marketplace contracts.
- Pulls and starts up a mongodb container.
Install the node modules and build the workspace by running the following command from the root of the integration repository.
npm i && npm run buildProviders 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 startYou can simply run npm run start on subsequent runs.
| Command | Description |
|---|---|
npm run setup |
Registers the Provider and a Dapp in the Protocol contract |
npm run start |
Starts the provider API |
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.
- demo-nft-marketplace (full marketplace)
- client-example (minimal implementation)
Stop your development environment, if it is running.
docker compose --file docker-compose.development.yml downSet up the test environment and run the tests by running the following command from the root of the integration repository.
npm run testThis will create a test docker environment, register a test Provider, and create a test env file before running the tests in provider.