我在我的 Windows 机器上安装了 Linux 子系统,然后在 Microsoft guide 之后添加了 Ubuntu 应用程序,然后按照 their guide 安装 Hyperledger Sawtooth对于Ubuntu。一旦我到了通过运行验证程序对其进行测试的地步,我就遇到了磁盘类型错误——
$ sudo -u sawtooth sawtooth-validator -vv
[INFO cli] sawtooth-validator (Hyperledger Sawtooth) version 1.0.1
[INFO path] Skipping path loading from non-existent config file: /etc/sawtooth/path.toml
[INFO validator] Skipping validator config loading from non-existent config file: /etc/sawtooth/validator.toml
[INFO keys] Loading signing key: /etc/sawtooth/keys/validator.priv
[INFO cli] config [path]: config_dir = "/etc/sawtooth"; config [path]: key_dir = "/etc/sawtooth/keys"; config [path]: data_dir = "/var/lib/sawtooth"; config [path]: log_dir = "/var/log/sawtooth"; config [path]: policy_dir = "/etc/sawtooth/policy"
[WARNING cli] Network key pair is not configured, Network communications between validators will not be authenticated or encrypted.
[DEBUG core] global state database file is /var/lib/sawtooth/merkle-00.lmdb
Traceback (most recent call last):
File "/usr/bin/sawtooth-validator", line 9, in <module>
load_entry_point('sawtooth-validator==1.0.1', 'console_scripts', 'sawtooth-validator')()
File "/.../sawtooth_validator/server/cli.py", line 365, in main
metrics_registry=wrapped_registry)
File "/.../sawtooth_validator/server/core.py", line 114, in __init__
global_state_db = LMDBNoLockDatabase(global_state_db_filename, 'c')
File "/.../sawtooth_validator/database/lmdb_nolock_database.py", line 57, in __init__
lock=True)
lmdb.DiskError: /var/lib/sawtooth/merkle-00.lmdb: No space left on device
错误似乎与 this line 有关在他们的来源中,但我不明白为什么我会看到磁盘不足的警告,因为我有将近 30gb 的可用空间。
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 238G 211G 27G 89% /
none 238G 211G 27G 89% /dev
none 238G 211G 27G 89% /run
none 238G 211G 27G 89% /run/lock
none 238G 211G 27G 89% /run/shm
none 238G 211G 27G 89% /run/user
C: 238G 211G 27G 89% /mnt/c
启动这个程序实际上会占用那么多空间,我是不是在 Linux 子系统上做错了什么,我是否需要为验证器设置某种配置,或者程序有问题吗?对此的任何见解都会非常有帮助。
最佳答案
Sawtooth 区 block 链存储在 Sparse File 中它似乎占据了许多千兆字节的空间,但实际上有空的、零字节的“漏洞”。这可能会导致 Windows 的 Ubuntu 子系统出现问题,因为它试图映射大小为 1024 x 1024 x 1024 x 1024 的内存,即 1 099 511 627 776 B 或 1024 GiB。
关于python - Hyperledger Sawtooth Validator——设备上没有空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48951759/