gpt4 book ai didi

blockchain - Hypelerdger Indy 节点 - 种子值

转载 作者:行者123 更新时间:2023-12-03 23:50:13 24 4
gpt4 key购买 nike

我正在使用 indy-sdk 并在步骤 3 ( https://github.com/hyperledger/indy-sdk/blob/master/docs/getting-started/indy-walkthrough.md#step-3-getting-the-ownership-for-stewards-verinym ) 的演练演示中, Steward 的种子值设置为等于 '000000000000000000000000Steward1'。

如果我更改它(或将其留空),则会出现错误。此外,在/tmp/indy/poo1.txn 中没有关于此特定值的信息。

我的问题是我们怎么知道这是正确的值(value)以及我们如何获得它?

最佳答案

为什么它不起作用
000000000000000000000000Steward1是种子(给定默认 key 派生方法)生成 DID Th7MpTaRZVRYnPiabds81Y .您可以使用 indy-cli 验证自己( command line tool )

indy> wallet create test key=123
Wallet "test" has been created

indy> wallet open test key=123
Wallet "test" has been opened

wallet(test):indy> did new seed=000000000000000000000000Steward1
Did "Th7MpTaRZVRYnPiabds81Y" has been created with "~7TYfekw4GUagBnBVCqPjiC" verkey

在您使用的网络中,DID 的所有者 VsKV7grR1BUE29mG2Fm2kX (即,知道其相关私钥或种子的人)拥有 steward授予在分类帐上执行各种操作的权限的角色。因此,如果您修改种子,它将生成不同的 DID,这些 DID 不需要执行本教程中进一步使用的操作(例如在分类帐上写入数据)的权限。

在哪里 000000000000000000000000Steward1来自(哪里

根据您所说的,我假设您使用的是来自 indy-sdk 存储库运行池 indy-node 中的预构建 docker 镜像。其中的实例,遵循其中的一些 instructions.
所以简单的答案是 000000000000000000000000Steward1 的配置在里面预烤。看 dockerfile用于构建印地池图像。注意这些行
RUN awk '{if (index($1, "NETWORK_NAME") != 0) {print("NETWORK_NAME = \"sandbox\"")} else print($0)}' /etc/indy/indy_config.py> /tmp/indy_config.py
RUN mv /tmp/indy_config.py /etc/indy/indy_config.py

让我们看看这些文件中有什么
docker exec indylocalhost cat '/etc/indy/indy_config.py'
# Current network

# Disable stdout logging
enableStdOutLogging = False

# Directory to store ledger.
LEDGER_DIR = '/var/lib/indy'

# Directory to store logs.
LOG_DIR = '/var/log/indy'

# Directory to store keys.
KEYS_DIR = '/var/lib/indy'

# Directory to store genesis transactions files.
GENESIS_DIR = '/var/lib/indy'

# Directory to store backups.
BACKUP_DIR = '/var/lib/indy/backup'

# Directory to store plugins.
PLUGINS_DIR = '/var/lib/indy/plugins'

# Directory to store node info.
NODE_INFO_DIR = '/var/lib/indy'
NETWORK_NAME = 'sandbox'%

这个
# Directory to store genesis transactions files.
GENESIS_DIR = '/var/lib/indy'

看起来像我们正在寻找的东西。让我们看看那里有什么
docker exec indylocalhost ls '/var/lib/indy/sandbox'
data
domain_transactions_genesis
keys
node1_additional_info.json
node1_info.json
node1_version_info.json
node2_additional_info.json
node2_info.json
node2_version_info.json
node3_additional_info.json
node3_info.json
node3_version_info.json
node4_additional_info.json
node4_info.json
node4_version_info.json
pool_transactions_genesis

在区块链中,创世文件通常是您最初用来启动网络并可能用一些数据填充网络的文件。在 hyperledger-indy 的情况下,有 4 个“子账本”,其中包含不同类型的交易: domain , pool , config , audit . domain子分类帐是包含诸如 DID 之类的内容的分类帐。 s、凭证架构或凭证定义。我们正在寻找一个 DID,所以让我们看看文件域创世文件。
docker exec indylocalhost cat '/var/lib/indy/sandbox/domain_transactions_genesis'
{"reqSignature":{},"txn":{"data":{"dest":"V4SGRU86Z58d6TV7PBUe6f","role":"0","verkey":"~CoRER63DVYnWZtK8uAzNbx"},"metadata":{},"type":"1"},"txnMetadata":{"seqNo":1},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"Th7MpTaRZVRYnPiabds81Y","role":"2","verkey":"~7TYfekw4GUagBnBVCqPjiC"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":2},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"EbP4aYNeTHL6q385GuVpRV","role":"2","verkey":"~RHGNtfvkgPEUQzQNtNxLNu"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":3},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"4cU41vWW82ArfxJxHkzXPG","role":"2","verkey":"~EMoPA6HrpiExVihsVfxD3H"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":4},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"TWwCRQRZ2ZHMJFn9TzLp7W","role":"2","verkey":"~UhP7K35SAXbix1kCQV4Upx"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":5},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"7JhapNNMLnwkbiC2ZmPZSE","verkey":"~LgpYPrzkB6awcHMTPZ9TVn"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":6},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"MEPecrczs4Wh6FA12u519D","verkey":"~A4rMgHYboWYS1DXibCgo9W"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":7},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"EAPtwgevBpzP8hkj9sxuzy","verkey":"~gmzSzu3feXC6g2djF7ar4"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":8},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"LuL1HK1sDruwkfm68jrVfD","verkey":"~Nyv9BKUJuvjgMbfbwk8CFD"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":9},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"dest":"462p8mtcX6jpa9ky565YEL","verkey":"~LCgq4hnSvMvB8nKd9vgsTD"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":10},"ver":"1"}

你可以看到 DID Th7MpTaRZVRYnPiabds81Y使用 verkey ~7TYfekw4GUagBnBVCqPjiC 在此分类帐上硬编码这与我们从种子中生成的相匹配 000000000000000000000000Steward1 .您还可以看到它被赋予的角色 "2" .如果您深入挖掘,您可以在 indy-plenum 中找到,共识算法。 indy 使用的项目,该角色 ID 2steward role .

关于blockchain - Hypelerdger Indy 节点 - 种子值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59089178/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com