GitHub Raw JSON API

hyperledger / fabric

43,388 Go

Fabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.

Fabric API Specification

Located in swagger/swagger-fabric.json on branch HEAD

2.0 JSON 7 Endpoints 12.5 KB

Operations & Route Endpoints (11)

GET /healthz
Retrieves all registered health checkers for the process.
GET /logspec
Retrieves the active logging spec for a peer or orderer.
PUT /logspec
Updates the active logging spec for a peer or orderer.
GET /metrics
metrics
GET /participation/v1/channels
Returns the complete list of channels an Ordering Service Node (OSN) has joined.
PUT /participation/v1/channels
Update config block of the Order Service Node (OSN) to the channel.
POST /participation/v1/channels
Joins an Ordering Service Node (OSN) to a channel.
GET /participation/v1/channels/{channelID}
Returns detailed channel information for a specific channel Ordering Service Node (OSN) has joined.
DELETE /participation/v1/channels/{channelID}
Removes an Ordering Service Node (OSN) from a channel.
GET /participation/v1/channels/{channelID}/blocks/{blockID}
Returns a specific channel block for a specific Channel Ordering Service (OSN) node.
GET /version
Returns the orderer or peer version and the commit SHA on which the release was created.
Raw JSON Specification
{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http",
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "description": "Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing\nsolutions and applications. Its modular and versatile design satisfies a broad range of industry use\ncases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.",
    "title": "Fabric API",
    "license": {
      "name": "Apache-2.0"
    },
    "version": "2.3"
  },
  "paths": {
    "/healthz": {
      "get": {
        "tags": [
          "operations"
        ],
        "summary": "Retrieves all registered health checkers for the process.",
        "operationId": "healthz",
        "responses": {
          "200": {
            "description": "Ok."
          },
          "503": {
            "description": "Service unavailable."
          }
        }
      }
    },
    "/logspec": {
      "get": {
        "tags": [
          "operations"
        ],
        "summary": "Retrieves the active logging spec for a peer or orderer.",
        "operationId": "logspecget",
        "responses": {
          "200": {
            "description": "Ok."
          }
        }
      },
      "put": {
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "operations"
        ],
        "summary": "Updates the active logging spec for a peer or orderer.",
        "operationId": "logspecput",
        "parameters": [
          {
            "type": "string",
            "description": "The payload must consist of a single attribute named spec.",
            "name": "payload",
            "in": "formData",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          },
          "400": {
            "description": "Bad request."
          }
        }
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "operations"
        ],
        "operationId": "metrics",
        "responses": {
          "200": {
            "description": "Ok."
          }
        }
      }
    },
    "/participation/v1/channels": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Returns the complete list of channels an Ordering Service Node (OSN) has joined.",
        "operationId": "listChannels",
        "responses": {
          "200": {
            "description": "Successfully retrieved channels.",
            "schema": {
              "$ref": "#/definitions/channelList"
            },
            "headers": {
              "Cache-Control": {
                "type": "string",
                "description": "The directives for caching responses"
              },
              "Content-Type": {
                "type": "string",
                "description": "The media type of the resource"
              }
            }
          }
        }
      },
      "put": {
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "channels"
        ],
        "summary": "Update config block of the Order Service Node (OSN) to the channel.",
        "operationId": "updateChannel",
        "parameters": [
          {
            "type": "string",
            "name": "configUpdateEnvelope",
            "in": "formData",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Π‘hannel update successfully.",
            "schema": {
              "$ref": "#/definitions/channelInfo"
            },
            "headers": {
              "Content-Type": {
                "type": "string",
                "description": "The media type of the resource"
              },
              "Location": {
                "type": "string",
                "description": "The URL to redirect a page to"
              }
            }
          },
          "400": {
            "description": "Cannot update channel."
          },
          "403": {
            "description": "The client is trying to update an app-channel that is a follower."
          },
          "405": {
            "description": "The client is trying to update an app-channel that not exists."
          },
          "409": {
            "description": "The client is trying to update a channel that is currently being removed."
          },
          "500": {
            "description": "Removal of channel failed."
          }
        }
      },
      "post": {
        "description": "If a channel does not yet exist, it will be created.",
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "channels"
        ],
        "summary": "Joins an Ordering Service Node (OSN) to a channel.",
        "operationId": "joinChannel",
        "parameters": [
          {
            "type": "string",
            "name": "configBlock",
            "in": "formData",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Successfully joined channel.",
            "schema": {
              "$ref": "#/definitions/channelInfo"
            },
            "headers": {
              "Content-Type": {
                "type": "string",
                "description": "The media type of the resource"
              },
              "Location": {
                "type": "string",
                "description": "The URL to redirect a page to"
              }
            }
          },
          "400": {
            "description": "Cannot join channel."
          },
          "405": {
            "description": "The client is trying to join an app-channel that exists."
          },
          "409": {
            "description": "The client is trying to join a channel that is currently being removed."
          },
          "500": {
            "description": "Removal of channel failed."
          }
        }
      }
    },
    "/participation/v1/channels/{channelID}": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Returns detailed channel information for a specific channel Ordering Service Node (OSN) has joined.",
        "operationId": "listChannel",
        "parameters": [
          {
            "type": "string",
            "description": "Channel ID",
            "name": "channelID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved channel.",
            "schema": {
              "$ref": "#/definitions/channelInfo"
            },
            "headers": {
              "Cache-Control": {
                "type": "string",
                "description": "The directives for caching responses"
              },
              "Content-Type": {
                "type": "string",
                "description": "The media type of the resource"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "channels"
        ],
        "summary": "Removes an Ordering Service Node (OSN) from a channel.",
        "operationId": "removeChannel",
        "parameters": [
          {
            "type": "string",
            "description": "Channel ID",
            "name": "channelID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully removed channel."
          },
          "400": {
            "description": "Bad request."
          },
          "404": {
            "description": "The channel does not exist."
          },
          "409": {
            "description": "The channel is pending removal."
          }
        }
      }
    },
    "/participation/v1/channels/{channelID}/blocks/{blockID}": {
      "get": {
        "produces": [
          "application/octet-stream"
        ],
        "tags": [
          "channels"
        ],
        "summary": "Returns a specific channel block for a specific Channel Ordering Service (OSN) node.",
        "operationId": "fetchBlock",
        "parameters": [
          {
            "type": "string",
            "description": "Channel ID",
            "name": "channelID",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "Block ID",
            "name": "blockID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful block download.",
            "schema": {
              "type": "file"
            }
          },
          "400": {
            "description": "Bad request."
          },
          "404": {
            "description": "The channel or block does not exist."
          }
        }
      }
    },
    "/version": {
      "get": {
        "tags": [
          "operations"
        ],
        "summary": "Returns the orderer or peer version and the commit SHA on which the release was created.",
        "operationId": "version",
        "responses": {
          "200": {
            "description": "Ok."
          }
        }
      }
    }
  },
  "definitions": {
    "ChannelInfoShort": {
      "type": "object",
      "title": "ChannelInfoShort carries a short info of a single channel.",
      "properties": {
        "name": {
          "description": "The channel name.",
          "type": "string",
          "x-go-name": "Name"
        },
        "url": {
          "description": "The channel relative URL (no Host:Port, only path), e.g.: \"/participation/v1/channels/my-channel\".",
          "type": "string",
          "x-go-name": "URL"
        }
      },
      "x-go-package": "github.com/hyperledger/fabric/orderer/common/types"
    },
    "ConsensusRelation": {
      "type": "string",
      "title": "ConsensusRelation represents the relationship between the orderer and the channel's consensus cluster.",
      "x-go-package": "github.com/hyperledger/fabric/orderer/common/types"
    },
    "Status": {
      "description": "Status represents the degree by which the orderer had caught up with the rest of the cluster after joining the\nchannel (either as a consenter or a follower).",
      "type": "string",
      "x-go-package": "github.com/hyperledger/fabric/orderer/common/types"
    },
    "channelInfo": {
      "description": "This is marshaled into the body of the HTTP response.",
      "type": "object",
      "title": "ChannelInfo carries the response to an HTTP request to List a single channel.",
      "properties": {
        "consensusRelation": {
          "$ref": "#/definitions/ConsensusRelation"
        },
        "height": {
          "description": "Current block height.",
          "type": "integer",
          "format": "uint64",
          "x-go-name": "Height"
        },
        "name": {
          "description": "The channel name.",
          "type": "string",
          "x-go-name": "Name"
        },
        "status": {
          "$ref": "#/definitions/Status"
        },
        "url": {
          "description": "The channel relative URL (no Host:Port, only path), e.g.: \"/participation/v1/channels/my-channel\".",
          "type": "string",
          "x-go-name": "URL"
        }
      },
      "x-go-name": "ChannelInfo",
      "x-go-package": "github.com/hyperledger/fabric/orderer/common/types"
    },
    "channelList": {
      "description": "This is marshaled into the body of the HTTP response.",
      "type": "object",
      "title": "ChannelList carries the response to an HTTP request to List all the channels.",
      "properties": {
        "channels": {
          "description": "Application channels only, nil or empty if no channels defined.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ChannelInfoShort"
          },
          "x-go-name": "Channels"
        },
        "systemChannel": {
          "$ref": "#/definitions/ChannelInfoShort"
        }
      },
      "x-go-name": "ChannelList",
      "x-go-package": "github.com/hyperledger/fabric/orderer/common/types"
    }
  },
  "tags": [
    {
      "description": "Channel Participation APIs",
      "name": "channels",
      "externalDocs": {
        "url": "https://hyperledger-fabric.readthedocs.io/en/latest/commands/osnadminchannel.html"
      }
    },
    {
      "description": "Operations APIs",
      "name": "operations",
      "externalDocs": {
        "url": "https://hyperledger-fabric.readthedocs.io/en/latest/operations_service.html"
      }
    }
  ]
}