GithubHelp home page GithubHelp logo

teutsch / example-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrsmkl/example-app

0.0 2.0 0.0 316 KB

Example Application depending on truebit-os

License: MIT License

JavaScript 27.52% Shell 0.57% HTML 3.03% C++ 68.88%

example-app's Introduction

TrueBit Example Application

NOTE This has only been tried on Ubuntu NOTE

This repository serves as an example project that uses truebit-os as a dependency.

Video demonstration

Installation

You will need:

  • npm installed
  • solc installed
  • An Ethereum node on port 8545 (ganache-cli)
  • ipfs daemon on port 5001
  • browserify installed
npm i

chmod 755 install_truebit_os.sh
./install_truebit_os.sh

browserify public/js/app.js -o public/js/bundle.js

Usage

In a separate terminal window start truebit-os in the background.

cd truebit-os
npm run truebit wasm-client/config.json

This will start up the shell. We can start a solver on account 1 like so:

start solve -a 1

In a new terminal window, we need to deploy the Scrypt contract that the webapp will be interfacing with. We can do this by running:

node deploy.js

Now that we have all the dependencies setup, we will be able to send tasks to the solver via our simple webapp.

Start up the webapp:

node index.js

And navigate to localhost:3000 in a MetaMask compatible browser.

Make sure to connect MetaMask to localhost:8545, and send the initial account some Ether so it can send transactions. The easiest way is to import the private key of an account in ganache-cli and then send some Ether to Account 1.

Once you enter some text, and press Submit. It will fire off a TrueBit task and wait for the task to complete. The TrueBit task requires two periods of timeouts so you will need to use the skip command in the truebit-os shell.

For best results (skip can be a bit finnicky):

skip 300
skip 300

Ends challenge period

skip 300
skip 300

Once the task is finalized the results should show up on the web page.

License

MIT License

example-app's People

Contributors

hswick avatar mrsmkl avatar

Watchers

James Cloos avatar Jason Teutsch 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.