# 🚀 Nockchain 节点安装与挖矿全流程指南(Ubuntu+MAC 版) **Published by:** [pangdong](https://paragraph.com/@pangdong/) **Published on:** 2025-05-13 **URL:** https://paragraph.com/@pangdong/nockchain-ubuntu-mac ## Content Introducing Nockchain本文旨在帮助您在 Ubuntu 系统上快速部署 Nockchain 节点,生成钱包并开始挖矿。适合对区块链技术感兴趣的开发者和爱好者。🧩 项目简介:什么是 Nockchain?Nockchain 是一个基于零知识证明(ZK)的轻量级区块链,采用 Rust 语言开发,旨在提供高效、可验证的计算平台。其核心特点包括:轻量级设计:无需复制整个链的数据,降低存储和计算成本。可扩展性:通过链下证明和链上验证的设计,支持大规模应用场景。安全性:采用 Rust 语言开发,确保系统的安全性和稳定性。易用性:提供详细的构建和运行指南,方便开发者快速上手。更多信息请访问 nockchain.org。 建议的挖矿规格为:至少 64GB 的 RAM、200GB 的可用磁盘空间和快速的 CPU🛠️ 安装与配置步骤1. 更新系统并安装依赖sudo apt update && sudo apt install -y \ screen curl iptables build-essential git wget lz4 jq make gcc nano \ automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev \ libleveldb-dev tar clang bsdmainutils ncdu unzip 2. 安装 Rust 环境curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" rustup default stable 3. 克隆 Nockchain 仓库git clone https://github.com/zorp-corp/nockchain cd nockchain 4. 复制示例环境文件并将其重命名为.env:cp .env_example .env 6. 编译项目make install-hoonc export PATH="$HOME/.cargo/bin:$PATH" make build make install-nockchain-wallet export PATH="$HOME/.cargo/bin:$PATH" make install-nockchain export PATH="$HOME/.cargo/bin:$PATH" ⚠️ 编译过程可能需要较长时间,请耐心等待。7. 配置环境变量source ~/.bashrc 🔐 生成钱包并提取公钥nockchain-wallet keygen 钱包生成后把全部内容备份最好 https://swps.io/wallet 安装你的钱包并导入私钥(现在钱包和windwos挖矿还没有推出)将公钥写入 .env: nano .env 查看公钥是否写入 .env:(输出的公钥应为你的公钥grep MINING_PUBKEY .env 🧠 启动节点启运这个挖矿screen -S nockchain bash ./scripts/run_nockchain_miner.sh 使用 Ctrl+A 然后按 D 可以退出 screen 会话而不关闭程序。🍎 Mac 上安装和运行 Nockchain 的指南1. 安装依赖项打开终端,执行以下命令:# 安装 Homebrew(如果尚未安装) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # 使用 Homebrew 安装 Git、Rust、screen brew install git brew install rustup brew install screen # 初始化 Rust 环境 rustup-init source $HOME/.cargo/env 2. 克隆官方仓库git clone https://github.com/zorp-corp/nockchain.git cd nockchain 3. 安装 Hoon 编译器(choo)make install-hoonc export PATH="$HOME/.cargo/bin:$PATH" 4. 构建项目make build 此命令将构建 Nockchain 节点、钱包和相关工具。5. 安装钱包make install-nockchain-wallet export PATH="$HOME/.cargo/bin:$PATH" 6. 安装主链核心模块make install-nockchain export PATH="$HOME/.cargo/bin:$PATH" 生成新密钥对(钱包地址)nockchain-wallet keygen 输出内容包含:Public KeyPublic Key: 公钥地址Private Key: 私钥,请务必妥善保存🔑 从助记词生成主私钥(可用于恢复钱包)nockchain-wallet gen-master-privkey --seedphrase "your seed phrase here" 然后导出公钥:nockchain-wallet gen-master-pubkey --master-privkey <private-key> 执行下面命令把.env里面的公钥替换成你的公钥cp .env_example .env nano .env 7. 运行挖矿screen -S nockchain bash ./scripts/run_nockchain_miner.sh查看 挖矿收益:nockchain-wallet --nockchain-socket ./test-leader/nockchain.sock update-balance 🔗 参考资料官方网站:nockchain.orgGitHub 仓库:github.com/zorp-corp/nockchain社区教程:CSDN 博客如需进一步的帮助或有任何疑问,欢迎加入 Nockchain 社区进行交流。祝您挖矿愉快! ## Publication Information - [pangdong](https://paragraph.com/@pangdong/): Publication homepage - [All Posts](https://paragraph.com/@pangdong/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@pangdong): Subscribe to updates - [Twitter](https://twitter.com/shexiaodong): Follow on Twitter