【问题标题】:what the numeric value mean in hyperledger fabric channel configuration超级账本结构通道配置中的数值意味着什么
【发布时间】:2020-01-31 15:08:32
【问题描述】:

我正在研究通道配置的部分,所以我看到了 json 格式的配置块。 我不知道类型是什么意思,类型的数值是什么意思。 谁能给我解释一下?谢谢

{
  "data": {
    "data": [
      {
        "payload": {
          "data": {
            "config": {
              "channel_group": {
                "groups": {
                  "Application": {
                    "groups": {
                      "Org1MSP": {
                        "groups": {},
                        "mod_policy": "Admins",
                        "policies": {
                          "Admins": {
                            "mod_policy": "Admins",
                            "policy": {
                              "type": 1,  **what's this?**
                              "value": {
                                "identities": [
                                  {
                                    "principal": {
                                      "msp_identifier": "Org1MSP",
                                      "role": "ADMIN"
                                    },
                                    "principal_classification": "ROLE"
                                  }
                                ],
                                "rule": {
                                  "n_out_of": {
                                    "n": 1,
                                    "rules": [
                                      {
                                        "signed_by": 0
                                      }
                                    ]
                                  }
                                },
                                "version": 0
                              }
                            },
                            "version": "0"
                          },

【问题讨论】:

    标签: hyperledger-fabric


    【解决方案1】:

    我猜这是一个引用 PolicyType 枚举的数字:

    message Policy {
        enum PolicyType {
            UNKNOWN = 0; // Reserved to check for proper initialization
            SIGNATURE = 1;
            MSP = 2;
            IMPLICIT_META = 3;
        }
        int32 type = 1; // For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
        bytes policy = 2;
    }
    

    在您的示例中,Org1 的至少一名管理员必须签署更新网络配置的交易。

    Source of the policy documentation

    希望我回答了你的问题

    【讨论】:

    • 非常感谢。我理解你的意见。我觉得你是对的。祝你有美好的一天!
    • @PierreHenriDebris 你是否知道策略类型 2 是什么,即策略类型 MSP?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-10
    • 2011-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多