Giter VIP home page Giter VIP logo

enigma-millionaires-problem's Introduction

Enigma Millionaires Problem

Yao's Millionaires' Problem

Allows "millionaires" to enter their net worth and see who is the richest without revealing their wealth.

Implementation of the articles that introduce Enigma, the Rust programming language, the process of creating your first Enigma secret contract, and React/Redux front-end, using the latest improvements for writing secret contracts.

Instructions

Install the CLI for the Enigma Protocol Developer Testnet: npm install -g @enigmampc/discovery-cli

  1. git clone https://github.com/lauraweindorf/enigma-millionaires-problem
  2. cd enigma-millionaires-problem
  3. npm install
  4. In another terminal, start : discovery start
  5. Compile the contracts: discovery compile
  6. Migrate: discovery migrate
  7. Run the tests: discovery test

Now you're all set to run the DApp front-end:

  1. cd client
  2. npm install
  3. npm start

For more information on the client front-end, see the discovery-template-dapp repo on GitHub.

NOTE: The DApp uses the Http Web3 provider to connect to the local Ethereum blockchain (Ganache network) configured in truffle.js. An alternative implementation would be to set the Web3 provider to use MetaMask and change the address field from a dropdown to a text field.

More Info

Dependencies

For instructions on how to install and setup the Enigma Developer Testnet see the link above for Getting Started with Enigma: An Intro to Secret Contracts.

  • rustc 1.40.0-nightly
  • node 11.15
  • Docker version 19.03.5
  • docker-compose version 1.24.1
  • @enigmampc/discovery-cli 0.1.8

Contributors

Resources

enigma-millionaires-problem's People

Contributors

levackt avatar secretchaingirl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

levackt

enigma-millionaires-problem's Issues

discovery start doesn't work

After installing discovery and discovery start,
(node:6639) UnhandledPromiseRejectionWarning: #
(node:6639) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6639) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I am getting this error.

Anyone know's how to debug this?

Unhandled Rejection (Error): Given action "ENIGMA_INITIALIZED", reducer "enigma" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.

Hello, I followed your instruction but the front-end demo encountered an error as below:

Unhandled Rejection (Error): Given action "ENIGMA_INITIALIZED", reducer "enigma" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.
▶ 3 stack frames were collapsed.
App._callee$
src/components/App.js:38
35 | // Initialize enigma-js client library (including web3)
36 | const enigma = await getEnigmaInit();
37 | // Create redux action to initialize set state variable containing enigma-js client library

38 | this.props.initializeEnigma(enigma);
| ^ 39 | // Initialize unlocked accounts
40 | const accounts = await enigma.web3.eth.getAccounts();
41 | // Create redux action to initialize set state variable containing unlocked accounts
View compiled
▶ 5 stack frames were collapsed.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

Does anyone know how to solve it?

By the way, is the front-end port number 3000?

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.