JSON-RPC methods
Avalanche RPC
You can review the official Avalanche RPC documentation HERE
Example RPC
curl https://api.chainup.net/avax/mainnet/<YOUR_API_KEY>/ext/bc/C/rpc \
-X POST \
-H 'content-type: application/json' \
-H "CONSISTENT-HASH: true" \
--data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":32}'```javascript
const axios = require('axios');
//npm install axios if you don have the module installed`
let options = {
url: "https://api.chainup.net/avax/mainnet/<YOUR_API_KEY>/ext/bc/C/rpc",
method: "post",
headers:
{
"content-type": "application/json" ,
"CONSISTENT-HASH": "true"
},
body: JSON.stringify({"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":32})
};
axios(options)
.then(response => {
console.log('Post successful: response:', response.data);
})
.catch(error => {
console.error('An error has occurred:', error);
});
```Last updated
Was this helpful?