Code Monkey home page Code Monkey logo

caishen's Introduction

CaiShen

This Ethereum smart contract is a time-locked trust fund marketed as smart red packet. The contract has been deployed to the Ropsten testnet. You can interact with it using any MetaMask-enabled browser.

Web Frontend

The source code for the web frontend can be found in the web directory. It is a preact app and is served through a Django webserver.

To build the frontend and deploy it to Heroku, set up a Heroku app and create a git remote named heroku which points towards:

https://git.heroku.com/<your Heroku app name>.git

(See this guide for more information: https://devcenter.heroku.com/articles/git)

Set the DJ_SECRET_KEY config variable in the Heroku app dashboard to a long and random string (https://dashboard.heroku.com/apps -> Name of the app ->Settings -> Config Variables). This will be used as the secret key in Django's settings.py.

Then install build dependencies and run build_and_deploy.sh:

sudo yarn global add gulp
cd web/app/frontend
yarn install
cd ../../..
./build_and_deploy.sh <commit message>

build_and_deploy.sh uses gulp to build and package the JS frontend, and then pushes the Django project to Heroku.

Smart Contract

You must have Yarn on your system. Install it if you haven't already using the instructions here.

Once you have installed Yarn, install the Truffle Framework.

sudo yarn global add truffle

Finally, install Ganache.

Clone the repository

git clone [email protected]:weijiekoh/dajidali.git &&
cd dajidali &&
yarn install

Run tests

Launch Ganache and run:

truffle test

It's a good idea to restart Ganache (Settings -> Restart) before each time you run truffle test.

Note that truffle test is not deterministic. If any tests fail, restart Ganache and run each failing test individually. For example:

truffle test test/test_give.js

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.