一、环境准备
DeepNode支持LinuxUbuntu 20.04+、CentOS 8+及macOS 12+系统,需提前确保环境满足以下依赖:- Node.js 16.0.0+
- Git 2.20.0+
- Python 3.8.0+
- 系统需启用`curl`、`wget`及基础编译工具如`gcc`、`make`。
二、安装依赖工具
根据系统类型执行以下命令安装依赖:Ubuntu/Debian系统:
sudo apt update && sudo apt install -y nodejs git python3 gcc make curlCentOS/RHEL系统:
sudo yum install -y nodejs git python3 gcc make curlmacOS系统需先安装Homebrew:
brew install node git python3安装后验证依赖版本: node -v && git --version && python3 --version 需显示对应版本号,如`v16.18.0`、`git version 2.34.1`
三、克隆DeepNode源码
通过Git克隆官方仓库至本地: git clone https://github.com/deepnode/deepnode.git进入项目目录: cd deepnode
四、配置环境变量
设置DeepNode主目录环境变量单次会话生效,永久生效需写入`.bashrc`或`.zshrc`: export DEEPNODE_HOME=$(pwd)加载配置文件: source $DEEPNODE_HOME/config/env.sh
五、编译与安装
执行依赖安装命令: npm install编译核心模块: npm run build 编译成功会显示`[DeepNode] Build completed successfully`
安装至系统路径: sudo npm link
六、验证安装
检查DeepNode版本: deepnode --version 输出格式:`DeepNode v1.2.0 (commit: xxxxxxx)`运行测试节点: deepnode start --testnet 成功启动会显示`[Node] Connected to testnet, block height: xxx`
- Git 2.20.0+
