Services Dexanode
  • Mapping Networks
    • Mapping Networks
  • Mainnet
    • Planq Network
      • Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Lambda Network
      • Installation
    • Ununifi
      • Installation
      • Manual Installation
    • Lambda Network
  • Testnet
    • CreditCoin (Polkadot)
    • BEVM Incentiviced Testnet Full Node
      • Binaries
      • Docker
    • Dymension Froopyland
      • Create Pull Request
      • Deploy NFT & Smart Contract
    • Noria
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Artela
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Empower
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Cross Finance
      • Installation
      • Upgrade
      • Snapshot
      • Statesync
      • Tool and Services
    • Eclipse Testnet
      • Eclipse Testnet Bridge Quest
    • Polymer
      • Polymer With Docker
      • Polymer Challenge 4
      • Polymer Challenge 4 Gitpod
    • Risc Zero Contributed Phase 1
  • Page 2
  • Tooling Service
    • Create Custom Endpoint Cosmos
    • Create custom endpoint Initia Node
    • Create Snapshoot
  • Page
Powered by GitBook
On this page
  1. Tooling Service

Create Custom Endpoint Cosmos

PreviousPage 2NextCreate custom endpoint Initia Node

Last updated 1 year ago

Prepare Domain and Subdomain

Install Packagee

sudo apt autoremove nodejs -y
curl -fsSL https://deb.nodesource.com/setup_16.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 

Prepare set Custom API and RPC

** example (change .planqd)
nano $HOME/.planqd/config/app.toml
  • on API Configuration change false to enable

  • and save on your notepad API local 0.0.0.0:1417

**example (change .planqd)
nano $HOME/.planqd/config/config.toml
  • and save on your notepad RPC local 127.0.0.0:14657

SET VARIABLE

API_DOMAIN=YOUR_API_DOMAIN
RPC_DOMAIN=YOUR_RPC_DOMAIN
API_IP_PORT=IP:PORT
API_RPC_PORT=RPC:PORT

CREATE CONFIG

Config For API

sudo cat <<EOF > /etc/nginx/sites-enabled/${API_DOMAIN}.conf
server {
    server_name $API_DOMAIN;
    listen 80;
    location / {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Expose-Headers Content-Length;

	proxy_set_header   X-Real-IP        \$remote_addr;
        proxy_set_header   X-Forwarded-For  \$proxy_add_x_forwarded_for;
        proxy_set_header   Host             \$host;

        proxy_pass http://$API_IP_PORT;

    }
}
EOF

Config For RPC

sudo cat <<EOF > /etc/nginx/sites-enabled/${RPC_DOMAIN}.conf
server {
    server_name $RPC_DOMAIN;
    listen 80;
    location / {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Expose-Headers Content-Length;

	proxy_set_header   X-Real-IP        \$remote_addr;
        proxy_set_header   X-Forwarded-For  \$proxy_add_x_forwarded_for;
        proxy_set_header   Host             \$host;
	
	proxy_http_version 1.1;
        proxy_set_header Upgrade \$http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_pass http://$RPC_IP_PORT;

    }
}
EOF

Config Test

sudo pkill nginx
nginx -t 

Outputt if test ok

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

Install Certificate SSL

sudo certbot --nginx --register-unsafely-without-email
sudo certbot --nginx --redirect -d ${API_DOMAIN},${RPC_DOMAIN}

Done

*** For GRPC settings it is the same as above