# Ping.pub explorer setup

## How to Set Up Ping.Pub Explorer for Crossfi

![](https://nodescenter.coinsspor.com/~gitbook/image?url=https:%2F%2F3390829839-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FoPw40U3FOx8iotsnZ94g%252Fuploads%252FdO0ckydjg6ufK8XJCP6B%252Fimage.png%3Falt=media%26token=f492ccef-4fd0-434c-a72a-52e64d05b6db\&width=768\&dpr=4\&quality=100\&sign=f463b3417e8fbcc7e2a8cef82468955695e4f48165cee457040f3c0951873fca)

#### Install Dependencies <a href="#install-dependencies" id="install-dependencies"></a>

Remove any existing versions of Node.js and install the required packages:

Copy

```
sudo apt autoremove nodejs -y
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx nodejs git yarn -y
```

#### NGINX Configuration <a href="#nginx-configuration" id="nginx-configuration"></a>

**File Configuration**

Create an NGINX configuration file for your explorer:

Copy

```
sudo nano /etc/nginx/sites-enabled/your_explorer_server.conf
```

Replace `your_explorer_server.conf` with your site's name, for example:

Copy

```
sudo nano /etc/nginx/sites-enabled/explorer.dnsarz.xyz.conf
```

Create this sample configuration:

Copy

```
server {
    listen       80;
    listen  [::]:80;
    server_name explorer.dnsarz.xyz;

    location / {
        root /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    gzip on;
    gzip_proxied any;
    gzip_static on;
    ...
}
```

Remember to replace `server_name` with your server's name.

#### SSL Configuration <a href="#ssl-configuration" id="ssl-configuration"></a>

**Install Certificate SSL**

Run Certbot to install SSL for NGINX:

Copy

```
sudo certbot --nginx --register-unsafely-without-email
```

![](https://nodescenter.coinsspor.com/~gitbook/image?url=https:%2F%2F3390829839-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FoPw40U3FOx8iotsnZ94g%252Fuploads%252Fywbu0pw36ufU7VpWzxvx%252Fimage.png%3Falt=media%26token=8bed83a0-247d-4490-91bf-7c85e7e1c9eb\&width=768\&dpr=4\&quality=100\&sign=a4a3c8784208bfc51cb3a1d94acfb0181741a21caeff3fd00fcdf9024c1a0091)

Select option 2 and press Enter. If the BOT asks for redirection, choose YES.

After completion, you can restart NGINX:

Copy

```
sudo systemctl restart nginx
```

#### Explorer Configuration <a href="#explorer-configuration" id="explorer-configuration"></a>

**Clone the Repository**

Copy

```
cd $HOME
git clone https://github.com/ping-pub/explorer
```

**Create or Edit Your Configuration File**

Copy

```
nano $HOME/explorer/chains/mainnet/crossfi.json
```

Here's an example configuration:

Copy

```
jsonCopy code{
  "chain_name": "crossfi",
  "api": [
    {"provider": "Coinsspor", "address": "https://crossfi-testnet-api.coinsspor.com/"}
  ],
  "rpc": [
    {"provider": "Coinsspor", "address": "https://crossfi-testnet-rpc.coinsspor.com/"}
  ],
  "snapshot_provider": "",
  "sdk_version": "v0.47.6",
  ...
}
```

**Build the Explorer**

Navigate to the explorer directory, install dependencies, and build:

Copy

```
cd $HOME/explorer
yarn && yarn build
```

If you encounter any issues, use the following command:

Copy

```
yarn install --ignore-engines
cd $HOME/explorer
yarn && yarn build
```

**Copy the Web Files to the Nginx HTML Folder**

Copy

```
sudo cp -r $HOME/explorer/dist/* /usr/share/nginx/html
sudo systemctl restart nginx
```

***

After completing these steps, your Ping.Pub Explorer for Crossfi should be successfully set up and accessible. Remember to replace all placeholder text (like `explorer.dnsarz.xyz`) with the actual values pertinent to your setup.
