FEIP29V2_Service(en-US)
-
FEIP29: Service Version: 2 Language: en-US Author: C_armX, Deisler-JJ_Sboy, write_cash Status: draft Created date: 2021-11-01 Last modified date:2022-04-05 PID: "" TXID:
FEIP29V2_Service(en-US)
Contents
General rules of FEIP type protocols
Rules specific to this protocol
Introduction
Protocol type: FEIP Serial number: 29 Protocol name: Service Version: 2 Description : 声明提供、终止、更新或评价某种服务。 Author: C_armX, Deisler-JJ_Sboy Language: en-US Previous version PID:""
General consensus of FEIP type protocols
-
Write important data in OP_RETURN for public witness under FEIP type protocols.
-
The SIGHASH flag of all transaction inputs is ‘ALL’ (value 0x01).
-
The max size of OP_RETURN : 4096 bytes.
-
The format of the data in op_return: JSON.
-
Encoding : utf-8.
Consensus of this protocol
-
任何cid可以通过本协议发布自己愿意提供的服务。
-
发送交易的txid为该服务的全网唯一id,称为"sid"。
-
服务名称(stdName)由发布者自定义。
-
可以用"[stdName]"+"@"+"[cid]"指代一项服务,如freedrive@freer_ew8H,便于识别。
-
发布者应保证自己发布的不同服务使用不同的stdName。
流程
-
发布服务:在链上发布服务,参见发布服务;
-
更新服务:在链上更新已发布的服务信息,参见更新服务;
-
终止服务:在链上注销服务,宣布终止该服务终止运行和服务,参见终止服务;
-
评价服务:在链上对该服务进行评价,参见评价服务,评分基于币天销毁加权平均。
Start a service
本服务发布者发送一笔交易。op_return内容为:
field number field name type length content required 1 type String 4 Fixed: "FEIP"<br>Case insensitive Y 2 sn int 2 Serial number<br>Fixed: 29 Y 3 ver int 1 Fixed: 2 Y 4 name String 7 Fixed: "Service"<br>Case insensitive N 5 pid hex 64 Sha256 value of this protocol file N 6 data.op string 6 operation: "start" Y 7 data.stdName string 64 the name of the service in english Y 8 data.localName string array 1024 service names in different languages N 9 data.desc string 1024 Description of this service N 10 data.type string array 256 The types of the service N 11 data.url string 512 URL describing the service N 12 data.pubKeyAdmin hex 66 The public key of the FCH identity designated by the publisher for this service N 13 data.prot string array 512 The protocols followed by this service N 14 data.params structure 512 Parameters customized by the service provider. N Example of starting a service
{ "type": "FEIP", "sn": 29, "ver": 2, "name": "Service", "pid": "", "data": { "op": "start", "stdName": "freedrive", "localName": ["飞盘", "フリスビー"], "desc": "Free and open cloud storage service", "type": ["cloud storage", "infrastructure"], "url": "https://freedrive.com", "pubKeyAdmin": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4", "prot": ["b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", "37406e3e45750efccdb060ca2e748f9f026aebb7dadade8e8747340f380edaca"], "params": { "p1": 0, "p2": "" } } }
Stop a service
本服务发布者发送一笔交易。op_return内容为:
field number field name type length content required 1 type String 4 Fixed: "FEIP"<br>Case insensitive Y 2 sn int 2 Serial number<br>Fixed: 28 Y 3 ver int 1 Fixed: 2 Y 4 name String 4 Fixed: "Service"<br>Case insensitive N 5 pid hex 64 Sha256 value of this protocol file N 6 data.sid hex 64 Txid when starting the service Y 7 data.op string 7 operation: "stop" Y Example of stopping a service
{ "type": "FEIP", "sn": 29, "ver": 2, "name": "Service", "pid": "", "data":{ "sid": "1111111111222222222233333333344444444444", "op": "stop" } }
Restart a service
本服务发布者发送一笔交易。op_return内容为:
field number field name type length content required 1 type String 4 Fixed: "FEIP"<br>Case insensitive Y 2 sn int 2 Serial number<br>Fixed: 28 Y 3 ver int 1 Fixed: 2 Y 4 name String 4 Fixed: "Service"<br>Case insensitive N 5 pid hex 64 Sha256 value of this protocol file N 6 data.sid hex 64 Txid when starting the service Y 7 data.op string 7 operation: "restart" Y Example of restarting a Service
{ "type": "FEIP", "sn": 29, "ver": 2, "name": "Service", "pid": "", "data":{ "sid": "1111111111222222222233333333344444444444", "op": "restart" } }
Update a service
本服务发布者发送一笔交易。op_return内容为:
field number field name type length content required 1 type String 4 Fixed: "FEIP"<br>Case insensitive Y 2 sn int 2 Serial number<br>Fixed: 29 Y 3 ver int 1 Fixed: 2 Y 4 name String 7 Fixed: "Service"<br>Case insensitive N 5 pid hex 64 Sha256 value of this protocol file N 6 data.sid hex 64 Txid when starting the service Y 7 data.op string 6 operation: "update" Y 8 data.stdName string 64 the name of the service in english Y 9 data.localName string array 1024 service names in different languages N 10 data.desc string 1024 Description of this service N 11 data.type string array 256 The types of the service N 12 data.url string 512 URL describing the service N 13 data.pubKeyAdmin hex 66 The public key of the FCH identity designated by the publisher for this service N 14 data.prot string array 512 The protocols followed by this service N 15 data.params structure 512 Parameters customized by the service provider. N Example of updating a Service
{ "type": "FEIP", "sn": 29, "ver": 2, "name": "Service", "pid": "", "data":{ "sid": "1111111111222222222233333333344444444444", "op": "update", "stdName": "freedrive#1", "localName": ["飞盘#1","フリスビー#1"], "desc": "Free and open cloud storage service", "type": ["cloud storage","infrastructure"], "url": "https://freedrive.com", "pubKeyAdmin": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4", "prot": ["b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", "37406e3e45750efccdb060ca2e748f9f026aebb7dadade8e8747340f380edaca"], "params": { "p1": 0, "p2": "" } } }
Rate a service
评价者发送一笔交易。op_return内容为:
field number field name type length content required 1 type String 4 Fixed: "FEIP"<br>Case insensitive Y 2 sn int 2 Serial number<br>Fixed: 28 Y 3 ver int 1 Fixed: 2 Y 4 name String 4 Fixed: "Service"<br>Case insensitive N 5 pid hex 64 Sha256 value of this protocol file N 6 data.sid hex 64 Txid when starting the service Y 7 data.op string 7 operation: "rate" Y 8 data.rate int 1 Rating of the service from 0 to 5 Y Example of Rating a Service
{ "type": "FEIP", "sn": 29, "ver": 2, "name": "Service", "pid": "", "data":{ "sid": "1111111111222222222233333333344444444444", "op": "rate", "rate": 4 } }
最终评分基于币天销毁加权平均。
二维码
本协议的二维码用于扫描获取服务的sid:
FC: { "type": "FEIP", "sn": 29, "ver": 2, "data":{ "sid":"1111111111222222222233333333344444444444" } }
-