How to create RPC,API, and Json-RPC

You must have domain for this step and settup a dns records on cloudflare.com the dns records should be like this

Install depedencies and settup nginx

Connect to your Crossfi Node and following commands to install Nginx

API

Creating Your NGINX Configuration File

Configuration nginx for your API subdomain

change nodevism.com on server_name with your own domain and change port on proxy_pass with your node port configuration you can find on app.toml file

RPC

Create your nginx configuration

Configur your nginx for subdomain RPC

remember to change server_name nodevism.com with your domain and proxy_pass with your node port you can find on client.toml file

Json-RPC

create you nginx config file

configure nginx for your json-rpc subdomain

remember to change server_name nodevism.com with your domain and proxy_pass with your node port you can find on app.toml file

Activate your configuration

This command creates a symbolic link between the sites-available and sites-enabled directories, effectively enabling your configuration.

Finall step, test the NGINX configuration for syntax errors:

If the test passes without issues, reload NGINX to apply the changes

Your subdomains should now be set up and accessible via the specified subdomain addresses

all your endpoints are still using unsecure HTTP. In the next section, we'll install SSL for all our endpoints.

Install certbot

I use CertBot as our SSL manager. Install it using the following commands

SSL configuration

If everything is done correctly, your API and RPC links should now be working as follows: https://crossfi-testnet-api.nodevism.com https://crossfi-testnet-rpc.nodevism.com

Last updated