V1
Search
⌃K

JSON-RPC API

This page contains all Boost API definitions. Interfaces defined here are exposed as JSON-RPC 2.0 endpoints by the boostd daemon.

Go JSON-RPC client

To use the Boost Go client, the Go RPC-API library can be used to interact with the Boost API node.
  1. 1.
    Import the necessary Go module:
go get github.com/filecoin-project/go-jsonrpc
  1. 1.
    Create the following script:
package main
import (
"context"
"fmt"
"log"
"net/http"
jsonrpc "github.com/filecoin-project/go-jsonrpc"
boostapi "github.com/filecoin-project/boost/api"
)
func main() {
authToken := "<value found in ~/.boost/token>"
headers := http.Header{"Authorization": []string{"Bearer " + authToken}}
addr := "127.0.0.1:1288"
var api boostapi.BoostStruct
closer, err := jsonrpc.NewMergeClient(context.Background(), "ws://"+addr+"/rpc/v0", "Filecoin", []interface{}{&api.Internal, &api.CommonStruct.Internal}, headers)
if err != nil {
log.Fatalf("connecting with boost failed: %s", err)
}
defer closer()
// Now you can call any API you're interested in.
netAddrs, err := api.NetAddrsListen(context.Background())
if err != nil {
log.Fatalf("calling netAddrsListen: %s", err)
}
fmt.Printf("Boost is listening on: %s", netAddrs.Addrs[0])
}
  1. 1.
    Run go mod init to set up your go.mod file
  2. 2.
    You should now be able to interact with the Boost API.

Python JSON-RPC client

The JSON-RPC API can also be communicated with programmatically from other languages. Here is an example written in Python. Note that the method must be prefixed with Filecoin.
import requests
import json
def main():
url = "http://localhost:3051/rpc/v0"
headers = {'content-type': 'application/json', "Authorization": "Bearer <token>"}
payload = {
"method": "Filecoin.BoostOfflineDealWithData",
"params": [
"<deal-uuid>",
"<file-path>",
True
],
"jsonrpc": "2.0",
"id": 1,
}
response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.text)
if __name__ == "__main__":
main()

Groups

Actor

ActorSectorSize

There are not yet any comments for this method.
Perms: read
Inputs:
[
"f01234"
]
Response: 34359738368

Auth

AuthNew

Perms: admin
Inputs:
[
[
"write"
]
]
Response: "Ynl0ZSBhcnJheQ=="

AuthVerify

Perms: read
Inputs:
[
"string value"
]
Response:
[
"write"
]

Blockstore

BlockstoreGet

There are not yet any comments for this method.
Perms: read
Inputs:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
Response: "Ynl0ZSBhcnJheQ=="

BlockstoreGetSize

Perms: read
Inputs:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
Response: 123

BlockstoreHas

Perms: read
Inputs:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
Response: true

Boost

BoostDagstoreDestroyShard

Perms: admin
Inputs:
[
"string value"
]
Response: {}

BoostDagstoreGC

Perms: admin
Inputs: null
Response:
[
{
"Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
"Success": false,
"Error": "\u003cerror\u003e"
}
]

BoostDagstoreInitializeAll

Perms: admin
Inputs:
[
{
"MaxConcurrency": 123,
"IncludeSealed": true
}
]
Response:
{
"Key": "string value",
"Event": "string value",
"Success": true,
"Error": "string value",
"Total": 123,
"Current": 123
}

BoostDagstoreInitializeShard

Perms: admin
Inputs:
[
"string value"
]
Response: {}

BoostDagstoreListShards

Perms: admin
Inputs: null
Response:
[
{
"Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
"State": "ShardStateAvailable",
"Error": "\u003cerror\u003e"
}
]

BoostDagstorePiecesContainingMultihash

Perms: read
Inputs:
[
"Bw=="
]
Response:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]

BoostDagstoreRecoverShard

Perms: admin
Inputs:
[
"string value"
]
Response: {}

BoostDagstoreRegisterShard

Perms: admin
Inputs:
[
"string value"
]
Response: {}

BoostDeal

Perms: admin
Inputs:
[
"07070707-0707-0707-0707-070707070707"
]
Response:
{
"DealUuid": "07070707-0707-0707-0707-070707070707",
"CreatedAt": "0001-01-01T00:00:00Z",
"ClientDealProposal": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
}
},
"IsOffline": true,
"CleanupData": true,
"ClientPeerID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"DealDataRoot": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"InboundFilePath": "string value",
"Transfer": {
"Type": "string value",
"ClientID": "string value",
"Params": "Ynl0ZSBhcnJheQ==",
"Size": 42
},
"ChainDealID": 5432,
"PublishCID": null,
"SectorID": 9,
"Offset": 1032,
"Length": 1032,
"Checkpoint": 1,
"CheckpointAt": "0001-01-01T00:00:00Z",
"Err": "string value",
"Retry": "auto",
"NBytesReceived": 9,
"FastRetrieval": true,
"AnnounceToIPNI": true
}

