Ethlance Version 2 is Currently in Development and is subject to change before final release
-
NodeJS (Latest LTS Version)
-
make
- Note: Windows users can use Msys for build essentials (Untested)
Run make check
to determine whether you are missing any prerequisites
Backend development requires:
-
instance of a figwheel server build
-
an attached node server to the figwheel server
-
a solidity contract compiler (lein-solc)
-
an local IPFS daemon with properly configured CORS privileges (ipfs)
-
a test net (ganache-cli)
Terminal 1 (cljs repl):
make fig-dev-server
Terminal 2 (node server):
# Wait for fig-dev-server prompt: 'Prompt will show when Figwheel connects to your application'
make dev-server
Terminal 3 (testnet):
make testnet
Terminal 4 (truffle):
make deploy
Terminal 5 (ipfs):
make ipfs
Terminal 1 (server repl):
(start)
;; By default, this will deploy the smart contracts, generate users
;; and scenarios, and synchronize the results within the SQLite database.
(help) ;; To review additional commands
Terminal 1 (cljs repl):
make fig-dev-ui
Terminal 2 (LESS Compiler):
make build-css watch-css
Open Browser to http://localhost:6500
Note: All instructions start in the root of the project directory
If this is a first time setup, or you accidentally ran make clean-all
, you are required to re-install additional node
dependencies with:
Tested with GCC 6 & GCC 7, does not appear to work with GCC 8
make deps
If you're having issues with your environment, you can run this command:
make clean-all deps
-
Make sure you are using NodeJS LTS Version. (Latest LTS Version is v10.16.3 as of this posting)
-
GCC 8+ do not work with some of the district libraries. This might change in the future. Please use GCC Version 6, or GCC Version 7.
Note: All instructions start in the root of the project directory
Open two terminals. In the first terminal, type:
$ make fig-dev-server
After a short while, the build will prompt for a connection.
In the second terminal, type:
$ make dev-server
The the figwheel server should establish a connection with the node development server, and a CLJS repl should be available in the first terminal.
Our local development environment requires a testnet in order to run smart contracts. Ethlance Development uses ganache-cli with a default configuration.
$ make testnet # Run in a separate terminal
IPFS is an essential technology in ensuring that large blobs of data
can be stored in a decentralized manner. After installing the ipfs
commandline tool, you need to start up a daemon for development
ipfs daemon
Note: Might require additional configuration for CORS
ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST", "OPTIONS"]'
ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Headers '["X-Requested-With"]'
ipfs config --json Gateway.Writable true
If all of the previous sections are completed, we can perform a smart contract deployment on the testnet through the fig-dev-server CLJS-REPL.
While in the Figwheel Server CLJS REPL, type:
(start) ;; Reloaded Lifecycle
You should see activity in the ganache-cli
testnet server.
Ethlance product can be prepared for deployment by running:
$ make build
This compiles everything and places it in the ./dist folder
After building, the production build can be run:
$ make run
To run all of the tests in a standalone test runner, you must first build the solidity contracts, run an instance of the testnet server, and an instance of the IPFS daemon. The test runner can be run via:
make clean deploy test
Anyone is welcome to contribute to the ethlance project, here are some brief guidelines:
- Make sure to squash your commits
- Reference issue numbers in your pull request
- Rebase your changes on upstream (
git remote add upstream https://github.com/madvas/ethlance.git
) master before pushing (git pull --rebase upstream master
) - Make changes in a separate well-named branch in your forked repo
like
improve-readme