# Deployment on a Linux Serve

## Ubuntu

```
git clone https://gitlab.com/PBSA/PeerplaysIO/tools-libs/peerid/peerid-gui.git
cd peerid-gui
npm install
```

#### Configure the environment file

```
touch .env
```

Configure the `.env` with the specified values:

```
DEV_API_ROUTE='http://example.com/'
PRODUCTION_API_ROUTE='http://examples.com/'

DEV_BASE_ROUTE='http://example.com/api'
PRODUCTION_BASE_ROUTE='http://examples.com/api'

BLOCKCHAIN_ENDPOINTS='wss://example-endpoint.com/api'

PEERPLAYS_USD_ASSET_ID='1.3.0'
PEERPLAYS_ESCROW_ACCOUNT_ID='1.2.23'
PEERPLAYS_PAYMENT_ACCOUNT_ID='1.2.21'
```

Start the application (dev mode)

```
npm start
```

For a production environment build the static files:

```
npm run build
```

After building the static files, you can host them using any web server.

### PeerID-backend

{% embed url="<https://gitlab.com/PBSA/PeerplaysIO/tools-libs/peerid/peerid-backend.git>" %}

```
git clone https://gitlab.com/PBSA/PeerplaysIO/tools-libs/peerid/peerid-backend
cd peerid-backend
npm install
```

configure the `config/default.json` and `config/development.json` files:

**default.json**

```
{
  "logLevel": "trace",
  "db": {
    "user": "",
    "password": "",
    "host": "127.0.0.1",
    "port": "5432",
    "database": "peerid"
  },
  "swagger": {
    "host": "virtserver.swaggerhub.com",
    "schemes": [
      "https"
    ]
  },
  "sessionSecret": "sessionSecret",
  "cors": true,
  "port": 3000,
  "google": {
    "clientId": "",
    "clientSecret": ""
  },
  "facebook": {
    "clientId": "",
    "clientSecret": ""
  },
  "discord": {
    "clientId": "",
    "clientSecret": ""
  },
  "raven": {
    "enabled": false,
    "url": ""
  },
  "mailer": {
    "host": "smtp.gmail.com",
    "port": 587,
    "secure": false,
    "auth": {
      "user": "",
      "pass": ""
    },
    "sender": "",
    "tls": {
        "rejectUnauthorized": false
    }
  },
  "frontendUrl": "http://localhost:8082",
  "backendUrl": "http://localhost:3000",
  "frontendCallbackUrl": "http://localhost:8082/callback",
  "peerplays": {
    "peerplaysWS": "wss://irona.peerplays.download/api",
    "peerplaysFaucetURL": "https://irona-faucet.peerplays.download/api/v1/accounts",
    "referrer": "1.2.0",
    "feeAssetId": "1.3.0",
    "paymentAccountID": "1.2.21",
    "paymentAccountWIF": "5HttHcgL2NgFc5XsFY8bs51VehVDS2Tb4NGkRuwjJ6v6Mq7eC7S"
  }
}
```

**development.json**

```
{
  "logLevel": "trace",
  "db": {
    "user": "",
    "password": "",
    "host": "127.0.0.1",
    "port": "5432",
    "database": "peerid"
  },
  "swagger": {
    "host": "virtserver.swaggerhub.com",
    "schemes": [
      "https"
    ]
  },
  "sessionSecret": "sessionSecret",
  "cors": true,
  "port": 3000,
  "google": {
    "clientId": "",
    "clientSecret": ""
  },
  "facebook": {
    "clientId": "",
    "clientSecret": ""
  },
  "discord": {
    "clientId": "",
    "clientSecret": ""
  },
  "raven": {
    "enabled": false,
    "url": ""
  },
  "mailer": {
    "host": "smtp.gmail.com",
    "port": 587,
    "secure": false,
    "auth": {
      "user": "",
      "pass": ""
    },
    "sender": "",
    "tls": {
        "rejectUnauthorized": false
    }
  },
  "frontendUrl": "http://localhost:8082",
  "backendUrl": "http://localhost:3000",
  "frontendCallbackUrl": "http://localhost:8082/callback",
  "peerplays": {
    "peerplaysWS": "wss://irona.peerplays.download/api",
    "peerplaysFaucetURL": "https://irona-faucet.peerplays.download/api/v1/accounts",
    "referrer": "1.2.0",
    "feeAssetId": "1.3.0",
    "paymentAccountID": "1.2.21",
    "paymentAccountWIF": "5HttHcgL2NgFc5XsFY8bs51VehVDS2Tb4NGkRuwjJ6v6Mq7eC7S"
  }
}
```

**Start the application:**

```
npm start
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devs.peerplays.com/tools-and-integrations/peerid/1.0.0/infrastructure/deployment-on-a-linux-serve.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
