This repository was archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Review from @anorth at 0d7b13a5 #2
Open
anorth
wants to merge
52
commits into
anorth/empty
Choose a base branch
from
master
base: anorth/empty
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
8fb7a4b
Initial
9843e94
Merged to single file
df97c3b
Added linting tool
1dbcf63
Fix linter errors
37c91a8
First pass at miner state
44b9d38
Update README.md
658e4ce
Update README.md
9f918b3
Update README.md
3fb7a3c
Added serve script
65d244e
update readme for new repo name
mishmosh a6ea98d
Continued documentation of actor state
b4f2f64
Added more actor states and node info
16013b2
Add piece import and export endpoints
e3d173d
Added some Ask endpoints
18e1feb
Add licensing info
eingenito bfce9eb
GET Deals
996026d
Channel endpoints
6321462
Channel and Voucher operations, and some cleanup
9cb9c2b
Move components to the front
3f4862c
Switch to recent version of ReDoc
566f3dc
Add Models to rendered documentation
0b050cf
Assorted fixes
c3ecb7c
tiny README typo
mishmosh 4d41808
Merge pull request #1 from filecoin-project/mishmosh-patch-1
6179cf0
Moved Tipsets to chain.yml
397e58c
Separate actor related endpoints/models
92706a4
Move channel resource/endpoints to channels.yml
51f2bea
Move market resource/endpoints to market.yml
346a696
Move control resource/endpoints to control.yml
9710480
Moved Sector model to actors.yml
6e96db9
Renamed filecoin-rest-api.yml -> api.yml
a8a5064
Fix serve command
52e91f1
Added basic security definition
3e95f6e
Improved description of Block/Header
5af9a39
Improved description of properties in Chain models
6637471
Improved descriptions of Market model properties.
e67c59f
Create static html version of documentation
24eba66
Configure for GH Pages
175b141
Improved Auth documentation
0d7b13a
Generate new docs
77115b3
Rename Actor id to Actor address
de3839c
Fix Actor state model names
193a275
Rename Actor stateRoot to Actor head for consistency with spec
8c86f39
Add codeCid to Actor
1518b4b
Add Actor model description with link to spec
a0dcaaa
Improve auth scheme description
4b9511e
Better descriptions and renaming to match spec
096d8a0
Linter error fixes
68f05df
Updated HTML
5f6c33c
corrected spelling of receipt
shannonwells b82dce5
Merge pull request #3 from filecoin-project/bugs/correct-spelling
c838bb2
Github pages HTML view link added to README
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| models: | ||
| Actor: | ||
| 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: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.