Skip to main content

API Reference

Each NoVa includes a REST API. In this way, data sharing and data retrieval can be done quickly.

Request can be made in x-www-form-urlencoded and JSON formats.

Listened Ports

Different layers and networks are listened to by different ports. The use of these ports can be seen in the examples below.

The ports given are just the default ports. You can change these default ports while the Node is booting.

Default Port Number: 5000

  • Layer1

    • Mainnet: Default Port Number + 0
    • Testnet: Default Port Number + 1
    • Devnet: Default Port Number + 2
  • Layer2

    • Mainnet: Default Port Number + 100
    • Testnet: Default Port Number + 101
    • Devnet: Default Port Number + 102
  • Layer3

    • Mainnet: Default Port Number + 200
    • Testnet: Default Port Number + 201
    • Devnet: Default Port Number + 202
  • Layer4

    • Mainnet: Default Port Number + 300
    • Testnet: Default Port Number + 301
    • Devnet: Default Port Number + 302
  • Layer5

    • Mainnet: Default Port Number + 400
    • Testnet: Default Port Number + 401
    • Devnet: Default Port Number + 402
  • Layer6

    • Mainnet: Default Port Number + 500
    • Testnet: Default Port Number + 501
    • Devnet: Default Port Number + 502
  • Layer7

    • Mainnet: Default Port Number + 600
    • Testnet: Default Port Number + 601
    • Devnet: Default Port Number + 602
  • Layer8

    • Mainnet: Default Port Number + 700
    • Testnet: Default Port Number + 701
    • Devnet: Default Port Number + 702
  • Layer9

    • Mainnet: Default Port Number + 800
    • Testnet: Default Port Number + 801
    • Devnet: Default Port Number + 802
  • Layer10

    • Mainnet: Default Port Number + 900
    • Testnet: Default Port Number + 901
    • Devnet: Default Port Number + 902

Get Request Example

The format of a typical HTTP GET request is as follows(in JS/TS/C#):

Javascript / Typescript

export function GetRequest(url) {
return fetch(url).then(async (response) => {
if (!response.ok) {
throw new Error(response.statusText);
}
return JSON.stringify(await response.json());
});
}
export function GetRequest(url: string): Promise<string> {
return fetch(url).then(async (response) => {
if (!response.ok) {
throw new Error(response.statusText);
}
return JSON.stringify(await response.json());
});
}

C#

public static async Task<string> Get(string UrlAddress, int TimeOut = 0, bool UseTimeoutAsSecond = true)
{
try
{
using (var client = new HttpClient())
{
if (TimeOut > 0)
{
client.Timeout = (UseTimeoutAsSecond == true ? TimeSpan.FromSeconds(TimeOut * 1000) : TimeSpan.FromMilliseconds(TimeOut));
}
HttpResponseMessage response = await client.GetAsync(UrlAddress);
if (response.IsSuccessStatusCode)
{
HttpContent responseContent = response.Content;
return await responseContent.ReadAsStringAsync();
}
}
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
return string.Empty;
}

POST Request Example

The format of a typical HTTP GET request is as follows(in JS/TS/C#):

Javascript / Typescript

export function PostRequest(url, object) {
return fetch(url, {
method: "POST",
body: new URLSearchParams({
data: JSON.stringify(object),
}),
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}).then(async (response) => {
if (!response.ok) {
throw new Error(response.statusText);
}
return JSON.stringify(await response.json());
});
}
export function PostRequest<T>(url: string, object: T): Promise<string> {
return fetch(url, {
method: "POST",
// x-www-form-urlencoded
body: new URLSearchParams({
data: JSON.stringify(object),
}),
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}).then(async (response) => {
if (!response.ok) {
throw new Error(response.statusText);
}
return JSON.stringify(await response.json());
});
}

C#

public static async Task<string> Post(string UrlAddress, Dictionary<string, string> PostData, int TimeOut = 0, bool UseTimeoutAsSecond = true)
{
using (HttpClient client = new HttpClient())
{
if (TimeOut > 0)
{
client.Timeout = (UseTimeoutAsSecond == true ? TimeSpan.FromSeconds(TimeOut * 1000) : TimeSpan.FromMilliseconds(TimeOut));
}

HttpResponseMessage response = await client.PostAsync(UrlAddress, new FormUrlEncodedContent(PostData));
if (response.IsSuccessStatusCode)
{
HttpContent responseContent = response.Content;
return await responseContent.ReadAsStringAsync();
}
}
return string.Empty;
}

Path List


Node

TypePathDescription
GET/onlineShows the online status of the node.
GET/nodeShows the node list of all types.
GET/masterShows the node list of master type.
GET/main Shows the node list of main type.
GET/replicant Shows the node list of replicant type.

Metrics

TypePathDescription
GET/metrics/nodeShows how much node is online right now.
GET/metrics/masterShows how much master node is online right now, with its list.
GET/metrics/mainShows how much main node is online right now, with its list.
GET/metrics/replicantShows how much replicant node is online right now, with its list.
GET/metrics/blockShows how many blocks are currently on the Blockchain.

Blockchain

TypePathParametersDescription
GET/block/summaryReturns information about the last block.
GET/block/lastDisplays the contents of the last block.
GET/block/hash/{uuid}Block UUIDIndicates the block hash value for which the UUID value is given.
GET/block/status/{uuid}Block UUIDIndicates the state of the block for which the UUID value is given.
GET/currency/listShows all available currencies.
GET/info/genesisReturns the Genesis block information.
GET/info/transferIt gives the fee information of the current transactions.
GET/info/reserveReturns the reserved amount of Notus Token.

Wallet

TypePathParametersDescription
GET/balance/{walletKey}Wallet KeyReturns the balance information of the wallet to which the wallet key is given.

Transaction

info

Airdrop is only available for Testnet and Devnet.

TipPathParametersDescription
POST/send?data="preTranfer"preTransfer StructureTransfers to the specified address.
GET/transaction/status/{uuid}Tx UUIDIndicates the process state for which the UUID value is given.
GET/airdrop/{walletKey}Wallet KeyAirdrops money to the given wallet key.