Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8fb7a4b
Initial
Aug 26, 2019
9843e94
Merged to single file
Aug 27, 2019
df97c3b
Added linting tool
Aug 27, 2019
1dbcf63
Fix linter errors
Aug 27, 2019
37c91a8
First pass at miner state
Aug 28, 2019
44b9d38
Update README.md
Aug 28, 2019
658e4ce
Update README.md
Aug 28, 2019
9f918b3
Update README.md
Aug 28, 2019
3fb7a3c
Added serve script
Aug 28, 2019
65d244e
update readme for new repo name
mishmosh Aug 29, 2019
a6ea98d
Continued documentation of actor state
Aug 29, 2019
b4f2f64
Added more actor states and node info
Aug 29, 2019
16013b2
Add piece import and export endpoints
Aug 30, 2019
e3d173d
Added some Ask endpoints
Aug 30, 2019
18e1feb
Add licensing info
eingenito Aug 30, 2019
bfce9eb
GET Deals
Sep 4, 2019
996026d
Channel endpoints
Sep 5, 2019
6321462
Channel and Voucher operations, and some cleanup
Sep 9, 2019
9cb9c2b
Move components to the front
Sep 10, 2019
3f4862c
Switch to recent version of ReDoc
Sep 13, 2019
566f3dc
Add Models to rendered documentation
Sep 13, 2019
0b050cf
Assorted fixes
Sep 13, 2019
c3ecb7c
tiny README typo
mishmosh Sep 13, 2019
4d41808
Merge pull request #1 from filecoin-project/mishmosh-patch-1
Sep 13, 2019
6179cf0
Moved Tipsets to chain.yml
Sep 16, 2019
397e58c
Separate actor related endpoints/models
Sep 16, 2019
92706a4
Move channel resource/endpoints to channels.yml
Sep 16, 2019
51f2bea
Move market resource/endpoints to market.yml
Sep 16, 2019
346a696
Move control resource/endpoints to control.yml
Sep 16, 2019
9710480
Moved Sector model to actors.yml
Sep 16, 2019
6e96db9
Renamed filecoin-rest-api.yml -> api.yml
Sep 16, 2019
a8a5064
Fix serve command
Sep 16, 2019
52e91f1
Added basic security definition
Sep 18, 2019
3e95f6e
Improved description of Block/Header
Sep 18, 2019
5af9a39
Improved description of properties in Chain models
Sep 18, 2019
6637471
Improved descriptions of Market model properties.
Sep 18, 2019
e67c59f
Create static html version of documentation
Sep 18, 2019
24eba66
Configure for GH Pages
Sep 18, 2019
175b141
Improved Auth documentation
Sep 20, 2019
0d7b13a
Generate new docs
Sep 20, 2019
77115b3
Rename Actor id to Actor address
Sep 27, 2019
de3839c
Fix Actor state model names
Sep 27, 2019
193a275
Rename Actor stateRoot to Actor head for consistency with spec
Sep 27, 2019
8c86f39
Add codeCid to Actor
Sep 27, 2019
1518b4b
Add Actor model description with link to spec
Sep 27, 2019
a0dcaaa
Improve auth scheme description
Sep 27, 2019
4b9511e
Better descriptions and renaming to match spec
Sep 27, 2019
096d8a0
Linter error fixes
Sep 28, 2019
68f05df
Updated HTML
Sep 28, 2019
5f6c33c
corrected spelling of receipt
shannonwells Oct 3, 2019
b82dce5
Merge pull request #3 from filecoin-project/bugs/correct-spelling
Oct 3, 2019
c838bb2
Github pages HTML view link added to README
Oct 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# node-http-api
Implementation and specification for the Filecoin node HTTP API
# filecoin-http-api (WIP)
OpenAPI specification for the Filecoin HTTP REST API.