BoostDealBySignedProposalCid

Perms: admin
Inputs:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
Response:
{
"DealUuid": "07070707-0707-0707-0707-070707070707",
"CreatedAt": "0001-01-01T00:00:00Z",
"ClientDealProposal": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
}
},
"IsOffline": true,
"CleanupData": true,
"ClientPeerID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"DealDataRoot": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"InboundFilePath": "string value",
"Transfer": {
"Type": "string value",
"ClientID": "string value",
"Params": "Ynl0ZSBhcnJheQ==",
"Size": 42
},
"ChainDealID": 5432,
"PublishCID": null,
"SectorID": 9,
"Offset": 1032,
"Length": 1032,
"Checkpoint": 1,
"CheckpointAt": "0001-01-01T00:00:00Z",
"Err": "string value",
"Retry": "auto",
"NBytesReceived": 9,
"FastRetrieval": true,
"AnnounceToIPNI": true
}

BoostDummyDeal

Perms: admin
Inputs:
[
{
"DealUUID": "07070707-0707-0707-0707-070707070707",
"IsOffline": true,
"ClientDealProposal": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
}
},
"DealDataRoot": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Transfer": {
"Type": "string value",
"ClientID": "string value",
"Params": "Ynl0ZSBhcnJheQ==",
"Size": 42
},
"RemoveUnsealedCopy": true,
"SkipIPNIAnnounce": true
}
]
Response:
{
"Accepted": true,
"Reason": "string value"
}

BoostIndexerAnnounceAllDeals

There are not yet any comments for this method.
Perms: admin
Inputs: null
Response: {}

BoostMakeDeal

Perms: write
Inputs:
[
{
"DealUUID": "07070707-0707-0707-0707-070707070707",
"IsOffline": true,
"ClientDealProposal": {
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
}
},
"DealDataRoot": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Transfer": {
"Type": "string value",
"ClientID": "string value",
"Params": "Ynl0ZSBhcnJheQ==",
"Size": 42
},
"RemoveUnsealedCopy": true,
"SkipIPNIAnnounce": true
}
]
Response:
{
"Accepted": true,
"Reason": "string value"
}

BoostOfflineDealWithData

Perms: admin
Inputs:
[
"07070707-0707-0707-0707-070707070707",
"string value",
true
]
Response:
{
"Accepted": true,
"Reason": "string value"
}

Deals

DealsConsiderOfflineRetrievalDeals

Perms: admin
Inputs: null
Response: true

DealsConsiderOfflineStorageDeals

Perms: admin
Inputs: null
Response: true

DealsConsiderOnlineRetrievalDeals

Perms: admin
Inputs: null
Response: true

DealsConsiderOnlineStorageDeals

There are not yet any comments for this method.
Perms: admin
Inputs: null
Response: true

DealsConsiderUnverifiedStorageDeals

Perms: admin
Inputs: null
Response: true

DealsConsiderVerifiedStorageDeals

Perms: admin
Inputs: null
Response: true

DealsPieceCidBlocklist

Perms: admin
Inputs: null
Response:
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]

DealsSetConsiderOfflineRetrievalDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetConsiderOfflineStorageDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetConsiderOnlineRetrievalDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetConsiderOnlineStorageDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetConsiderUnverifiedStorageDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetConsiderVerifiedStorageDeals

Perms: admin
Inputs:
[
true
]
Response: {}

DealsSetPieceCidBlocklist

Perms: admin
Inputs:
[
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
]
Response: {}

I

ID

Perms: read
Inputs: null
Response: "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"

Log

LogList

Perms: write
Inputs: null
Response:
[
"string value"
]

LogSetLevel

Perms: write
Inputs:
[
"string value",
"string value"
]
Response: {}

Market

MarketCancelDataTransfer

Perms: write
Inputs:
[
3,
"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
true
]
Response: {}

MarketDataTransferUpdates

Perms: write
Inputs: null
Response:
{
"TransferID": 3,
"Status": 1,
"BaseCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"IsInitiator": true,
"IsSender": true,
"Voucher": "string value",
"Message": "string value",
"OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Transferred": 42,
"Stages": {
"Stages": [
{
"Name": "string value",
"Description": "string value",
"CreatedTime": "0001-01-01T00:00:00Z",
"UpdatedTime": "0001-01-01T00:00:00Z",
"Logs": [
{
"Log": "string value",
"UpdatedTime": "0001-01-01T00:00:00Z"
}
]
}
]
}
}

MarketGetAsk

Perms: read
Inputs: null
Response: