Skip to content

Commit

Permalink
fix: allows local env to be used for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodressel committed Apr 23, 2024
1 parent 8cfbf40 commit a5a9370
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
REDIS_HOST=localhost
REDIS_PORT=6379
NODE_URL=https://mainnet.aeternity.io
COMPILER_URL=https://latest.compiler.aepps.com
CONTRACT_V1_ADDRESS=ct_2AfnEfCSZCTEkxL5Yoi4Yfq6fF7YapHRaFKDJK3THMXMBspp5z
CONTRACT_V3_ADDRESS=ct_2Hyt9ZxzXra5NAzhePkRsDPDWppoatVD7CtHnUoHVbuehwR8Nb
TOKEN_REGISTRY_ADDRESS=ct_2n76BQCN3zNEjuEvHFNZtgyWPc5zizy47wNrUT3RHP2MrPKhbq
ORACLE_CONTRACT_ADDRESS=ct_7wqP18AHzyoqymwGaqQp8G2UpzBCggYiq7CZdJiB71VUsLpR4
MIDDLEWARE_URL=https://mainnet.aeternity.io/mdw
IPFS_URL=http://localhost:5001
PUBLIC_KEY=ak_yrVCHP97UWfCRGMCaojBjdSKuXD3yyC8NkzkReURd4t3jbCQW # use an account with some tokens here
PRIVATE_KEY=f38eecf78a521fcbf34d253b6681f69e0f64d99526d63e18f205e03cf30dd1248117982ba9504170f1f40c66c137c1823244dc7795950a85807793626e69ebce
AUTHENTICATION_USER=user # used for blacklisting & flagging ui, replace with your own credentials
AUTHENTICATION_PASSWORD=password # used for blacklisting & flagging ui, replace with your own credentials
NODE_ENV=production
WEBSOCKET_URL=wss://mainnet.aeternity.io/mdw/websocket
ORACLE_GETTER_ADDRESS=ct_anbp2U5VUsF6PkrX1ER1hSqj76Krpvqy97c5JBLmubBecCWui
CONTRACT_V1_GETTER_ADDRESS=ct_NR7Bd7j5LRdzvKZmrMagMkfxzG8ZPWseKQkdwWootpq4kAJY2
CONTRACT_V3_GETTER_ADDRESS=ct_2NdZ6PX9tZHWFhgcoYjthYNFF15qxjDwFSsNXRPeajEWazxkTo
# all optional
POSTGRES_PASSWORD=postgres # replace with your own credentials
POSTGRES_USER=postgres # replace with your own credentials
POSTGRES_DB=superhero
POSTGRES_HOST=localhost
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ docker-compose up -d
npm i
```

#### Start a database & redis
```bash
docker run --rm --name ipfs -p 5001:5001 -d ipfs/go-ipfs
docker run --name superhero-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=superhero -p5432:5432 -d postgres
```

#### Copy Env
```bash
cp .env.example .env
```

#### Create Database

```bash
npm run db:create
```
#### Start server

In order to run the server, an **ipfs, redis & the above mentioned env** are required

```bash
node bin/www.js
npm start
```
3 changes: 3 additions & 0 deletions bin/www.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env node
// Load environment variables
require('dotenv').config();

const http = require('http');
const Sentry = require('@sentry/node');

Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "bin/www.js",
"prepare": "husky install",
"scripts": {
"start": "node bin/www.js",
"test": "mocha modules/**/tests/*.js --exit",
"benchmark": "node benchmark.js",
"db:create": "npx sequelize-cli --config config/config.js --env development db:migrate",
Expand Down Expand Up @@ -37,6 +38,7 @@
"bignumber.js": "^9.0.1",
"cld": "^2.7.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"esm": "^3.2.25",
"express": "^4.17.1",
"express-async-errors": "^3.1.1",
Expand Down

0 comments on commit a5a9370

Please sign in to comment.