JSON-RPC
Find out how to manage and interact with the Filecoin network using the standard JSON-RPC API.
Last updated
Was this helpful?
Find out how to manage and interact with the Filecoin network using the standard JSON-RPC API.
Last updated
Was this helpful?
The easiest way to test the API is to use Curl commands. A Curl command to the Filecoin network looks something like this:
In a terminal window, use Curl to request the current chain head from a public node.\
The ChainHead endpoint doesn’t require any input parameters, so we’ve left params
an empty array []
.
The above command will output a large chunk of JSON data. You can use to prettify the output:
Each method has specific permissions that must be met before you can receive a response from a Filecoin node. Methods with the read
permission can be called by anyone at anytime, without the need for a token. All other permissions require you to send an authentication along with you request.
read
: Read node state, no private data.
write
: Write to local store / chain, and read permissions.
sign
: Use private keys stored in wallet for signing, read and write permissions.
admin
: Manage permissions, read, write, and sign permissions.
Each node implementation has different ways to generate and manage authentication tokens. Take a look at your node’s specific documentation:
If you are using a node provider service like , take a look at your providers documentation to find out how to manage authentication tokens.