This repository holds the REST API consumed by THX client and third party apps. It exposes data stored in EVM compatible blockchain networks and a MongoDB database.
https://www.docker.com/products/docker-desktop/
# Install latest openssl
brew update
brew install openssl
# Create openssl alias (optionally replace .zshrc with .bash_profile)
echo "export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" >> ~/.zshrc
source ~/.zshrc
Alternatively you can use mkcert to simplify generation of certs and easily register the root CA.
brew install nvm # mind the optional install instructions
# 1. Install/activate current nodejs defined in .nvmrc
nvm use
# 2. Provide environment variables
cp .env.example .env
# 3 Install certificates
npm run build:ssl localhost
or
mkcert -key-file certs/localhost.key -cert-file certs/localhost.crt localhost
# 4. Install node-canvas binaries for your OS
# MacOS
brew install pkg-config cairo pango libpng jpeg giflib librsvg
# Ubuntu
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
# Alpine
apk add build-base g++ cairo-dev jpeg-dev pango pango-dev giflib-dev imagemagick freetype fontconfig
# 5. Install packages
npm ci
A thx_hardhat container with prefilled wallets and all required contracts will be deployed automatically.
# 1. Start containers
docker compose up
# 2. Start app
npm start
#Runs all suites
npm test
#Runs a specific test by file name
npm test <file_name_part>
npm run migrate:create name-of-my-migration
A new file will be created inside migrations folder with a corresponding timestamp.
|_ migrations/
|- 20210108114324-name-of-my-script.js
# To get the migration status
npm run migrate:status
# To run your migrations, simply run the command
npm run migrate
# To rollback a migration use the down command
npm run migrate:undo-last
# To get the contracts artifacts upgraded:
1. npm i @thxnetwork/[email protected] --save
2. Update hardhat-thx-artifacts version in docker-compose.yml
3. docker compose pull
3. docker compose up