Add file with name .env
(it's not a file extension, it's literally a file name) to the root of the application's folder with a content
DB_HOST=mongodb
DB_NAME=epochFighters
SERVER_PRIVATE_KEY=<private key of account with minter role>
RPC_NODE_URL=https://rpc.ankr.com/polygon_mumbai/
CHAIN_ID=80001
CONTRACT_ADDRESS=0xb42C39123017cf9a95cF752eCff09C1893De4d9C
And change placeholder to the private key that you used for deploy contract.
-
Install Docker for Windows or Docker for Mac (If you're on Windows 7 install Docker Toolbox: http://docker.com/toolbox).
-
Open a command prompt.
-
Run the commands listed in
node.dockerfile
(see the comments at the top of the file). -
Navigate to http://localhost:3000.
-
Install Docker for Windows or Docker for Mac (If you're on Windows 7 install Docker Toolbox: http://docker.com/toolbox).
-
Open a command prompt at the root of the application's folder.
-
Run
docker-compose build
-
Run
docker-compose up
-
Open another command prompt and run
docker ps -a
and note the ID of the Node container -
Run
docker exec -it <nodeContainerID> sh
(replace with the proper ID) to sh into the container -
Run
node dbSeeder.js
to seed the MongoDB database -
Type
exit
to leave the sh session -
Navigate to http://localhost:3000
-
Run
docker-compose down
to stop the containers and remove them.
-
Install and start MongoDB (https://docs.mongodb.com/manual/administration/install-community/).
-
Install the LTS version of Node.js (http://nodejs.org).
-
Open
config/config.development.json
and adjust the host name to your MongoDB server name (localhost
normally works if you're running locally). -
Run
npm install
. -
Run
node dbSeeder.js
to get the sample data loaded into MongoDB. Exit the command prompt. -
Run
npm start
to start the server. -
Navigate to http://localhost:3000 in your browser.