Giter Site home page Giter Site logo

w3f-grants-archive / integration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prosopo/integration

0.0 0.0 0.0 399 KB

Integration repository demonstrating how to run procaptcha, provider, and protocol services together

License: Apache License 2.0

Makefile 3.98% Dockerfile 14.41% Shell 81.61%

integration's Introduction

Integration

Integrates prosopo repositories in a development environment

Prerequisites

  • 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+

Usage

git clone [email protected]: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

Command Description
npm run setup Registers the Provider and a Dapp in the Protocol contract
npm run start Starts 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.

integration's People

Contributors

forgetso avatar lupus7 avatar vinceferro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.