Fix node run error and improve docker compose #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
之前用Docker compose运行4 validators的本地节点网络,节点内部的
crisis
模块的日志报出keeper.Keeper.AssetInvariants
的错误,还提示:
然后我发现了是SDK的这个模块的BUG,但是没追究其原因,我又看了下,感觉
go.mod
里面的sdk版本是包含了这些Fixs的但是我本机,不在容器里面编译就可以在ubuntu 20.04的环境里面运行,所以我把Dockerfile里面的golang版本和ubuntu的版本都升级到跟我本机编译开发环境保持一致,
最后运行docker compose的时候,节点就没有报错了,并且4个validators节点正常出块,并且同一高度的block的hash是一致的。
其实Dockerfile还可以优化,直接把golang的alpine Linux版本删除,在ubuntu上构建项目,他们文昌链为什么会这样做,用Alpine Linux编译,然后拷贝到ubuntu上,是因为golang的官方Docker镜像就是推荐用Alpine Linux的镜像版本,而且他们想用musl编译项目,让irita的二进制全静态,不依赖任何动态库,所以Dockerfile里面又要下载muslc的静态库.a文件之类的,搞得很烦人。
其实完全不必这么麻烦,都容器运行了,动态静态无所谓,所以可以考虑改天优化掉。