First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
If you wish to add your RPC, please follow this PR template
add .env.local
file to root directory
RPC_URL=http://10.13.14.230:8090/api/node/save
post code in utils/rpc.js
path
export const pushRpc = async (data)=>{
console.log(data);
const url = process.env.RPC_URL
if(url){
const protocol = data.url.startsWith("http") ? "HTTP" : "WSS";
const param = {
chain: data.chain,
protocol: protocol,
url: data.url,
};
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(param),
});
const result = await response.json();
if (result && result.success) {
alert("sucess add node");
} else {
alert(result.errMessage);
}
}
}
on page http://localhost:3000/chain/{number}
click Add RPC
button