📁
filecoin.loans
  • Introduction
  • Protocol
    • Lend FIL - ERC20 Tokens as Collateral
    • Lend ERC20 Tokens - FIL as Collateral
  • Develop
    • Requirements
    • Quickstart Guide
      • Setting up the Hardhat node
      • Running the server
      • Running the app
      • Setting up Metamask
  • Reference guide
    • Filecoin Loans Contracts
      • Interfaces
        • IBLAKE2b
        • IERC20
        • IPriceAggregator
      • Contracts
        • ERC20CollateralLock
        • ERC20Loans
    • API Reference
      • operation
        • FIL - ERC20 loan operations
        • ERC20 - FIL loan operations
      • loanAssets
      • protocolContracts
      • orders
      • loan
      • loans
      • notification
      • activity
  • Tools
    • filecoin-js-signer
      • API Reference
        • FilecoinSigner
          • msig
          • paych
          • tx
          • wallet
        • FilecoinClient
          • msig
          • paych
          • tx
          • wallet
      • Develop Guide
      • Credits and references
Powered by GitBook
On this page
  • Setting up the environment variables
  • Installing dependencies
  • Starting the server and database
  • Saving the addresses of the deployed contracts

Was this helpful?

  1. Develop
  2. Quickstart Guide

Running the server

Actions described here are executed in the web module.

Setting up the environment variables

Create a .env file with the schema of the .env.example file.

DB_HOST="your db host"
DB_USER="your db user"
DB_PASSWORD="your db password"
DB_NAME="your db name"
JWT_SECRET="your secret"
PORT="port of the app"
NODE_ENV=dev
SERVER_HOST=http://host:port
API_HOST="http://host:port/api/"
API_WALLET="wallet api url"
REACT_HOST=http://rect_host:react_port

Do not add this file to the control version system

Installing dependencies

$ npm install

Starting the server and database

$ npm run test

A server should be started at the defined port and a database with the specified name should be created with its tables.

Saving the addresses of the deployed contracts

You only need to save the addresses of the deployed contracts once.

If it is the first time you are running the project or you deploy a new contract, you must register it in the database.

Insert the addesses of protocol contracts into the protocolLabs table and addresses of assets into loansAssetstable.

You can fill the other fields as you prefer.

PreviousSetting up the Hardhat nodeNextRunning the app

Last updated 4 years ago

Was this helpful?