# install dependencies
npm ci
# copy and fill the env
cp example.env .env
# create DB
mysql -u root -p < ./migrations/testnet_db.sql
# start interactive mode for MySQL user creation:
mysql -u root
# and run commands
CREATE USER 'testnet_open_content'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD_HERE';
GRANT ALL PRIVILEGES ON testnet_open_content.* TO 'testnet_open_content'@'localhost';
FLUSH PRIVILEGES;
exit;
# apply migrations
npx knex migrate:latest --env development
# start deployer service via PM2
pm2 start npm --name "[Testnet] Open Content API" -- run start
# OR start the server manually
npm run start
# create new migration
npx knex migrate:make my_new_migration
# install dependencies
npm ci
# copy and fill the env
cp example.env .env
# create DB
mysql -u root -p < ./migrations/mainnet_db.sql
# start interactive mode for MySQL user creation:
mysql -u root -p
# and run commands
CREATE USER 'mainnet_open_content'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD_HERE';
GRANT ALL PRIVILEGES ON mainnet_open_content.* TO 'mainnet_open_content'@'localhost';
FLUSH PRIVILEGES;
exit;
# apply migrations
npx knex migrate:latest --env production
# start deployer service via PM2
pm2 start npm --name "[Mainnet] Open Content API" -- run start
# OR start the server manually
npm run start