The HTML version of the documentation can be [viewed here](https://filecoin-project.github.io/filecoin-http-api/).

This is the specification for the HTTP REST API (to be) implemented by Filecoin nodes. Some details of its design and rationale can be found in this [Design Document](https://docs.google.com/document/d/1ANnTHOU-8612ayvvS7Ru4B1L4voojLE0R0TQ8zF1x5s/edit#heading=h.8v8p3fl8e3gj).

## Setup
To facilitate development and review we're using [speccy](https://github.com/wework/speccy) as a linter and [redoc](https://github.com/Redocly/redoc) to generate HTML documentation. You can install them using NPM or Yarn.

```sh
$ npm install
# or
$ yarn install
```

## Usage
To view the specification in HTML form you can invoke redoc via:
```sh
$ npm run serve
```
And view the resulting documentation at http://localhost:5000.

## License
Dual MIT and Apache 2
153 changes: 153 additions & 0 deletions api/actors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
models:
Actor:
Comment thread
eingenito marked this conversation as resolved.
type: object
properties:
kind:
type: string
readOnly: true
enum: [actor]
address:
type: string
description: 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.](https://github.com/filecoin-project/specs/blob/master/address.md).
role:
type: string
enum: [Init,Account,StorageMiner,StorageMarket,PaymentChannel,MultisigAccount]
nonce:
type: number
description: Nonce is the nonce expected on the next message from this actor. Messages are processed in strict, contiguous nonce order.
balance:
type: number
description: Balance is the amount of FIL in the actor's account.
head:
type: string
description: The CID ([Content Identifier](https://github.com/ipld/cid)) of the root of the Actor's state tree.
codeCid:
type: string
description: The CID ([Content Identifier](https://github.com/ipld/cid)) 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:
oneOf:
- $ref: '#/models/AccountActorState'
- $ref: '#/models/InitActorState'
- $ref: '#/models/PaymentChannelActorState'
- $ref: '#/models/StorageMinerActorState'
- $ref: '#/models/StorageMarketActorState'
AccountActorState:
$ref: '#/models/EmptyActorState'
EmptyActorState:
type: object
description: There is no additional state exposed by this actor
InitActorState:
type: object
properties:
nextId:
type: number
description: The next numerical ID to allocate to a newly instantiated Actor
PaymentChannelActorState:
$ref: '#/models/EmptyActorState'
StorageMarketActorState:
type: object
properties:
totalStorage:
type: number
description: Filecoin's total committed storage as of the current block.
StorageMinerActorState:
type: object
properties:
owner:
type: string
description: The address of the account that owns this miner. Income and returned are paid to this address. This address is also allowed to change the worker address for the miner.
worker:
type: string
description: The address of the worker account for this miner. This will be the key that is used to sign blocks created by this miner, and sign messages sent on behalf of this miner to commit sectors, submit PoSts, and other day to day miner activities.
peerId:
type: string
description: PeerID references the libp2p identity that the miner is operating.
sectorSize:
type: number
description: SectorSize is the amount of space in each sector committed to the network by this miner.
dePledgedCollateral:
type: number
description: Collateral that is waiting to be withdrawn
dePledgeTime:
type: number
description: Time at which the depledged collateral may be withdrawn
sectors:
type: array
items:
$ref: 'actors.yml#/models/Sector'
provingSet:
type: array
items:
$ref: 'actors.yml#/models/Sector'
currentFaultSet:
type: string
nextFaultSet:
type: string
nextDoneSet:
type: string
arbitratedDeals:
type: string
power:
type: number
slashedSet:
type: array
items:
$ref: 'actors.yml#/models/Sector'
slashedAt:
type: number
ownedStorageCollateral:
type: number
provingPeriodEnd:
type: number
Sector:
type: object
properties:
id:
type: string
commR:
type: string
endpoints:
actors_collection:
get:
operationId: listActors
summary: List Actors
description: List Actors currently known to this node in address order
tags:
- Actors
parameters:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, and all state query operations, must take a tipset key as an optional parameter, indicating the point in the chain history at which to query. Whether or not it's specified, the result should include an envelope that specifies the tipset at which the query was actually evaluated.

- name: nextPageToken
in: query
description: Next page token
required: false
schema:
type: string
responses:
200:
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/models/Actor'
actor_resource:
get:
operationId: getActorByAddress
summary: Find Actor by Address
description: Return information about the Actor with the specified Address
tags:
- Actors
parameters:
- name: address
in: path
description: The address of the Actor to fetch
required: true
schema:
type: string
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/models/Actor'
Loading