Filecoin JSON REST API (0.1.0)

Download OpenAPI specification:Download

Filecoin JSON REST API SPEC: erik.ingenito@protocol.ai

Filecoin JSON REST API Description

Authentication

BearerTokenAuth

The authentication scheme for this API is implementation dependent. Implementations should feel free to use the scheme and granularity they deem fit. This document describes the scheme used by the go-filecoin daemon.

Go-filecoin will initially (v0) support a simple all or nothing authentication and authorization suitable for use by the owner/operator of the current node, and nothing else. Consumers of this API must provide a bearer token included in the Authorization header of each request. This token is provided by the go-filecoin node for use by the caller via some out of band mechanism (like a file created on the filesystem upon initialization or upon startup). More sophisticated authentication and authorization will follow.

The nature of this style of authentication makes it suitable for use only when served over SSL/TLS.

Here is an example of using a node provided bearer token and a node provided CA cert used for self-signed TLS with curl. This example assumes the cert and token both reside in the .filecoin folder and where generated by the go-filecoin daemon:

$ AUTH="Authorization: Bearer $(xxd -ps -u -c 1000 $HOME/.filecoin/api/admin.token)"
$ curl -X GET --cacert $HOME/.filecoin/api/tls.cert --header "$AUTH" \
> https://localhost:3453/api/filecoin/v0/tipsets
Security scheme type: HTTP
HTTP Authorization Scheme Bearer Token

Tipsets

List Tipsets

List Tipsets currently known to this node in reverse height order

Authorizations:
query Parameters
nextPageToken
string

Next page token

Responses

200

Success

401

Access token is missing or invalid

get /chain/tipsets
http://127.0.0.1:3453/api/chain/v0/chain/tipsets

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Fetch a Tipset by ID

Return information about the Tipset with the specified ID

Authorizations:
path Parameters
tipsetId
required
string

ID of the Tipset to fetch

Responses

200

Success

401

Access token is missing or invalid

get /chain/tipsets/{tipsetId}
http://127.0.0.1:3453/api/chain/v0/chain/tipsets/{tipsetId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "tipset",
  • "id": "zDPWYqFCyaQ9QJHr1qWZ19rFg3YRkcuXREkvpiHRJZhGN5T8SnyJ",
  • "height": 0,
  • "blocks":
    [
    ]
}

Blocks

Find block by ID

Return information about the Block with the specified ID

Authorizations:
path Parameters
blockId
required
string

ID of the Block to fetch

Responses

200

Success

401

Access token is missing or invalid

get /chain/blocks/{blockId}
http://127.0.0.1:3453/api/chain/v0/chain/blocks/{blockId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "block",
  • "id": "bafy2bzaceahv3kv4yllfdfrvtsr6rn5g5277dmxhx4tu4uvhvg2udpuate3te",
  • "header":
    {
    },
  • "executedMessages":
    [
    ]
}

Messages

Send a Message

This method sends a new Message to an Actor recipient.

Authorizations:
Request Body schema: application/json
to
string
value
number
gasPrice
number
gasLimit
number
method
string
parameters
object

Responses

200

Success

401

Access token is missing or invalid

post /chain/messages
http://127.0.0.1:3453/api/chain/v0/chain/messages

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "to": "string",
  • "value": 0,
  • "gasPrice": 0,
  • "gasLimit": 0,
  • "method": "string",
  • "parameters": { }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "message",
  • "id": "string",
  • "nonce": 0,
  • "from": "string",
  • "to": "string",
  • "value": 0,
  • "gasPrice": 0,
  • "gasLimit": 0,
  • "method": "string",
  • "parameters": { },
  • "signature": "string"
}

Find ExecutedMessage by ID

Return information about the ExecutedMessage with the specified ID. An executed Message is one that has been included in a valid block in the chain. It includes return value and status information.

Authorizations:
path Parameters
executedMessageId
required
string

ID of the executed message to fetch

Responses

200

Success

