1 Star 0 Fork 1

坚强的小二/blockchain-explorer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
swagger.json 49.16 KB
一键复制 编辑 原始数据 按行查看 历史
akshay 提交于 2018-06-27 13:04 . BE 323 Swagger URL's
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
{
"swagger": "2.0",
"info": {
"title": "Hyperledger Explorer REST API Swagger",
"description": "Rest API for fabric .",
"version": "1.0.0",
"contact": {
"name": "Hyperledger Team",
"email": ""
}
},
"host": "localhost:8080",
"schemes": [
"http"
],
"basePath": "/api",
"produces": [
"application/json"
],
"tags": [
{
"name": "Channel",
"description": "Everything about your channel"
},
{
"name": "Chaincodes",
"description": "Everything about your chaincodes"
},
{
"name": "Blocks",
"description": "Everything about your blocks"
},
{
"name": "Transactions",
"description": "Everything about your transactions"
}
],
"paths": {
"/channels": {
"get": {
"tags": [
"Channel"
],
"summary": "Query to fetch channels",
"description": "Query to fetch channels",
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Channels"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/status/{channelName}": {
"get": {
"tags": [
"Channel"
],
"summary": "Query to get BlockCount on a channel",
"description": "Query to get BlockCount on a channel",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"chaincodeCount": {
"type": "string"
},
"txCount": {
"type": "string"
},
"peerCount": {
"type": "string"
},
"latestBLock": {
"type": "number"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"/curChannel": {
"get": {
"tags": [
"Channel"
],
"summary": "get Current channel",
"description": "get Current channel",
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/curChannel"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/changeChannel/{channelName}": {
"get": {
"tags": [
"Channel"
],
"summary": "Query to get Change Channel on a channel",
"description": "Query to get Change Channel on a channel",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/changeChannel"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/chaincode/{channelName}": {
"get": {
"tags": [
"Chaincodes"
],
"summary": "Query to fetch all Installed/instantiated chaincodes",
"description": "Query to fetch all Installed/instantiated chaincodes",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"path": {
"type": "string"
},
"genesis_block_hash": {
"type": "string"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/channel": {
"post": {
"tags": [
"Channel"
],
"summary": "Create New channel on target peers ",
"description": "Create New channel on target peers",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "channelName",
"in": "formData",
"description": "channel name",
"required": true,
"type": "string"
},
{
"name": "genesisBlock",
"in": "formData",
"description": "gensis block",
"required": true,
"type": "string"
},
{
"name": "orgName",
"in": "formData",
"description": "organation name ",
"required": true,
"type": "string"
},
{
"name": "channelArtificats",
"in": "formData",
"description": "channelArtificats",
"required": true,
"type": "array",
"items": {
"type": "file"
}
},
{
"name": "profile",
"in": "formData",
"description": "block profile",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/joinChannel": {
"post": {
"tags": [
"Channel"
],
"summary": "join channel ",
"description": "join channel ",
"consumes": [
"application/json",
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"parameters": [
{
"in":"body",
"name":"body",
"description": "payload",
"schema": {
"type": "object",
"required":true,
"properties": {
"channelName": {
"type": "string"
},
"orgName": {
"type": "string"
},
"peers": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/block/{channelName}/{number}": {
"get": {
"tags": [
"Blocks"
],
"summary": "Query to Fetch Blocks",
"description": "Query to Fetch Blocks",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "number",
"in": "path",
"description": "block number",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"number": {
"type": "string"
},
"previous_hash": {
"type": "string"
},
"genesis_block_hash": {
"type": "string"
},
"data_hash": {
"type": "string"
},
"transactions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"signature": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "number"
}
}
}
},
"payload": {
"$ref": "#/definitions/blockPayload"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/block/transactions/{channelName}/{number}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Fetch Block Transactions",
"description": "Query to Fetch Block Transactions",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "number",
"in": "path",
"description": "block number",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"number": {
"type": "number"
},
"txCount": {
"type": "number"
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/transaction/{channelName}/{txid}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Get Transaction by Txid",
"description": "Query to Get Transaction by Txid",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "txid",
"in": "path",
"description": "transaction id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"row": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"genesis_block_hash": {
"type": "string"
},
"channelname": {
"type": "string"
},
"blockid": {
"type": "number"
},
"txhash": {
"type": "string"
},
"createdt": {
"type": "string"
},
"chaincodename": {
"type": "string"
},
"status": {
"type": "number"
},
"creator_msp_id": {
"type": "string"
},
"endorser_msp_id": {
"type": "string"
},
"chancode_id": {
"type": "string"
},
"type": {
"type": "string"
},
"read_set": {
"type": "array",
"items": {
"$ref": "#/definitions/Set"
}
},
"write_set": {
"type": "array",
"items": {
"$ref": "#/definitions/Set"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/txList/{channelName}/{number}/{txid}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Get Trasaction List",
"description": "Query to Get Trasaction List",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "gensis_block_hash",
"required": true,
"type": "string"
},
{
"name": "number",
"in": "path",
"description": "block number",
"required": true,
"type": "number"
},
{
"name": "txid",
"in": "path",
"description": "block number",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"channelname": {
"type": "string"
},
"genesis_block_hash": {
"type": "string"
},
"blockid": {
"type": "number"
},
"txhash": {
"type": "string"
},
"createdt": {
"type": "string"
},
"chaincodename": {
"type": "string"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/peers/{channelName}": {
"get": {
"tags": [
"Channel"
],
"summary": "Peers",
"description": "Peers",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"peers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"requests": {
"type": "string"
},
"genesis_block_hash": {
"type": "string"
},
"server_hostname": {
"type": "string"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/peersStatus/{channelName}": {
"get": {
"tags": [
"Channel"
],
"summary": "Query Get PeersStatus",
"description": "Query Get PeersStatus",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "channel name",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"peers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"requests": {
"type": "string"
},
"server_hostname": {
"type": "string"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/blockAndTxList/{channelName}/{number}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Get Block And Transaction List",
"description": "Query to Get Block And Transaction List",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "number",
"in": "path",
"description": "block number",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"blocknum": {
"type": "number"
},
"genesis_block_hash": {
"type": "string"
},
"data_hash": {
"type": "string"
},
"prehash": {
"type": "string"
},
"channelname": {
"type": "string"
},
"txCount": {
"type": "number"
},
"createdt": {
"type": "string"
},
"prev_blockhash": {
"type": "string"
},
"blockhash": {
"type": "string"
},
"txhash": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/txByMinute/{channelName}/{hours}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Get Trasaction BY Minute",
"description": "Query to Get Trasaction By Minute",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "hours",
"in": "path",
"description": "hours ",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"$ref": "#/definitions/TxCount"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/txByHour/{channelName}/{days}": {
"get": {
"tags": [
"Transactions"
],
"summary": "Query to Get Trasaction By Hour",
"description": "Queryto Get Trasaction BY Hour",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "days",
"in": "path",
"description": "days",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"$ref": "#/definitions/TxCount"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/blocksByMinute/{channelName}/{hours}": {
"get": {
"tags": [
"Blocks"
],
"summary": "Query to Get Blocks BY Minute",
"description": "Query to Get Blocks By Minute",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "hours",
"in": "path",
"description": "hours ",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"$ref": "#/definitions/TxCount"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/blocksByHour/{channelName}/{days}": {
"get": {
"tags": [
"Blocks"
],
"summary": "Query to Get Blocks By Hour",
"description": "Query to Get Blocks By Hour",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
},
{
"name": "days",
"in": "path",
"description": "days",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"$ref": "#/definitions/TxCount"
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/txByOrg/{channelName}": {
"get": {
"tags": [
"Blocks"
],
"summary": "Query Get Trasaction By Org",
"description": "Query Get Trasaction BY Org",
"parameters": [
{
"name": "channelName",
"in": "path",
"description": "genesis_block_hash",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "string"
},
"creator_msp_id": {
"type": "string"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/channels/info": {
"get": {
"tags": [
"Channels"
],
"summary": "Query to Get Channels Inforamtion",
"description": "Query to Get channel Information",
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "number"
},
"channels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"channelName": {
"type": "string"
},
"genesis_block_hash": {
"type": "string"
},
"channel_hash": {
"type": "string"
},
"createdat": {
"type": "string"
},
"blocks": {
"type": "number"
},
"transactions": {
"type": "number"
}
}
}
}
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Channels": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"type": "array",
"items": {
"type": "integer"
}
}
},
"curChannel": {
"type": "object",
"properties": {
"currentChannel": {
"type": "string"
}
}
},
"blockPayload": {
"type": "object",
"properties": {
"header": {
"type": "object",
"properties": {
"channel_header": {
"type": "object",
"properties": {
"version": {
"type": "number"
},
"type": {
"type": "number"
},
"time_stamp": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"txid": {
"type": "string"
},
"epoch": {
"type": "string"
}
}
}
},
"signature_header": {
"type": "object",
"properties": {
"creator": {
"type": "object",
"properties": {
"Mspid": {
"type": "string"
},
"Idbytes": {
"type": "string"
}
}
},
"nonce": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "number"
}
},
"type": {
"type": "string"
}
}
}
}
}
},
"data": {
"type": "object"
}
}
},
"Set": {
"type": "object",
"properties": {
"chaincode": {
"type": "string"
},
"set": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"version": {
"type": "object",
"properties": {
"block_num": {
"type": "number"
},
"tx_num": {
"type": "number"
}
}
}
}
}
}
}
},
"TxCount": {
"type": "object",
"properties": {
"datetime": {
"type": "string"
},
"count": {
"type": "string"
}
}
},
"Error": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
}
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gtx/blockchain-explorer.git
[email protected]:gtx/blockchain-explorer.git
gtx
blockchain-explorer
blockchain-explorer
master

搜索帮助