Hyperledger Sawtooth版本升级咨询:操作方式及Docker镜像处理疑问
Let’s tackle your two core questions clearly, based on common workflows for Sawtooth upgrades:
Should I remove the old Hyperledger Sawtooth repo or pull the latest code and re-run build_all?
You don’t strictly need to delete the old 0.8 repo (unless you want to free up disk space), but cloning a fresh copy of the latest Sawtooth codebase is strongly recommended instead of updating your existing 0.8 repo. Here’s why:
- Sawtooth has undergone significant architectural changes since 0.8—old configuration files, build caches, or local modifications in your existing repo can interfere with the new build process.
- If you insist on reusing the old repo, first fully reset it to a clean state:
Even then, a fresh clone reduces the risk of hidden conflicts.git fetch --all git reset --hard origin/main # Replace `main` with the latest default branch if needed git clean -fdx # Removes all untracked files, build artifacts, and cached data
Can I just update my local repo and run build_all, or do I need to delete all old Docker images first?
Directly updating the old repo and running build_all is risky and likely to cause issues—you should delete old Sawtooth Docker images first, and here’s the breakdown:
- Sawtooth’s Dockerfile structure, base images, and dependencies have changed drastically since 0.8. Old image layers or cached build artifacts will lead to broken builds or incompatible images that fail to run.
- How to clean up safely:
- Targeted Sawtooth image removal (safer if you have other Docker projects):
docker rmi $(docker images | grep sawtooth | awk '{print $3}') - Full Docker system prune (use this only if you don’t need other unused Docker resources):
docker system prune -a
- Targeted Sawtooth image removal (safer if you have other Docker projects):
- After cleaning, either clone the latest repo or reset your existing repo (as above), then run
build_all—this ensures you’re building from a completely fresh state with all new dependencies and configurations.
Critical Bonus Tip
Before upgrading, make sure to back up any chain data you need to retain—Sawtooth’s data storage format (like the underlying database) may not be compatible between 0.8 and newer versions. Double-check the latest Sawtooth documentation for any version-specific migration steps if you need to preserve historical chain data.
内容的提问来源于stack exchange,提问作者Frank C.

