Giter Site home page Giter Site logo

blockhack-1's Introduction

Win-Win demo for Blockhack 2021

Setup

Start Neo4j

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --env NEO4J_AUTH=neo4j/thyraedwards \
    --ulimit=nofile=40000:40000 \
    --env 'NEO4JLABS_PLUGINS=["apoc"]' \
    neo4j

Start PAB

In winwin-pab:

cabal build plutus-starter-pab && cabal exec -- plutus-starter-pab

Create some wallets and get ids and pkh

Run demo.sh and take note of the outputs for later use.

Start Web Back-End

Install dependencies in winwin-be via npm i.

Create a .env file with these environment variables:

  • NEO4J_PASSWORD (set it to thyraedwards if you used the docker command above)
  • PLATFORM_PUB (taken from the demo.sh output)
  • Mailjet settings (MJ_KEY and MJ_SECRET)

Then run npm start.

Start Web Front-End

Install dependencies in winwin-fe via npm i.

Run npm run start:local.

Demo Prep (skipping some boring stuff)

Sign up a mediator using the wallet id and pkh from before.

Happy Path Demo Time

Sign up Party A (e.g. Vitalik B) and go through the flow.

Make sure to keep an eye on the log of the PAB when paying for the mediation.

Open the invitation email for Party B in another browser, enter details, pay, be happy that it all worked.

Happy, but out of scope

Not in scope for the demo is the grabbing of the funds. Testing of the proper functionality (incl. who can call the endpoints at what times) can be accomplished through scripts utilizing curl or other http clients. See the run.sh in the winwin-pab directory.

The contract pays out 10% to the platform and 90% to the mediator. It is largely based on the Plutus Capstone, which unfortunately had a bug that I nor the mentors did not catch in time.

blockhack-1's People

Contributors

manonthemat avatar

Watchers

James Cloos 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.