title | weight | menu | ||||
---|---|---|---|---|---|---|
HTTP API |
20 |
|
Every command usable from the CLI is also available through the HTTP API. For example:
> go-filecoin swarm peers
/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z
> curl http://127.0.0.1:3453/api/swarm/peers
{
"Strings": [
"/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx",
"/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
]
}
Arguments are added through the special query string key "arg":
> curl "http://127.0.0.1:3453/api/swarm/disconnect?arg=/ip4/54.93.113.247/tcp/48131/ipfs/QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP"
{
"Strings": [
"disconnect QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP success",
]
}
Note that it can be used multiple times to signify multiple arguments.
Flags are added through the query string. For example, the %!s(MISSING) flag is the %!s(MISSING) query parameter below:
> curl "http://127.0.0.1:3453/api/object/get?arg=QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w&encoding=json"
{
"Links": [
{
"Name": "index.html",
"Hash": "QmYftndCvcEiuSZRX7njywX2AGSeHY2ASa7VryCq1mKwEw",
"Size": 1700
},
{
"Name": "static",
"Hash": "QmdtWFiasJeh2ymW3TD2cLHYxn1ryTuWoNpwieFyJriGTS",
"Size": 2428803
}
],
"Data": "CAE="
}
- /actor/ls
- /address/default
- /address/lookup
- /address/ls
- /address/new
- /bitswap/stats
- /bootstrap/ls
- /chain/head
- /chain/ls
- /client/cat
- /client/import
- /client/list-asks
- /client/payments
- /client/propose-storage-deal
- /client/query-storage-deal
- /config
- /daemon
- /dag/get
- /deals/list
- /deals/redeem
- /deals/show
- /dht/findpeer
- /dht/findprovs
- /dht/query
- /id
- /init
- /inspect/all
- /inspect/config
- /inspect/disk
- /inspect/environment
- /inspect/memory
- /inspect/runtime
- /log/level
- /log/ls
- /log/tail
- /message/send
- /message/status
- /message/wait
- /miner/collateral
- /miner/create
- /miner/owner
- /miner/power
- /miner/set-price
- /miner/update-peerid
- /mining/once
- /mining/start
- /mining/status
- /mining/stop
- /mpool/ls
- /mpool/rm
- /mpool/show
- /outbox/clear
- /outbox/ls
- /paych/cancel
- /paych/close
- /paych/create
- /paych/extend
- /paych/ls
- /paych/reclaim
- /paych/redeem
- /paych/voucher
- /ping
- /protocol
- /retrieval-client/retrieve-piece
- /show/block
- /stats/bandwidth
- /swarm/connect
- /swarm/peers
- /version
- /wallet/balance
- /wallet/export
- /wallet/import
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"actorType": "<string>",
"address": "<string>",
"balance": "<object>",
"code": {
"/": "<cid-string>"
},
"exports": {
"<string>": {
"Params": [
"<string>"
],
"Return": [
"<string>"
]
}
},
"head": {
"/": "<cid-string>"
},
"nonce": "<uint64>"
}
curl "http://localhost:3453/api/actor/ls"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Address": "<string>"
}
curl "http://localhost:3453/api/address/default"
arg
[string]: Miner address to find peerId for Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
"<string>"
curl "http://localhost:3453/api/address/lookup?arg=<address>"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Addresses": [
"<string>"
]
}
curl "http://localhost:3453/api/address/ls"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Address": "<string>"
}
curl "http://localhost:3453/api/address/new"
Show bitswap statistics.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"BlocksReceived": "<uint64>",
"BlocksSent": "<uint64>",
"DataReceived": "<uint64>",
"DataSent": "<uint64>",
"DupBlksReceived": "<uint64>",
"DupDataReceived": "<uint64>",
"MessagesReceived": "<uint64>",
"Peers": [
"<string>"
],
"ProvideBufLen": "<int>",
"Wantlist": [
{
"/": "<cid-string>"
}
]
}
curl "http://localhost:3453/api/bitswap/stats"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
"<string>"
]
}
curl "http://localhost:3453/api/bootstrap/ls"
Get heaviest tipset CIDs
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"/": "<cid-string>"
}
]
curl "http://localhost:3453/api/chain/head"
List blocks in the blockchain
long
[bool]: List blocks in long format, including CID, Miner, StateRoot, block height and message count respectively. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"height": "<object>",
"messageReceipts": [
{
"exitCode": "<uint8>",
"gasAttoFIL": "<object>",
"return": [
"<base64-string>"
]
}
],
"messages": [
{
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
],
"miner": "<object>",
"nonce": "<object>",
"parentWeight": "<object>",
"parents": "<object>",
"proof": [
"<uint8>"
],
"stateRoot": {
"/": "<cid-string>"
},
"ticket": [
"<uint8>"
],
"timestamp": "<object>"
}
]
curl "http://localhost:3453/api/chain/ls?long=<value>"
Read out data stored on the network
arg
[string]: CID of data to read Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/client/cat?arg=<cid>"
Import data into the local node
arg
[string]: Path to file to import Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"/": "<cid-string>"
}
curl "http://localhost:3453/api/client/import?arg=<file>"
List all asks in the storage market
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Error": "<error>",
"Expiry": "<object>",
"ID": "<uint64>",
"Miner": "<object>",
"Price": "<object>"
}
curl "http://localhost:3453/api/client/list-asks"
List payments for a given deal
arg
[string]: Channel id from which to list vouchers Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"amount": "<object>",
"channel": "<object>",
"condition": {
"method": "<string>",
"params": [
"<object>"
],
"to": "<object>"
},
"payer": "<object>",
"signature": [
"<uint8>"
],
"target": "<object>",
"valid_at": "<object>"
}
]
curl "http://localhost:3453/api/client/payments?arg=<dealCid>"
Propose a storage deal with a storage miner
arg
[string]: Address of miner to send storage proposal Required: yes.arg
[string]: CID of the data to be stored Required: yes.arg
[string]: ID of ask for which to propose a deal Required: yes.arg
[string]: Time in blocks (about 30 seconds per block) to store data Required: yes.allow-duplicates
[bool]: Allows duplicate proposals to be created. Unless this flag is set, you will not be able to make more than one deal per piece per miner. This protection exists to prevent erroneous duplicate deals. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Message": "<string>",
"ProofInfo": {
"CommitmentMessage": {
"/": "<cid-string>"
},
"PieceInclusionProof": "<base64-string>",
"SectorID": "<uint64>"
},
"ProposalCid": {
"/": "<cid-string>"
},
"Signature": [
"<uint8>"
],
"State": "<int>"
}
curl "http://localhost:3453/api/client/propose-storage-deal?arg=<miner>&arg=<data>&arg=<ask>&arg=<duration>&allow-duplicates=<value>"
Query a storage deal's status
arg
[string]: CID of deal to query Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Message": "<string>",
"ProofInfo": {
"CommitmentMessage": {
"/": "<cid-string>"
},
"PieceInclusionProof": "<base64-string>",
"SectorID": "<uint64>"
},
"ProposalCid": {
"/": "<cid-string>"
},
"Signature": [
"<uint8>"
],
"State": "<int>"
}
curl "http://localhost:3453/api/client/query-storage-deal?arg=<id>"
Get and set filecoin config values
arg
[string]: The key of the config entry (e.g. "api.address") Required: yes.arg
[string]: Optionally, a value with which to set the config entry Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/config?arg=<key>&arg=<value>"
Start a long-running daemon process
swarmlisten
[string]: multiaddress to listen on for filecoin network connections. Required: no.swarmrelaypublic
[string]: public multiaddress for routing circuit relay traffic. Necessary for relay nodes to provide this if they are not publically dialable. Required: no.offline
[bool]: start the node without networking. Required: no.elstdout
[bool]: Required: no.is-relay
[bool]: advertise and allow filecoin network traffic to be relayed through this node. Required: no.block-time
[string]: time a node waits before trying to mine the next block. Default: "30s". Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/daemon?swarmlisten=<value>&swarmrelaypublic=<value>&offline=<value>&elstdout=<value>&is-relay=<value>&block-time=30s"
Get a DAG node by its CID
arg
[string]: CID of object to get Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/dag/get?arg=<ref>"
List all deals
client
[bool]: only return deals made as a client. Required: no.miner
[bool]: only return deals made as a miner. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"minerAddress": "<object>",
"pieceCid": {
"/": "<cid-string>"
},
"proposalCid": {
"/": "<cid-string>"
},
"state": "<string>"
}
curl "http://localhost:3453/api/deals/list?client=<value>&miner=<value>"
Redeem vouchers for a deal
arg
[string]: CID of the deal to redeem Required: yes.from
[string]: Address to send from. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/deals/redeem?arg=<dealid>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Show deal details for CID
arg
[string]: CID of deal to query Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"deal_cid": {
"/": "<cid-string>"
},
"deal_size": "<object>",
"duration_blocks": "<uint64>",
"miner_address": "<object>",
"payment_vouchers": [
{
"amount": "<object>",
"channel_id": "<object>",
"condition": {
"method": "<string>",
"params": [
"<object>"
],
"to": "<object>"
},
"encoded_as": "<string>",
"index": "<uint64>",
"payer": "<object>",
"valid_at_block": "<object>"
}
],
"state": "<int>",
"total_price": "<object>"
}
curl "http://localhost:3453/api/deals/show?arg=<cid>"
Find the multiaddresses associated with a Peer ID.
arg
[string]: The ID of the peer to search for. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/dht/findpeer?arg=<peerID>"
Find peers that can provide a given key's value.
arg
[string]: The key whose provider Peer IDs are output. Required: yes.verbose
[bool]: Print extra information. Required: no.num-providers
[int]: The max number of providers to find. Default: "20". Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl "http://localhost:3453/api/dht/findprovs?arg=<key>&verbose=<value>&num-providers=20"
Find the closest Peer IDs to a given Peer ID by querying the DHT.
arg
[string]: The peerID to run the query against. Required: yes.verbose
[bool]: Print extra information. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Extra": "<string>",
"ID": "<peer-id>",
"Responses": [
{
"Addrs": [
"<multiaddr-string>"
],
"ID": "peer-id"
}
],
"Type": "<int>"
}
curl "http://localhost:3453/api/dht/query?arg=<peerID>&verbose=<value>"
Show info about the network peers
format
[string]: Specify an output format. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
"<object>"
curl "http://localhost:3453/api/id?format=<value>"
Initialize a filecoin repo
genesisfile
[string]: path of file or HTTP(S) URL containing archive of genesis block DAG data. Required: no.peerkeyfile
[string]: path of file containing key to use for new node's libp2p identity. Required: no.with-miner
[string]: when set, creates a custom genesis block with a pre generated miner account, requires running the daemon using dev mode (--dev). Required: no.sectordir
[string]: path of directory into which staged and sealed sectors will be written. Required: no.default-address
[string]: when set, sets the daemons's default address to the provided address. Required: no.auto-seal-interval-seconds
[uint]: when set to a number > 0, configures the daemon to check for and seal any staged sectors on an interval. Default: "120". Required: no.devnet-test
[bool]: when set, populates config bootstrap addrs with the dns multiaddrs of the test devnet and other test devnet specific bootstrap parameters. Required: no.devnet-nightly
[bool]: when set, populates config bootstrap addrs with the dns multiaddrs of the nightly devnet and other nightly devnet specific bootstrap parameters. Required: no.devnet-user
[bool]: when set, populates config bootstrap addrs with the dns multiaddrs of the user devnet and other user devnet specific bootstrap parameters. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/init?genesisfile=<value>&peerkeyfile=<value>&with-miner=<value>§ordir=<value>&default-address=<value>&auto-seal-interval-seconds=120&devnet-test=<value>&devnet-nightly=<value>&devnet-user=<value>"
Print all diagnostic information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Config": {
"api": {
"accessControlAllowCredentials": "<bool>",
"accessControlAllowMethods": [
"<string>"
],
"accessControlAllowOrigin": [
"<string>"
],
"address": "<string>"
},
"bootstrap": {
"addresses": [
"<string>"
],
"minPeerThreshold": "<int>",
"period": "<string>"
},
"datastore": {
"path": "<string>",
"type": "<string>"
},
"heartbeat": {
"beatPeriod": "<string>",
"beatTarget": "<string>",
"nickname": "<string>",
"reconnectPeriod": "<string>"
},
"mining": {
"autoSealIntervalSeconds": "<uint>",
"minerAddress": "<object>",
"storagePrice": "<object>"
},
"mpool": {
"maxNonceGap": "<object>",
"maxPoolSize": "<uint>"
},
"net": "<string>",
"observability": {
"metrics": {
"prometheusEnabled": "<bool>",
"prometheusEndpoint": "<string>",
"reportInterval": "<string>"
},
"tracing": {
"jaegerEndpoint": "<string>",
"jaegerTracingEnabled": "<bool>",
"probabilitySampler": "<float64>"
}
},
"sectorbase": {
"rootdir": "<string>"
},
"swarm": {
"address": "<string>",
"public_relay_address": "<string>"
},
"wallet": {
"defaultAddress": "<object>"
}
},
"Disk": {
"FSType": "<string>",
"Free": "<uint64>",
"Total": "<uint64>"
},
"Environment": {
"FIL_API": "<string>",
"FIL_PATH": "<string>",
"GOPATH": "<string>"
},
"FilecoinVersion": "<string>",
"Memory": {
"Swap": "<uint64>",
"Virtual": "<uint64>"
},
"Runtime": {
"Arch": "<string>",
"Compiler": "<string>",
"GoMaxProcs": "<int>",
"NumCGoCalls": "<int64>",
"NumGoRoutines": "<int>",
"NumProc": "<int>",
"OS": "<string>",
"Version": "<string>"
}
}
curl "http://localhost:3453/api/inspect/all"
Print in-memory config information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"api": {
"accessControlAllowCredentials": "<bool>",
"accessControlAllowMethods": [
"<string>"
],
"accessControlAllowOrigin": [
"<string>"
],
"address": "<string>"
},
"bootstrap": {
"addresses": [
"<string>"
],
"minPeerThreshold": "<int>",
"period": "<string>"
},
"datastore": {
"path": "<string>",
"type": "<string>"
},
"heartbeat": {
"beatPeriod": "<string>",
"beatTarget": "<string>",
"nickname": "<string>",
"reconnectPeriod": "<string>"
},
"mining": {
"autoSealIntervalSeconds": "<uint>",
"minerAddress": "<object>",
"storagePrice": "<object>"
},
"mpool": {
"maxNonceGap": "<object>",
"maxPoolSize": "<uint>"
},
"net": "<string>",
"observability": {
"metrics": {
"prometheusEnabled": "<bool>",
"prometheusEndpoint": "<string>",
"reportInterval": "<string>"
},
"tracing": {
"jaegerEndpoint": "<string>",
"jaegerTracingEnabled": "<bool>",
"probabilitySampler": "<float64>"
}
},
"sectorbase": {
"rootdir": "<string>"
},
"swarm": {
"address": "<string>",
"public_relay_address": "<string>"
},
"wallet": {
"defaultAddress": "<object>"
}
}
curl "http://localhost:3453/api/inspect/config"
Print filesystem usage information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"FSType": "<string>",
"Free": "<uint64>",
"Total": "<uint64>"
}
curl "http://localhost:3453/api/inspect/disk"
Print filecoin environment information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"FIL_API": "<string>",
"FIL_PATH": "<string>",
"GOPATH": "<string>"
}
curl "http://localhost:3453/api/inspect/environment"
Print memory usage information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Swap": "<uint64>",
"Virtual": "<uint64>"
}
curl "http://localhost:3453/api/inspect/memory"
Print runtime diagnostic information.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Arch": "<string>",
"Compiler": "<string>",
"GoMaxProcs": "<int>",
"NumCGoCalls": "<int64>",
"NumGoRoutines": "<int>",
"NumProc": "<int>",
"OS": "<string>",
"Version": "<string>"
}
curl "http://localhost:3453/api/inspect/runtime"
Change the logging level.
arg
[string]: The log level, with 'debug' the most verbose and 'panic' the least verbose. One of: debug, info, warning, error, fatal, panic. Required: yes.subsystem
[string]: The subsystem logging identifier. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
"<string>"
curl "http://localhost:3453/api/log/level?arg=<level>&subsystem=<value>"
List the logging subsystems.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
[
"<string>"
]
curl "http://localhost:3453/api/log/ls"
Read the event log.
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/log/tail"
Send a message
arg
[string]: Address of the actor to send the message to Required: yes.arg
[string]: The method to invoke on the target actor Required: no.value
[string]: Value to send with message in FIL. Required: no.from
[string]: Address to send message from. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/message/send?arg=<target>&arg=<method>&value=<value>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Show status of a message
arg
[string]: CID of the message to inspect Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"ChainMsg": {
"Block": {
"height": "<object>",
"messageReceipts": [
{
"exitCode": "<uint8>",
"gasAttoFIL": "<object>",
"return": [
"<base64-string>"
]
}
],
"messages": [
{
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
],
"miner": "<object>",
"nonce": "<object>",
"parentWeight": "<object>",
"parents": "<object>",
"proof": [
"<uint8>"
],
"stateRoot": {
"/": "<cid-string>"
},
"ticket": [
"<uint8>"
],
"timestamp": "<object>"
},
"Message": {
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
},
"Receipt": {
"exitCode": "<uint8>",
"gasAttoFIL": "<object>",
"return": [
"<base64-string>"
]
}
},
"InOutbox": "<bool>",
"InPool": "<bool>",
"OnChain": "<bool>",
"OutboxMsg": {
"Msg": {
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
},
"Stamp": "<uint64>"
},
"PoolMsg": {
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
}
curl "http://localhost:3453/api/message/status?arg=<cid>"
Wait for a message to appear in a mined block
arg
[string]: CID of the message to wait for Required: yes.message
[bool]: Print the whole message. Default: "true". Required: no.receipt
[bool]: Print the whole message receipt. Default: "true". Required: no.return
[bool]: Print the return value from the receipt. Default: "false". Required: no.timeout
[string]: Maximum time to wait for message. e.g., 300ms, 1.5h, 2h45m. Default: "10m". Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Message": {
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
},
"Receipt": {
"exitCode": "<uint8>",
"gasAttoFIL": "<object>",
"return": [
"<base64-string>"
]
},
"Signature": {
"Params": [
"<uint64>"
],
"Return": [
"<uint64>"
]
}
}
curl "http://localhost:3453/api/message/wait?arg=<cid>&message=true&receipt=true&return=false&timeout=10m"
Get the active collateral of a miner
arg
[string]: The address of the miner Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
"<object>"
curl "http://localhost:3453/api/miner/collateral?arg=<miner>"
Create a new file miner with FIL
arg
[string]: The amount of collateral, in FIL. Required: yes.sectorsize
[string]: size of the sectors which this miner will commit, in bytes. Required: no.from
[string]: address to send from. Required: no.peerid
[string]: Base58-encoded libp2p peer ID that the miner will operate. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Address": "<object>",
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/miner/create?arg=<collateral>§orsize=<value>&from=<value>&peerid=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Show the actor address of
arg
[string]: The address of the miner Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
"<object>"
curl "http://localhost:3453/api/miner/owner?arg=<miner>"
Get the power of a miner versus the total storage market power
arg
[string]: The address of the miner Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/miner/power?arg=<miner>"
Set the minimum price for storage
arg
[string]: The new price of storage in FIL per byte per block Required: yes.arg
[string]: How long this ask is valid for in blocks Required: yes.from
[string]: Address to send from. Required: no.miner
[string]: The address of the miner owning the ask. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"GasUsed": "<object>",
"MinerSetPriceResponse": {
"AddAskCid": {
"/": "<cid-string>"
},
"BlockCid": {
"/": "<cid-string>"
},
"MinerAddr": "<object>",
"Price": "<object>"
},
"Preview": "<bool>"
}
curl "http://localhost:3453/api/miner/set-price?arg=<storageprice>&arg=<expiry>&from=<value>&miner=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Change the libp2p identity that a miner is operating
arg
[string]: Miner address to update peer ID for Required: yes.arg
[string]: Base58-encoded libp2p peer ID that the miner will operate Required: yes.from
[string]: Address to send from. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/miner/update-peerid?arg=<address>&arg=<peerid>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"/": "<cid-string>"
}
curl "http://localhost:3453/api/mining/once"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
"<string>"
curl "http://localhost:3453/api/mining/start"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Active": "<bool>"
}
curl "http://localhost:3453/api/mining/status"
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/mining/stop"
View the pool of outstanding messages
wait-for-count
[uint]: Block until this number of messages are in the pool. Default: "0". Required: no.
On success, the call to this endpoint will return with 200 and the following body:
[
{
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
]
curl "http://localhost:3453/api/mpool/ls?wait-for-count=0"
Delete a message from the message pool
arg
[string]: The CID of the message to delete Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/mpool/rm?arg=<cid>"
Show content of an outstanding message
arg
[string]: The CID of the message to show Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
curl "http://localhost:3453/api/mpool/show?arg=<cid>"
Clear the queue(s) of sent messages
arg
[string]: Address of the queue to clear (otherwise clears all) Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/outbox/clear?arg=<address>"
List the queue(s) of sent but un-mined messages
arg
[string]: Address of the queue to list (otherwise lists all) Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Address": "<object>",
"Messages": [
{
"Msg": {
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
},
"Stamp": "<uint64>"
}
]
}
curl "http://localhost:3453/api/outbox/ls?arg=<address>"
Cancel a payment channel early to recover funds
arg
[string]: id of channel to cancel Required: yes.from
[string]: address of the channel creator. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/cancel?arg=<channel>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Redeem a payment voucher and close the payment channel
arg
[string]: Base58 encoded signed voucher Required: yes.from
[string]: Address of the channel target. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/close?arg=<voucher>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Create a new payment channel
arg
[string]: Address of account that will redeem funds Required: yes.arg
[string]: Amount in FIL for the channel Required: yes.arg
[string]: The block height at which the channel should expire Required: yes.from
[string]: Address to send from. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/create?arg=<target>&arg=<amount>&arg=<eol>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Extend the value and lifetime of a given channel
arg
[string]: Id of channel to extend Required: yes.arg
[string]: Amount in FIL for the channel Required: yes.arg
[string]: The block height at which the channel should expire Required: yes.from
[string]: Address of the channel creator. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/extend?arg=<channel>&arg=<amount>&arg=<eol>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
List all payment channels for a payer
from
[string]: Address for which message is sent. Required: no.payer
[string]: Address for which to retrieve channels (defaults to from if omitted). Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"<string>": {
"agreed_eol": "<object>",
"amount": "<object>",
"amount_redeemed": "<object>",
"condition": {
"method": "<string>",
"params": [
"<object>"
],
"to": "<object>"
},
"eol": "<object>",
"redeemed": "<bool>",
"target": "<object>"
}
}
curl "http://localhost:3453/api/paych/ls?from=<value>&payer=<value>"
Reclaim funds from an expired channel
arg
[string]: Id of channel from which funds are reclaimed Required: yes.from
[string]: Address of the channel creator. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/reclaim?arg=<channel>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Redeem a payment voucher against a payment channel
arg
[string]: Base58 encoded signed voucher Required: yes.from
[string]: Address of the channel target. Required: no.gas-price
[string]: Price (FIL e.g. 0.00013) to pay for each GasUnits consumed mining this message. Required: no.gas-limit
[uint64]: Maximum number of GasUnits this message is allowed to consume. Required: no.preview
[bool]: Preview the Gas cost of this command without actually executing it. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Cid": {
"/": "<cid-string>"
},
"GasUsed": "<object>",
"Preview": "<bool>"
}
curl "http://localhost:3453/api/paych/redeem?arg=<voucher>&from=<value>&gas-price=<value>&gas-limit=<value>&preview=<value>"
Create a new voucher from a payment channel
arg
[string]: Channel id of channel from which to create voucher Required: yes.arg
[string]: Amount in FIL of this voucher Required: yes.from
[string]: Address for which to retrieve channels. Required: no.validat
[string]: Smallest block height at which target can redeem. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/paych/voucher?arg=<channel>&arg=<amount>&from=<value>&validat=<value>"
Send echo request packets to p2p network members
arg
[string]: ID of peer to be pinged Required: yes.count
[uint]: Number of ping messages to send. Default: "0". Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Count": "<uint>",
"Time": "<duration-ns>"
}
curl "http://localhost:3453/api/ping?arg=<peer ID>&count=0"
Show protocol parameter details
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"AutoSealInterval": "<uint>",
"BlockTime": "<duration-ns>",
"ProofsMode": "<int>",
"SupportedSectorSizes": [
"<object>"
]
}
curl "http://localhost:3453/api/protocol"
Read out piece data stored by a miner on the network
arg
[string]: Retrieval miner actor address Required: yes.arg
[string]: Content identifier of piece to read Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
This endpoint returns a `text/plain` response body.
curl "http://localhost:3453/api/retrieval-client/retrieve-piece?arg=<miner>&arg=<cid>"
Show a filecoin block by its CID
arg
[string]: CID of block to show Required: yes.messages
[bool]: show messages in block. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"height": "<object>",
"messageReceipts": [
{
"exitCode": "<uint8>",
"gasAttoFIL": "<object>",
"return": [
"<base64-string>"
]
}
],
"messages": [
{
"meteredMessage": {
"gasLimit": "<object>",
"gasPrice": "<object>",
"message": {
"from": "<object>",
"method": "<string>",
"nonce": "<object>",
"params": "<base64-string>",
"to": "<object>",
"value": "<object>"
}
},
"signature": [
"<uint8>"
]
}
],
"miner": "<object>",
"nonce": "<object>",
"parentWeight": "<object>",
"parents": "<object>",
"proof": [
"<uint8>"
],
"stateRoot": {
"/": "<cid-string>"
},
"ticket": [
"<uint8>"
],
"timestamp": "<object>"
}
curl "http://localhost:3453/api/show/block?arg=<cid>&messages=<value>"
View bandwidth usage metrics
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"RateIn": "<float64>",
"RateOut": "<float64>",
"TotalIn": "<int64>",
"TotalOut": "<int64>"
}
curl "http://localhost:3453/api/stats/bandwidth"
Open connection to a given address.
arg
[string]: Address of peer to connect to. Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
"<peer-id>"
curl "http://localhost:3453/api/swarm/connect?arg=<address>"
List peers with open connections.
verbose
[bool]: Display all extra information. Required: no.streams
[bool]: Also list information about open streams for each peer. Required: no.latency
[bool]: Also list information about latency to each peer. Required: no.
On success, the call to this endpoint will return with 200 and the following body:
{
"Peers": [
{
"Addr": "<string>",
"Latency": "<string>",
"Muxer": "<string>",
"Peer": "<string>",
"Streams": [
{
"Protocol": "<string>"
}
]
}
]
}
curl "http://localhost:3453/api/swarm/peers?verbose=<value>&streams=<value>&latency=<value>"
Show go-filecoin version information
This endpoint takes no arguments.
On success, the call to this endpoint will return with 200 and the following body:
{
"Commit": "<string>"
}
curl "http://localhost:3453/api/version"
arg
[string]: Address to get balance for Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
"<object>"
curl "http://localhost:3453/api/wallet/balance?arg=<address>"
arg
[string]: Addresses of keys to export Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"KeyInfo": [
{
"curve": "<string>",
"privateKey": "<base64-string>"
}
]
}
curl "http://localhost:3453/api/wallet/export?arg=<addresses>"
arg
[string]: File containing wallet data to import Required: yes.
On success, the call to this endpoint will return with 200 and the following body:
{
"Addresses": [
"<string>"
]
}
curl "http://localhost:3453/api/wallet/import?arg=<walletFile>"