401

Access token is missing or invalid

get /chain/executed-messages/{executedMessageId}
http://127.0.0.1:3453/api/chain/v0/chain/executed-messages/{executedMessageId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "executedMessage",
  • "id": "bafy2bzacebc3bt6cedhoyw34drrmjvazhu4oj25er2ebk4u445pzycvq4ta4a",
  • "blockId": "bafy2bzacebakx3c5g22seerja562tqb32bhecp4w2quj4mhvmovy4oqzbr2u4",
  • "message":
    {
    },
  • "exitCode": 0,
  • "return": "3AE="
}

Actors

List Actors

List Actors currently known to this node in address order

Authorizations:
query Parameters
nextPageToken
string

Next page token

Responses

200

Success

get /actors
http://127.0.0.1:3453/api/chain/v0/actors

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Find Actor by Address

Return information about the Actor with the specified Address

Authorizations:
path Parameters
address
required
string

The address of the Actor to fetch

Responses

200

Success

get /actors/{address}
http://127.0.0.1:3453/api/chain/v0/actors/{address}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "actor",
  • "address": "string",
  • "role": "Init",
  • "nonce": 0,
  • "balance": 0,
  • "head": "string",
  • "codeCid": "string",
  • "info": { }
}

PaymentChannels

Redeem Voucher

This endpoint accepts a voucher from the PaymentChannel target and redeems it. Upon checking the validity and successfully checking the voucher's condition the specified funds will be transfered from the channel to the target.

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the PaymentChannel to fetch

Request Body schema: applications/json
amount
number

The amount of FIL this Voucher is worth. This amount is sent to the target when this voucher is redeemed.

validAt
number

The block height on or after which this Voucher can be redeemed.

condition
object

The condition that must evaluate to true for this Voucher to be redeemed.

signature
string

The signature over all the data in this Voucher

Responses

200

Success

post /payment_channels/{paymentChannelId}/redeem
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}/redeem

Request samples

Content type
applications/json
Copy
Expand all Collapse all
{
  • "amount": 0.19296864,
  • "validAt": 2120399,
  • "condition": "TODO",
  • "signature": "TODO"
}

Creates Voucher

This endpoint accepts voucher details and returns a new signed voucher suitable for off chain transmission to the PaymentChannel target for later redemption. Only the PaymentChannel payer (creator) can call this endpoint successfully.

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the PaymentChannel to fetch

Request Body schema: applications/json
amount
number

The amount of FIL this Voucher is worth. This amount is sent to the target when this voucher is redeemed.

validAt
number

The block height on or after which this Voucher can be redeemed.

condition
object

The condition that must evaluate to true for this Voucher to be redeemed.

signature
string

The signature over all the data in this Voucher

Responses

200

Success

post /payment_channels/{paymentChannelId}/vouchers
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}/vouchers

Request samples

Content type
applications/json
Copy
Expand all Collapse all
{
  • "amount": 0.19296864,
  • "validAt": 2120399,
  • "condition": "TODO",
  • "signature": "TODO"
}

List Payment Channels

List all PaymentChannels known to this node

Authorizations:
query Parameters
nextPageToken
string

Next page token

Responses

200

Success

get /payment_channels
http://127.0.0.1:3453/api/chain/v0/payment_channels

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create new PaymentChannel

This endpoint creates a new PaymentChannel with the specified characteristics

Authorizations:
Request Body schema: application/json
targetActorId
string

The address of the account to which funds will be transferred by this PaymentChannel upon successful redemption of vouchers

amount
number

The total amount of FIL that is in this PaymentChannel and payable to the target

agreedEol
number

The original chain height at which this PaymentChannel will expire. Specified upon creation and optionally extended by the creator of the channel.

Responses

200

Success

post /payment_channels
http://127.0.0.1:3453/api/chain/v0/payment_channels

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "targetActorId": "t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy",
  • "amount": 0.19296864,
  • "agreedEol": 2120399
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Find PaymentChannel by ID

