A example ethereum dApp project employing district0x technologies.
Requires a Linux or MacOSX Environment. This might change in the future.
- make (Distro Build Essentials)
- node
- yarn
- clj
- solc
- docker (optional)
- ganache-cli
make init
Server-side requires ganache-cli, so in a terminal run:
$ ganache-cli
Then from another terminal:
$ make dev
This should bring up a clojure repl. While in the clojure repl:
(start!) ;; Starts builds for both the server and ui.
At this point, you will want to deploy the smart contracts for the ganache-cli testnet:
(cljs-server) ;; Connect to CLJS-Server Repl
;; Wait for the CLJS-Server Repl to instantiate...
(deploy!)
Client-side requires the same facilities as the server-side until release. After you follow the steps suggested:
Exit the CLJS-Server Repl
:cljs/quit ;; Brings you back to the Clojure Repl
Connect to the CLJS-UI Repl
(cljs-ui) ;; Connect to the CLJS-UI Repl
;; Open a local browser at http://localhost:9500 to connect
(open-tests) ;; Open a separate browser tab for the test runner
Browser UI tests run along-side the main development server, and can be accessed at http://localhost:9500/test-runner.html when the dev-ui build is active.
Run Server Tests with make test
Alternatively, you can run the server tests from the CLJS-Server
Repl development environment with (run-tests)
To make a production build:
$ make build
Building does several things:
- Makes a production build of the browser UI code, and places it in ./dist/resources/cljs-out/
- Makes a production build of the node server code, and places it at ./dist/rbounty_server.js
- Copies the ./resources to ./dist/resources
- fixes the index.html file to reference the appropriate browser code.
The Production Build can be run as:
$ cd ./dist
$ node rbounty_server.js
- use `docker compose` to simplify development even more
- will be including additional technologies as seen fit for the dummy project.
- re-use this dummy project to generate district templates.