FEIP29V2_Service(en-US)



  • FEIP29: Service
    Version: 2
    Language: en-US
    Author: C_armX, Deisler-JJ_Sboy
    Status: draft
    Created date: 2021-11-01
    Last modified date:2021-11-01
    File hash: ""
    TXid: 
    

    FEIP29V2_Service(en-US)

    Contents

    Introduction

    General rules of FEIP type protocols

    Rules specific to this protocol

    Start a service

    Stop a service

    Restart a service

    Update a service

    Rate a service

    Introduction

    Protocol type: FEIP
    Serial number: 29
    Protocol name: Service
    Version: 2
    Description :  声明提供、终止、更新或评价某种服务。
    Author: C_armX, Deisler-JJ_Sboy
    Language: en-US
    Tags: FEIP, Service
    Previous version hash:""
    

    General rules of FEIP type protocols

    1. Write important data in OP_RETURN for public witness under FEIP type protocols

    2. The max size of OP_RETURN : 4096 bytes

    3. Format : compacted json

    4. Encoding : utf-8

    Rules specific to this protocol

    1. 任何cid可以通过本协议发布自己愿意提供的服务。

    2. 发送交易的txid为该服务的全网唯一id,称为"sid"。

    3. 服务名称(stdName)由发布者自定义。

    4. 可以用"[stdName]"+"@"+"[cid]"指代一项服务,如freedrive@freer_ew8H,便于识别。

    5. 发布者应保证自己发布的不同服务使用不同的stdName。

    流程

    1. 发布服务:在链上发布服务,参见发布服务;

    2. 更新服务:在链上更新已发布的服务信息,参见更新服务;

    3. 终止服务:在链上注销服务,宣布终止该服务终止运行和服务,参见终止服务;

    4. 评价服务:在链上对该服务进行评价,参见评价服务,评分基于币天销毁加权平均。

    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 hash 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.pubKey hex 66 The public key of the FCH identity designated by the publisher for this service N

    Example of starting a service

    {
        "type": "FEIP",
        "sn": 29,
        "ver": 2,
        "name": "Service",
        "hash": "",
        "data":{
            "op": "start",
            "stdName": "freedrive",
            "localName": ["飞盘","フリスビー"],
            "desc": "Free and open cloud storage service",
            "type": ["cloud storage","infrastructure"],
            "url": "https://freedrive.com",
            "pubKey": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4"
        }
    }
    

    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 hash 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",
        "hash": "",
        "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 hash 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",
        "hash": "",
        "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 hash 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.pubKey hex 66 The public key of the FCH identity designated by the publisher for this service N

    Example of updating a Service

    {
        "type": "FEIP",
        "sn": 29,
        "ver": 2,
        "name": "Service",
        "hash": "",
        "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",
    		"pubKey": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4"
        }
    }
    

    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 hash 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",
        "hash": "",
        "data":{
            "sid": "1111111111222222222233333333344444444444",
            "op": "rate",
            "rate": 4
        }
    }
    

    最终评分基于币天销毁加权平均。

    二维码

    本协议的二维码用于扫描获取服务的sid:

    {
        "type": "FEIP",
        "sn": 29,
        "ver": 2,
        "data":{
            "sid":"1111111111222222222233333333344444444444"
        }
    }
    

Log in to reply