Skip to content

A community-curated registry of marketplaces on the district0x Network.

License

Notifications You must be signed in to change notification settings

district0x/district-registry

Repository files navigation

District Registry

CircleCI

A community-curated registry of marketplaces on the district0x Network.

Development

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

Smart Contract Architecture

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 and ChallengeFactory are separate contracts which are used inside of RegistryEntry.
  • Functionality to stake district is split into separate StakeBank and StakeBankFactory contracts which are used inside of District.
  • Functionality for bonding curve math (power functions) is split into separate Power and PowerFactory contracts that are used in StakeBank.

Using Makefile

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

Github Actions CI

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

About

A community-curated registry of marketplaces on the district0x Network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published