Find a PaymentChannel by ID and return it

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the PaymentChannel to fetch

Responses

200

Success

get /payment_channels/{paymentChannelId}
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "paymentChannel",
  • "targetActorId": "t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy",
  • "amount": 0.19296864,
  • "amountRedeemed": 0,
  • "agreedEol": 2120399,
  • "actualEol": 0,
  • "condition": "TODO",
  • "redeemed": true
}

Extend duration of PaymentChannel

This endpoint extends the duration of an existing PaymentChannel, increasing the block height at which the PaymentChannel will timeout. Only the payer (creator) or the PaymentChannel can successfully call this endpoint.

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the PaymentChannel to fetch

Request Body schema: applications/json
agreedEol
number

The new chain (increased) height at which this PaymentChannel will expire.

Responses

200

Success

patch /payment_channels/{paymentChannelId}
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}

Request samples

Content type
applications/json
Copy
Expand all Collapse all
{
  • "agreedEol": 2120399
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "paymentChannel",
  • "targetActorId": "t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy",
  • "amount": 0.19296864,
  • "amountRedeemed": 0,
  • "agreedEol": 2120399,
  • "actualEol": 0,
  • "condition": "TODO",
  • "redeemed": true
}

Schedule PaymentChannel for cancellation

This endpoint reduces the actual eol (effective end date) of the PaymentChannel in an attempt to free up the funds in the channel for earlier reclaming. This endpoint can only successfullly be called by the PaymentChannel's payer as the cancel message needs to originate from that account. Cancel doesn't immediately close a channel but instead reduces the lifetime of the channel leaving a grace period during which the payee can undo the cancellation by submitting a valid voucher, thereby proving that the channel is still in use.

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the Channel to cancel

Responses

200

Success

post /payment_channels/{paymentChannelId}/cancel
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}/cancel

Reclaim unspent funds in Channel

This endpoint is used by the creator (payer) of a PaymentChannel to reclaim unspent funds when a PaymentChannel has timed out (the chain height has exceeded the eol of the PaymentChannel). It can only successfully be called by the PaymentChannel's payer on a timed out PaymentChannel.

Authorizations:
path Parameters
paymentChannelId
required
string

ID of the Channel to reclaim

Responses

200

Success

post /payment_channels/{paymentChannelId}/reclaim
http://127.0.0.1:3453/api/chain/v0/payment_channels/{paymentChannelId}/reclaim

Node

Return Node information

Get information about the current Filecoin Node.

Authorizations:

Responses

200

Success

get /control/node
http://127.0.0.1:3453/api/chain/v0/control/node

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "node",
  • "id": "QmeGwW4Nm543yYe5gchbETzzpcUJsPc7xtLkj7g5GCmMLq",
  • "addresses":
    [
    ],
  • "version": "1.0.2",
  • "commit": "93540266a2a9972e91947a538ce70dc9c4e8077e",
  • "protocol":
    {
    },
  • "bitswapStats":
    {
    },
  • "config": { }
}

Pieces

Add a Piece to local storage

This method imports data into the local node's temporary storage so that it can be transferred to a storage miner.

Authorizations:
Request Body schema: application/octet-stream
string <binary>

Responses

200

Success

post /control/pieces
http://127.0.0.1:3453/api/chain/v0/control/pieces

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "QmQXJPWYEnt9GoYu5SXkrKMWovCX78YBjFzRSJF63Zobnj"
}

Fetch piece data

Fetch piece data from the local node's temporary storage.

Authorizations:
path Parameters
pieceId
required
string

ID of the piece previously returned by corresponding createPiece POST method.

Responses

200

If the request succeeds, the server returns the original data used to create the piece.

get /control/pieces/{pieceId}
http://127.0.0.1:3453/api/chain/v0/control/pieces/{pieceId}

Asks

Lists all Asks in the market

This endpoint returns all Asks known to the current node ordered lexically by the Ask ID

