api: Document API change process
This commit is contained in:
parent
86d4f5f738
commit
bfa332ca7d
@ -15,6 +15,17 @@ import (
|
|||||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
type Common interface {
|
type Common interface {
|
||||||
|
|
||||||
// MethodGroup: Auth
|
// MethodGroup: Auth
|
||||||
|
@ -41,6 +41,20 @@ type ChainIO interface {
|
|||||||
|
|
||||||
const LookbackNoLimit = abi.ChainEpoch(-1)
|
const LookbackNoLimit = abi.ChainEpoch(-1)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// NOTE: This is the V1 (Unstable) API - to add methods to the V0 (Stable) API
|
||||||
|
// you'll have to add those methods to interfaces in `api/v0api`
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
// FullNode API is a low-level interface to the Filecoin network full node
|
// FullNode API is a low-level interface to the Filecoin network full node
|
||||||
type FullNode interface {
|
type FullNode interface {
|
||||||
Common
|
Common
|
||||||
|
@ -14,6 +14,20 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// NOTE: This is the V1 (Unstable) API - to add methods to the V0 (Stable) API
|
||||||
|
// you'll have to add those methods to interfaces in `api/v0api`
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
type Gateway interface {
|
type Gateway interface {
|
||||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||||
|
@ -26,6 +26,17 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
// StorageMiner is a low-level interface to the Filecoin network storage miner node
|
// StorageMiner is a low-level interface to the Filecoin network storage miner node
|
||||||
type StorageMiner interface {
|
type StorageMiner interface {
|
||||||
Common
|
Common
|
||||||
|
@ -14,6 +14,17 @@ import (
|
|||||||
"github.com/filecoin-project/specs-storage/storage"
|
"github.com/filecoin-project/specs-storage/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
type Worker interface {
|
type Worker interface {
|
||||||
Version(context.Context) (Version, error) //perm:admin
|
Version(context.Context) (Version, error) //perm:admin
|
||||||
|
|
||||||
|
@ -26,6 +26,23 @@ import (
|
|||||||
|
|
||||||
//go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode
|
//go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
|
||||||
|
// you'll need to make sure they are also present on the V1 (Unstable) API
|
||||||
|
//
|
||||||
|
// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
|
||||||
|
// by the V1 api
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
// FullNode API is a low-level interface to the Filecoin network full node
|
// FullNode API is a low-level interface to the Filecoin network full node
|
||||||
type FullNode interface {
|
type FullNode interface {
|
||||||
Common
|
Common
|
||||||
|
@ -15,6 +15,23 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MODIFYING THE API INTERFACE
|
||||||
|
//
|
||||||
|
// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
|
||||||
|
// you'll need to make sure they are also present on the V1 (Unstable) API
|
||||||
|
//
|
||||||
|
// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
|
||||||
|
// by the V1 api
|
||||||
|
//
|
||||||
|
// When adding / changing methods in this file:
|
||||||
|
// * Do the change here
|
||||||
|
// * Adjust implementation in `node/impl/`
|
||||||
|
// * Run `make gen` - this will:
|
||||||
|
// * Generate proxy structs
|
||||||
|
// * Generate mocks
|
||||||
|
// * Generate markdown docs
|
||||||
|
// * Generate openrpc blobs
|
||||||
|
|
||||||
type Gateway interface {
|
type Gateway interface {
|
||||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||||
|
Loading…
Reference in New Issue
Block a user