以太坊2.0最新的测试网里面,这两个客户端的受众最多,下面是我的一些安装和代码体验。
Lighthouse安装
首先体验了Lighthouse的安装,Lighthouse是基于Rust开发的,可查看下面官方提供的文档
LightHouse官方安装指南
Windows上安装
Rust在win上面安装比在Linux下面麻烦很多,经历了如下操作。
- Download and install “Build Tools for Visual Studio:”
You can get it at this link: https://aka.ms/buildtools.
Run the installation file: vs_buildtools.exe.
Ensure the “Windows 10 SDK” component is included when installing the Visual C++ Build Tools.
Restart your computer. - Install LLVM: https://releases.llvm.org/download.html
- Install OpenSSL with vcpkg:
- Finally, install cmake: https://cmake.org/download/
mkdir C:\Tools
cd C:\Tools
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe install openssl:x64-windows-static
安装OpenSSL的时候使用vcpkg无法安装,下载了安装包OpenSSL-Win64,手动配置了环境变量。
OPENSSL_DIR D:\Program Files\OpenSSL-Win64
PATH %OPENSSL_DIR%\bin
配置完这些发现,使用cargo build还是不能编译
error[E0433]: failed to resolve: could not find `unix` in `os`
--> C:\Users\mec\.cargo\registry\src\github.com-1ecc6299db9ec823\leveldb-sys-2.0.5\src/build.rs:6:14
|
6 | use std::os::unix::fs::PermissionsExt;
| ^^^^ could not find `unix` in `os`
error[E0599]: no method named `mode` found for struct `std::fs::Permissions` in the current scope
--> C:\Users\mec\.cargo\registry\src\github.com-1ecc6299db9ec823\leveldb-sys-2.0.5\src/build.rs:178:30
|
178 | let current_mode = p

本文分享了在Windows和Ubuntu上安装以太坊2.0客户端Lighthouse与Prysm的体验。在Windows上,Lighthouse的Rust环境配置复杂,可能不支持Windows开发。而在Ubuntu上,Lighthouse安装迅速但遇到编译问题。Prysm的安装相对简单,直接运行即可,适合仅需验证节点的用户。对于Prysm的源码研究,需要设置代理才能正常下载和运行测试用例。
最低0.47元/天 解锁文章
5484

被折叠的 条评论
为什么被折叠?