Authorizations:
query Parameters
minerId
string
Example: minerId=t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq

Filter returned asks by minerId. Only Asks from this miner will be returned.

active
boolean
Example: active=true

Filter returned asks to include only those that are still active, meaning the current node's tipset height doesn't exceed that of the Ask's specified expiration.

nextPageToken
string

Next page token

Responses

200

Success

get /market/asks
http://127.0.0.1:3453/api/chain/v0/market/asks

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Order this mining node to publish a new Ask on the network

This method creates a new storage market ask and publishes it for storage buyers to find and act on.

Authorizations:
Request Body schema: application/json
kind
string
Value: "ask"
price
number

The price in FIL per byte per blocktime being proposed in this Ask.

expiry
number

The block height at which this Ask expires.

Responses

200

Success

post /market/asks
http://127.0.0.1:3453/api/chain/v0/market/asks

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kind": "ask",
  • "price": 1e-11,
  • "expiry": 392265
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "ask",
  • "minerId": "t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq",
  • "price": 1e-11,
  • "expiry": 392265
}

Fetch Ask data

Fetch data about an Ask by the Ask ID.

Authorizations:
path Parameters
askId
required
string

ID of the Ask to fetch.

Responses

200

If the request succeeds, the server returns the requested Ask.

get /market/asks/{askId}
http://127.0.0.1:3453/api/chain/v0/market/asks/{askId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "ask",
  • "minerId": "t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq",
  • "price": 1e-11,
  • "expiry": 392265
}

StorageDeals

Fetch StorageDeal information known to this node

This endpoint returns a list of all deals known to the current node.

Authorizations:
query Parameters
minerId
string
Example: minerId=t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq

Filter returned Deals by minerId. Only Deals made with (or proposed to) the specified miner will be returned.

clientId
string
Example: clientId=t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy

Filter returned Deals by clientId. Only Deals initiated by the specified client will be returned.

pieceId
string
Example: pieceId=QmYRHQCRVSznLwaR8kXtVH4KSZU5fqFPPSkxv9xsJV2QCY

Filter returned Deals by pieceId. Only Deals made to store the specified pieceId will be returned.

nextPageToken
string

Next page token

Responses

200

Success

get /market/storage_deals
http://127.0.0.1:3453/api/chain/v0/market/storage_deals

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Initiate a StorageDeal

This endpoint initiates a storage deal with a storage miner. It will create an appropriate PaymentChannel and vouchers, and pass the deal to the target storage miner to await acceptance or rejection.

Authorizations:
Request Body schema: application/json
minerActorId
string

The ID of the storage miner that is fulfilling this StorageDeal

pieceId
string

The ID of the Picee being stored

askId
string

The ID of the Ask from the target miner for which this StorageDeal is to be proposed

duration
number

The duration of this StorageDeal in blocks

status
string
Enum: "unknown" "rejected" "accepted" "started" "failed" "staged" "sealing" "complete"

The current status of the StorageDeal

Responses

200

Success

post /market/storage_deals
http://127.0.0.1:3453/api/chain/v0/market/storage_deals

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "minerActorId": "t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq",
  • "pieceId": "QmYRHQCRVSznLwaR8kXtVH4KSZU5fqFPPSkxv9xsJV2QCY",
  • "askId": 0,
  • "duration": 288000,
  • "status": "complete"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Actor

Actor is the central abstraction of entities in the system.

See the Actor Specification and the Actor Definition for more information.

Both individual accounts, as well as contracts (user & system level) are represented as actors. An actor has the following core functionality implemented on a system level:

  • track a Filecoin balance, using the Balance field
  • execute code stored in the Code field
  • read & write memory
  • replay protection, using the Nonce field

Value sent to a non-existent address will be tracked as an empty actor that has a Balance but nil Code and Memory. You must nil check Code cids before comparing them.

More specific capabilities for individual accounts or contract specific must be implemented inside the code.

kind
string
Value: "actor"
address
string

