To use this project first make sure you have npm installed. These are dependency managers that will download everything you need for the project.
You must add a file named mnemonic.txt
in the root directory containing your 12-word seed phrase. This file must be one line.
npm
must be installed on the machine you wish to test on.
Oasis is built with:
- React
- Truffle
- Ganache
To get Charity Blockchain up and running on your local machine, run the following in a terminal:
$ git clone [email protected]:sswensen/Charity-Blockchain.git // Clone repo
You can run the provided script to install all dependencies and deploy the contracts or you can do them manually.
$ ./update.sh // Install everything automatically
Install dependencies manually:
$ cd client
$ npm install // Install all dependencies
$ cd ..
$ npm install
Compile and deploy contracts to your local test net (Ganache):
$ truffle compile
$ truffle migrate
Compile and deploy contracts to Rinkeby:
$ truffle migrate --network rinkeby
Note: You must have a file named mnemonic.txt
in the root directory containing your 12-word seed. This file must be one line.
To run in development mode (from the client
directory):
$ npm run dev
To run in production mode:
$ cd client // Move into client directory
$ npm run build // Create bundle.js for index.html to reference
$ cd .. // Move back into project root
$ npm start // Start the express server
Both development and production will run on port 7777
unless otherwise specified.
Ensure you have the Heroku CLI installed and run
$ heroku local web
Your app should now be running on http://localhost:7777/.
To deploy to Heroku, first commit all changes to git.
$ git add .
$ git commit -m "Created something awesome"
$ heroku login
$ heroku create
$ git push heroku master
This will create a Heroku app. To open it run heroku open
.