JSON-RPC
Find out how to manage and interact with the Filecoin network using the standard JSON-RPC API.
Quick start
The easiest way to test the API is to use Curl commands. A Curl command to the Filecoin network looks something like this:
Step-by-step example
In a terminal window, use Curl to request the current chain head from a public Glif 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 JSON processor JQ to prettify the output:
Permissions
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.
Authentication
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 Glif, take a look at your providers documentation to find out how to manage authentication tokens.
Last updated