The identifier that refers to an Actor in the Filecoin state. All Actors have an address. To learn more, take a look at the address spec..

role
string
Enum: "Init" "Account" "StorageMiner" "StorageMarket" "PaymentChannel" "MultisigAccount"
nonce
number

Nonce is the nonce expected on the next message from this actor. Messages are processed in strict, contiguous nonce order.

balance
number

Balance is the amount of FIL in the actor's account.

head
string

The CID (Content Identifier) of the root of the Actor's state tree.

codeCid
string

The CID (Content Identifier) of the VM code for this actor's implementation (or a constant for actors implemented in Go code). Code may be nil for an uninitialized actor (which exists because it has received a balance)

info
object or object or object or object or object
Copy
Expand all Collapse all
{
  • "kind": "actor",
  • "address": "string",
  • "role": "Init",
  • "nonce": 0,
  • "balance": 0,
  • "head": "string",
  • "codeCid": "string",
  • "info": { }
}

Ask

An Ask is a price advertisement by a storage miner for storing data.

id
string

The ID of this Ask.

kind
string
Value: "ask"
minerId
string

The ID (address) of the miner Actor that published this Ask.

price
number

The price in FIL per byte per blocktime being proposed in this Ask.

expiry
number

The block height at which this Ask expires.

Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "ask",
  • "minerId": "t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq",
  • "price": 1e-11,
  • "expiry": 392265
}

Block

A Block contains information relevant to a particular point in time over which the network may achieve consensus. Blocks are mined as part of the consensus mechanism by elected miners and then included in a Tipset.

See the BlockHeader Specificiation for more information.

kind
string
Value: "block"
id
string

The CID (Content Identifier) of the Block

header
object (BlockHeader)
executedMessages
Array of objects (ExecutedMessage)
Copy
Expand all Collapse all
{
  • "kind": "block",
  • "id": "bafy2bzaceahv3kv4yllfdfrvtsr6rn5g5277dmxhx4tu4uvhvg2udpuate3te",
  • "header":
    {
    },
  • "executedMessages":
    [
    ]
}

BlockHeader

A BlockHeader contains information relating to a Block. In the Filecoin specification there is no difference between a BlockHeader and a Block, but for the purposees of this API a Block wraps a BlockHeader and additionally contains the full contents of all messages included in that Block.

See the BlockHeader Specificiation for more information.

kind
string
Value: "blockHeader"
id
string

The CID (Content Identifier) of the Block

height
number

Height is the chain height of this block.

minerId
string

The address of the miner Actor that mined this block.

messagesCid
string

The CID (Content Identifier) of the of bls and secpk signed trees of Messages included in this Block.

receiptsCid
string

The CID (Content Identifier) of the of tree containing receipts for the messages included in this block. Receipts are the return values and errors codes resulting from messages.

tickets
Array of objects
electionProof
string

A base64 encoded byte array that represents the proof that the miner of this Block is a leader at this round.

parentTipsetId
string

The ID of the Tipset on which this block was based. In the spec this field is defined as an array of Block IDs, which is effectively equivalent to a Tipset ID in this API.

parentWeight
number

parentWeight is the aggregate chain weight (spec) of the parent Tipset.

stateRoot
string

The CID (Content Identifier) of the root of the tree containing Actor state after the application of all the messages mined int his Block.

timestamp
number

The block Timestamp is used to enforce a form of block delay by honest miners. Unix time UTC timestamp (in seconds) stored as an unsigned integer.

blsAggregate
string

A base64 encoded representation of the aggregated BLS signature for all the messages in this block that were signed using BLS signatures

blockSig
string

A base64 encoded representation of the signature over the hash of this entire block with the miner's worker key to ensure that it is not tampered with after creation

