A community-curated registry of marketplaces on the district0x Network.
Compile contracts (assumes you have truffle
installed):
truffle migrate --f 2 --to 2;
Start server:
ganache-cli -p 8549
lein repl
(start-server!)
node dev-server/district-registry.js
# Redeploy all smart contracts
(district-registry.server.dev/redeploy)
Start UI:
lein repl
(start-ui!)
# go to http://localhost:4177/
Start tests:
ganache-cli -p 8549
lein test-dev
Contract architecture mostly follows that of Meme Factory as District Registry was initially forked from Meme Factory. The primary differences are related to minimizing contract sizes. Meme Factory uses a RegistryEntryLib
library to provide most of the functionality for registry entries. However, District Registry entries may need to accommodate multiple challenges and District
(the primary registry entry) has substantial additional functionality, so District Registry takes a different approach. The primary differences are as follows:
- Instead of integrating challenges into registry entries,
Challenge
andChallengeFactory
are separate contracts which are used inside ofRegistryEntry
. - Functionality to stake district is split into separate
StakeBank
andStakeBankFactory
contracts which are used inside ofDistrict
. - Functionality for bonding curve math (power functions) is split into separate
Power
andPowerFactory
contracts that are used inStakeBank
.
The Docker-compose file and Makefile provide convenient way to automate routine procedures. Try running make
to see the list of available commands. For example to build docker images for one the given environments, simply run:
make build-images BUILD_ENV={prod|qa|dev}
Those images will get tags similar to registry-ui:${COMMIT_ID}-${BUILD_ENV}
.
It is also possible to build and start a dev image that contains all the necessary tools to build, test and run distirct-registry:
make init # --> create docker volumes, networks and build containers
make build-dev-image # ---> to build base dev image with all the tools included
make exec #---> start dev container and enter interactive shell
The CI checks for this repository include:
- Dockerfile linting with Hadolint
- Docker images build for ui and server with qa and prod settings
- Docker images and vulnerability scannings with CodeQL and Trivy