Filecoin — Methods, Chain (3/3)
API reference for Filecoin. All methods ->
Chain
The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation.
Filecoin.ChainGetBlock
Returns the block specified by the given CID.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.ChainGetBlock",
"params": [
{
"/": "bafy2bzacecbzs3i5qubhgozauss4nvifgty5zvyvf6cy6frnnznojdmfl6phe"
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Miner": "f0427989",
"Ticket": {
"VRFProof": "pbmP9mctFpH6BoFFh22uvzv8Ixx0rJq9YanJLFTRsgIWDibuomloU2UTWiN8007KBYAnB5Xj1jw7o81VJzKrUByqHUpZHWZM34CgVkuzcHPoSJpM8XGxs2GQkfNAncK2"
},
"ElectionProof": {
"WinCount": 1,
"VRFProof": "oLSLThMoFfGX4E8cDIEULGmUteJY/10nCfun3hiRE1PDIpkPOnoBACmto7/SCz1yFixgQaysEcKK6RCx1ImUW2Q9dlrj3MCbjRQtNiumTXviDqAWgoxYU55QSBDpLbel"
},
"BeaconEntries": [
{
"Round": 2787998,
"Data": "h+zHzc0DvUFIWFpFzqREiA2f3Uk4sn5NExnJJUtfju3Hlc0/dkNXq31+su9kh/q1CK69TRUy9562jx/eV4XXw1lA4QhDxBBWKoxQL/xR+zoCcfm4nzoD3HximnPCEEQA"
}
],
"WinPoStProof": [
{
"PoStProof": 3,
"ProofBytes": "pK36Z/ehsV5sqyoX/Gc64tsV2yQOW6X+p8Wy1wH03WC9VA6qyc3ZaTt4d9oI6xVniJdyHiu22yMsXfimEfVSc/UzThf8KrnIBMWZr3sSQsOVusdf1zV5zNfvDr1wccHhCjIExyinkvGRW/irioDZ49Jrm5PUvaBERIuJC4hUp0DijM8UgY7FIYTA16HHp7gbpUzU7mpofBz42tL3c/8LgOmLd7FKOh69fk0xHYaeQU1Oz3cbSSHWL8a/wRf4y3nV"
}
],
"Parents": [
{
"/": "bafy2bzaceaxasycsjnixwqqbx4o3fsspal2zspnhmdjdtyke5xwtjkut7asyw"
},
{
"/": "bafy2bzaceadqtqu4wcecrk2akfb4mw7y3bedihwanwk2l4dxbcu4fonu3x6pe"
},
{
"/": "bafy2bzacecoqk52mag2xpxn2eq3pfmyr6mafvogju4znyagmkah4oo4fjgh5i"
},
{
"/": "bafy2bzaced46b2tewkbg6qfa5jnoecvbpdn5k7loz7qsoon3m5mgeb63de46s"
}
],
"ParentWeight": "63400884650",
"Height": 2692153,
"ParentStateRoot": {
"/": "bafy2bzacec5o4ffqnp4zmkn44i6h7oajurvtsb5zvstudvgwhha7y25alt3ck"
},
"ParentMessageReceipts": {
"/": "bafy2bzacebvll7rq7wscnsgbvgdc7xeuzsp2quu4hhfx4pjvq3hydhw2auvd6"
},
"Messages": {
"/": "bafy2bzacechrvqknf26ff4pihyatewfx64ae4bawbp4ibtasy72hr63fds4iq"
},
"BLSAggregate": {
"Type": 2,
"Data": "mQuz4wd292+Qh8oeZmpl+4QX7/90Oz7VDFLgPhRjIGgvYTEj0FYAecHTaxKaH0GGDwt0nqEvoVbFGf6PA6wCNtzwpLTMqQXZrT2cFeSAtC62vOOn7KTSdqtFxJvBwX1a"
},
"Timestamp": 1679070990,
"BlockSig": {
"Type": 2,
"Data": "qiMSk+hQ1E9WGMRn2o5dQmCpz1uO8JK4oIoh8NUwybN7GzrLEaSTv1W5IGx5AAnrAIYgE1MA+Y+CQ677iBC6wD3YUpzdSIt0QCv3cbf8SJgeOVusC+x0Vo/29zRGBgU/"
},
"ForkSignaling": 0,
"ParentBaseFee": "403334159"
},
"id": 1
}
Filecoin.ChainGetBlockMessages
Returns the messages stored in the specified block.
If there are multiple blocks in a tipset, it’s likely that some messages will be duplicated. It’s also possible for blocks in a tipset to have different messages from the same sender at the same nonce. When that happens, only the first message (in a block with the lowest ticket) will be considered for execution.
This method should only be used for getting messages in a specific block.
Do not use this method to get messages included in a tipset.
To get messages included in a tipset, use Filecoin.ChainGetParentMessages which performs correct message deduplication.
Permission: read
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.ChainGetBlockMessages",
"params": [
{
"/": "bafy2bzaceblys3pf5uejw4dvqgpfumoxjnkxcz22pqkjcztj4xumva52mzthe"
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"BlsMessages": [
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
],
"SecpkMessages": [
{
"Message": {
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
},
"Signature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
],
"Cids": [
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
}
}
Filecoin.ChainGetGenesis
Returns the genesis tipset.
Permission: read
Parameters
None.
Request example
curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "Filecoin.ChainGetGenesis",
"params": [],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"Cids": [
{
"/": "bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2"
}
],
"Blocks": [
{
"Miner": "f00",
"Ticket": {
"VRFProof": "X4oDOWswmmD7fT0z3RNIPQVGS85f2dBhceeowoDiQhY="
},
"ElectionProof": {
"WinCount": 0,
"VRFProof": null
},
"BeaconEntries": [
{
"Round": 0,
"Data": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
}
],
"WinPoStProof": null,
"Parents": [
{
"/": "bafyreiaqpwbbyjo4a42saasj36kkrpv4tsherf2e7bvezkert2a7dhonoi"
}
],
"ParentWeight": "0",
"Height": 0,
"ParentStateRoot": {
"/": "bafy2bzacech3yb7xlb7c57v2xh7rvmt4skeidk7z2g36llksaz4biflblbt24"
},
"ParentMessageReceipts": {
"/": "bafy2bzacedswlcz5ddgqnyo3sak3jmhmkxashisnlpq6ujgyhe4mlobzpnhs6"
},
"Messages": {
"/": "bafy2bzacecmda75ovposbdateg7eyhwij65zklgyijgcjwynlklmqazpwlhba"
},
"BLSAggregate": null,
"Timestamp": 1598306400,
"BlockSig": null,
"ForkSignaling": 0,
"ParentBaseFee": "100000000"
}
],
"Height": 0
},
"id": 1
}