Copy
Expand all Collapse all
{
  • "kind": "blockHeader",
  • "id": "bafy2bzaceahv3kv4yllfdfrvtsr6rn5g5277dmxhx4tu4uvhvg2udpuate3te",
  • "height": 200193,
  • "minerId": "t2usk2yzfu23uq2wyuc3w6ov233nxyhkysju2suba",
  • "messagesCid": "bafy2bzacebc3bt6cedhoyw34drrmjvazhu4oj25er2ebk4u445pzycvq4ta4a",
  • "receiptsCid": "bafy2bzacebc3bt6cedhoyw34drrmjvazhu4oj25er2ebk4u445pzycvq4ta4a",
  • "tickets":
    [
    ],
  • "electionProof": "V8896JC51ikqPVqYUCVbHzUfaOgjTBF6BYc8G/2P9CJMAg8MJzOi1j3F8hJSj/C6tKTLd9qHpLEjRpiGUzz04gE=",
  • "parentTipsetId": "bafy2bzacebnsn4ywt2cgejgp32rgsv4vaylrqe32axw4cfadxhoutxxb7puzs",
  • "parentWeight": 2001934,
  • "stateRoot": "bafyreih4xzehg7qudgdwve27pvmtblnc3ib5ql7haeouainjnavyo46eoy",
  • "timestamp": 1568753711,
  • "blsAggregate": "TODO",
  • "blockSig": "TODO"
}

ExecutedMessage

kind
string
Value: "executedMessage"
id
string

The CID (Content Identifier) of this ExecutedMessage

blockId
string

The CID of the mined block that included this ExecutedMessage.

message
object (Message)
exitCode
number

The exit value returned by the method this message was sent to. 0 is success, anything else is an error code in unix style.

return
object

The base64 encoded return values, if any, from processing a message. This can be non-empty even in the case of error (e.g., to provide programmatically readable detail about errors).

Copy
Expand all Collapse all
{
  • "kind": "executedMessage",
  • "id": "bafy2bzacebc3bt6cedhoyw34drrmjvazhu4oj25er2ebk4u445pzycvq4ta4a",
  • "blockId": "bafy2bzacebakx3c5g22seerja562tqb32bhecp4w2quj4mhvmovy4oqzbr2u4",
  • "message":
    {
    },
  • "exitCode": 0,
  • "return": "3AE="
}

Message

A Message is an exchange of information between two actors modeled as a function call. Messages are the equivalent of transactions in Ethereum.

See the Message Specification for more information.

kind
string
Value: "message"
id
string
nonce
number
from
string
to
string
value
number
gasPrice
number
gasLimit
number
method
string
parameters
object
signature
string
Copy
Expand all Collapse all
{
  • "kind": "message",
  • "id": "string",
  • "nonce": 0,
  • "from": "string",
  • "to": "string",
  • "value": 0,
  • "gasPrice": 0,
  • "gasLimit": 0,
  • "method": "string",
  • "parameters": { },
  • "signature": "string"
}

Node

kind
string
Value: "node"
id
string
addresses
Array of strings

List of peer (network) addresses

version
string
commit
string
protocol
object
bitswapStats
object
config
object

Full JSON representation of the node's current configuration

Copy
Expand all Collapse all
{
  • "kind": "node",
  • "id": "QmeGwW4Nm543yYe5gchbETzzpcUJsPc7xtLkj7g5GCmMLq",
  • "addresses":
    [
    ],
  • "version": "1.0.2",
  • "commit": "93540266a2a9972e91947a538ce70dc9c4e8077e",
  • "protocol":
    {
    },
  • "bitswapStats":
    {
    },
  • "config": { }
}

PaymentChannel

A PaymentChannel is setup between actors in the Filecoin system to enable off-chain payments with on-chain guarantees, making settlement more efficient.

See the Payment Channel Actor Description for more information.

id
string

The ID of this PaymentChannel

kind
string
Value: "paymentChannel"
targetActorId
string

The address of the account to which funds will be transferred by this PaymentChannel upon successful redemption of vouchers

amount
number

The total amount of FIL that is in this PaymentChannel and payable to the target

amountRedeemed
number

