我正在尝试运行此处提供的 Fabric 示例:https : //github.com/hyperledger/fabric-samples/tree/release-1.2/first-network
我按照 Fabric 文档的所有说明进行操作:https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html
,但遇到错误“无法执行 End-2-End Scenario”。以下是我进入./byfn.sh up终端后的输出。
我什至没有在 google 和 stackoverflow 上发现任何类似的问题
./byfn.sh up
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
LOCAL_VERSION=1.2.0
DOCKER_IMAGE_VERSION=1.2.0
Starting peer1.org1.example.com ... done
Starting orderer.example.com ... done
Starting peer0.org2.example.com ... done
Starting peer1.org2.example.com ... done
Starting peer0.org1.example.com ... done
Starting cli ... done
____ _____ _ ____ _____
/ ___| |_ _| / …Run Code Online (Sandbox Code Playgroud) 数据结构是这样的:
way: {
_id:'9762264'
node: ['253333910', '3304026514']
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试以各种方式计算节点出现的频率。这是我使用 pymongo 的代码:
node = db.way.aggregate([
{'$unwind': '$node'},
{
'$group': {
'_id': '$node',
'appear_count': {'$sum': 1}
}
},
{'$sort': {'appear_count': -1}},
{'$limit': 10}
],
{'allowDiskUse': True}
)
Run Code Online (Sandbox Code Playgroud)
它会报错:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File ".../OSM Wrangling/explore.py", line 78, in most_passed_node
{'allowDiskUse': True}
File ".../pymongo/collection.py", line 2181, in aggregate
**kwargs)
File ".../pymongo/collection.py", line 2088, in _aggregate
client=self.__database.client)
File ".../pymongo/pool.py", line 464, in command
self.validate_session(client, session)
File ".../pymongo/pool.py", …Run Code Online (Sandbox Code Playgroud) 例如,我已经知道二进制数据:
"b'\x80\x03}q\x00(X\x03\x00\x00\x00ageq\x01K\x14X\x05\x00\x00\x00scoreq\x02KXX\x04\x00\x00\x00nameq\x03X\x03\x00\x00\x00Bobq\x04u.'"
Run Code Online (Sandbox Code Playgroud)
这是一个字母对象.
如何将其翻译成dict对象?我只能找到将文件读入对象的方法,但我找不到将现有数据转换为对象的方法.