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.
Import the necessary Go module:
go get github.com/filecoin-project/go-jsonrpcCreate 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])
}Run
go mod initto set up yourgo.modfileYou 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.
Groups
Uncategorized
Discover
Perms: read
Inputs: null
Response:
Auth
AuthNew
Perms: admin
Inputs:
Response: "Ynl0ZSBhcnJheQ=="
AuthVerify
Perms: read
Inputs:
Response:
Blockstore
BlockstoreGet
There are not yet any comments for this method.
Perms: read
Inputs:
Response: "Ynl0ZSBhcnJheQ=="
BlockstoreGetSize
Perms: read
Inputs:
Response: 123
BlockstoreHas
Perms: read
Inputs:
Response: true
Boost
BoostDeal
Perms: admin
Inputs:
Response:
BoostDealBySignedProposalCid
Perms: admin
Inputs:
Response:
BoostDirectDeal
Perms: admin
Inputs:
Response:
BoostDummyDeal
Perms: admin
Inputs:
Response:
BoostIndexerAnnounceAllDeals
There are not yet any comments for this method.
Perms: admin
Inputs: null
Response: {}
BoostIndexerAnnounceDeal
Perms: admin
Inputs:
Response: null
BoostIndexerAnnounceDealRemoved
Perms: admin
Inputs:
Response: null
BoostIndexerAnnounceLatest
Perms: admin
Inputs: null
Response: null
BoostIndexerAnnounceLatestHttp
Perms: admin
Inputs:
Response: null
BoostIndexerAnnounceLegacyDeal
Perms: admin
Inputs:
Response: null
BoostIndexerListMultihashes
Perms: admin
Inputs:
Response:
BoostLegacyDealByProposalCid
Perms: admin
Inputs:
Response:
BoostOfflineDealWithData
Perms: admin
Inputs:
Response:
Log
LogList
Perms: write
Inputs: null
Response:
LogSetLevel
Perms: write
Inputs:
Response: {}
Market
MarketGetAsk
Perms: read
Inputs: null
Response:
Net
ID
Perms: read
Inputs: null
Response: "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
NetAddrsListen
Perms: read
Inputs: null
Response:
NetAgentVersion
Perms: read
Inputs:
Response: "string value"
NetAutoNatStatus
Perms: read
Inputs: null
Response:
NetBandwidthStats
Perms: read
Inputs: null
Response:
NetBandwidthStatsByPeer
Perms: read
Inputs: null
Response:
NetBandwidthStatsByProtocol
Perms: read
Inputs: null
Response:
NetBlockAdd
Perms: admin
Inputs:
Response: {}
NetBlockList
Perms: read
Inputs: null
Response:
NetBlockRemove
Perms: admin
Inputs:
Response: {}
NetConnect
Perms: write
Inputs:
Response: {}
NetConnectedness
Perms: read
Inputs:
Response: 1
NetDisconnect
Perms: write
Inputs:
Response: {}
NetFindPeer
Perms: read
Inputs:
Response:
NetLimit
Perms: read
Inputs:
Response:
NetPeerInfo
Perms: read
Inputs:
Response:
NetPeers
Perms: read
Inputs: null
Response:
NetPing
Perms: read
Inputs:
Response: 60000000000
NetProtectAdd
Perms: admin
Inputs:
Response: {}
NetProtectList
Perms: read
Inputs: null
Response:
NetProtectRemove
Perms: admin
Inputs:
Response: {}
NetPubsubScores
Perms: read
Inputs: null
Response:
NetSetLimit
Perms: admin
Inputs:
Response: {}
NetStat
Perms: read
Inputs:
Response:
Backup
OnlineBackup
There are not yet any comments for this method.
Perms: admin
Inputs:
Response: {}
PieceDirectory
PdBuildIndexForPieceCid
There are not yet any comments for this method.
Perms: admin
Inputs:
Response: {}
PdCleanup
Perms: admin
Inputs: null
Response: {}
PdRemoveDealForPiece
Perms: admin
Inputs:
Response: {}
Last updated