The total amount of FIL that has already been transfered to the target. This value cannot ever exceed amount.

agreedEol
number

The original chain height at which this PaymentChannel will expire. Specified upon creation and optionally extended by the creator of the channel.

actualEol
number

The actual expiration for the payment PaymentChannel which can differ from agreedEol when the payment channel is in dispute

condition
object

The condition specified in the most recent payment voucher for which a redemption attempt was made.

redeemed
boolean

A flag indicated whether or not Redeem has been called on the payment PaymentChannel yet. This is necessary because AmountRedeemed can still be zero in the event of a zero-value voucher

Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "paymentChannel",
  • "targetActorId": "t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy",
  • "amount": 0.19296864,
  • "amountRedeemed": 0,
  • "agreedEol": 2120399,
  • "actualEol": 0,
  • "condition": "TODO",
  • "redeemed": true
}

StorageDeal

A StorageDeal represents the agreement between between two Actors; one Actor paying the other (via a PaymentChannel) to store data on their behalf.

See a description of how StorageDeals work in the Filecoin Storage Market Specification

id
string

The ID of this StorageDeal

kind
string
Value: "storageDeal"
minerActorId
string

The ID of the storage miner that is fulfilling this StorageDeal

clientActorId
string

The ID of the client initiating the StorageDeal (will typically be the owner of the current node)

pieceId
string

The ID of the Picee being stored

size
number

Size of the Piece being stored in bytes

totalPrice
number

The total price in FIL that will be paid for the entire storage operation

duration
number

The duration of this StorageDeal in blocks

status
string
Enum: "unknown" "rejected" "accepted" "started" "failed" "staged" "sealing" "complete"

The current status of the StorageDeal

paymentInfo
object
Copy
Expand all Collapse all
{
  • "id": "string",
  • "kind": "storageDeal",
  • "minerActorId": "t2ytzk7whxrjb77kg4wd5fqy2cfse5jxajkqczfcq",
  • "clientActorId": "t17vmiuyzqa3ygd4gsj5rsgglbj737wyztb4cohfy",
  • "pieceId": "QmYRHQCRVSznLwaR8kXtVH4KSZU5fqFPPSkxv9xsJV2QCY",
  • "size": 67003,
  • "totalPrice": 0.19296864,
  • "duration": 288000,
  • "status": "complete",
  • "paymentInfo":
    {
    }
}

Tipset

A TipSet is a set of blocks that have the same parent set and same number of tickets, which implies they will have been mined at the same height. A TipSet can contain multiple blocks if more than one miner successfully mines a block at the same height as another miner.

See the Tipset Specification and the [Tipset Description] in the consensus specification for more information

kind
string
Value: "tipset"
id
string
height
number
blocks
Array of objects (BlockHeader)
Copy
Expand all Collapse all
{
  • "kind": "tipset",
  • "id": "zDPWYqFCyaQ9QJHr1qWZ19rFg3YRkcuXREkvpiHRJZhGN5T8SnyJ",
  • "height": 0,
  • "blocks":
    [
    ]
}

Voucher

kind
string
Value: "voucher"
paymentChannelId
string

The ID of the PaymentChannel this Voucher is redeemable against.

payer
string

The Actor ID (address) of the creator of the payment channel for this voucher.

target
string

The Actor ID (address) of the recipient of the funds in this voucher.

amount
number

The amount of FIL this Voucher is worth. This amount is sent to the target when this voucher is redeemed.

validAt
number

The block height on or after which this Voucher can be redeemed.

condition
object

The condition that must evaluate to true for this Voucher to be redeemed.

signature
string

The signature over all the data in this Voucher

Copy
Expand all Collapse all
{
  • "kind": "voucher",
  • "paymentChannelId": "TODO",
  • "payer": "TODO",
  • "target": "TODO",
  • "amount": 0.19296864,
  • "validAt": 2120399,
  • "condition": "TODO",
  • "signature": "TODO"
}