Ethlance Version 2 is Currently in Development and is subject tochange before final release
Here's a high level overview of the components involved in ethlance.
The following tools are needed to run different parts making up the Ethlanceservice. Programming language tools (e.g. nodejs, python, etc.) may requirespecific versions. To simplify maintaining their versions,asdf version manager is a good tool Ethlanceproject also has .tool-versions
described with appropriate versions
Run make check
to determine whether you are missing any prerequisites
Backend development requires:
This is quite a few steps to run every time you start developing.To simplify that, a Procfile
consuming tool like Foreman(has implementations in various languages) or Invoker can be used.
Then it's easy as
❯ foreman start
08:37:22 postgres.1 | started with pid 205427
08:37:22 ipfs.1 | started with pid 205428
08:37:22 testnet.1 | started with pid 205429
08:37:22 deploy_contracts.1 | started with pid 205433
08:37:22 css.1 | started with pid 205434
08:37:22 ui.1 | started with pid 205436
08:37:22 server.1 | started with pid 205439
08:37:22 graphql.1 | started with pid 205442
08:37:22 postgres.1 | docker run \
08:37:22 ipfs.1 | ipfs daemon
08:37:22 testnet.1 | npx ganache-cli -m district0x --host 0.0.0.0 --port 8549 -l 8000000
08:37:22 css.1 | ./ui/node_modules/less/bin/lessc resources/public/less/main.less resources/public/css/main.css
08:37:22 postgres.1
<...>
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 nodedependencies 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
In order for the front-end to be able to have the JWT token (kept in LocalStorage), you must sign a transaction. Currently it can be done manually. Open REPL for UI:
lein repl :connect 54872
(shadow/repl :dev-ui)
(in-ns 'ethlance.ui.event.sign-in)
(re/dispatch [:user/sign-in])
Authorization: Bearer ...
headerThen to generate some example data you can use server REPL:
lein repl :connect 54872
(shadow/repl :dev-server)
(in-ns 'tests.graphql.generator)
(generate-for-address "0xafcf1a2bc71acf041c93012a2e552e31026dfeab")
[tests.graphql.generator :as test-data-generator]
to ethlance.server.core
)Make sure you are using NodeJS LTS Version. (Latest LTS Version isv10.16.3 as of this posting)
GCC 8+ do not work with some of the district libraries. This mightchange in the future. Please use GCC Version 6, or GCC Version 7.
Our local development environment requires a testnet in order to runsmart contracts. Ethlance Development uses ganache-cli with a defaultconfiguration.
$ make testnet # Run in a separate terminal
IPFS is an essential technology in ensuring that large blobs of datacan 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
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 firstbuild the solidity contracts, run an instance of the testnet server,and an instance of the IPFS daemon. The test runner can be run via:
./bin/repl-run "(shadow/watch :server-tests) @(promise)"
node server/tests/server-tests.js
Anyone is welcome to contribute to the ethlance project, here are some brief guidelines:
git remote add upstream https://github.com/madvas/ethlance.git
) master before pushing (git pull --rebase upstream master
)improve-readme