# IronFish二测教程: 通过源码跑测试网节点 **Published by:** [Kuzi](https://paragraph.com/@2066/) **Published on:** 2022-05-18 **URL:** https://paragraph.com/@2066/ironfish ## Content 1. 环境安装与源码编译安装环境和工具(Linux环境下):sudo apt install build-essential curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm install --global yarn curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env 下载源码并编译:cd $HOME git clone https://github.com/iron-fish/ironfish; cd ironfish yarn install yarn build 安装完之后ironfish在这个目录下$HOME/ironfish/ironfish-cli/bin/ironfish/ 2. 基本配置2.1 配置绑定涂鸦blockGraffiti (如果还没有涂鸦号需要提前在官网上通过邮箱注册涂鸦账号)cd ironfish/ironfish-cli/bin/ironfish/ironfish-cli/bin/ // Set blockGraffiti ./ironfish config:set blockGraffiti "xxxxxx" // check your infos ./ironfish config:show 2.2 配置自己的钱包地址cd ironfish/ironfish-cli/bin/ironfish/ironfish-cli/bin/ // create account, 'publicAddress'就是用来挖矿获取测试币的地址 ironfish accounts:create // export account and save ironfish accounts:export // check your infos,在节点没运行完同步之前是看不到余额的 ironfish accounts:balance 3. 运行节点和矿工3.1 以SOLO的形式启动节点和矿工// 开启遥测绑定涂鸦,(保持节点在线获取积分) $HOME/ironfish-cli/bin/ironfish/ironfish testnet // 启动节点并同步 $HOME/ironfish-cli/bin/ironfish/ironfish start -v // 启动矿工, ‘-t -1’ 表示使用本机所有线程 $HOME/ironfish/ironfish-cli/bin/ironfish miners:start -t -1 -v 这种情况需要每台机子都启动一个节点+一个矿工。3.2 以自建池子的形式启动节点的矿工Node机器:// 开启遥测绑定涂鸦,(保持节点在线获取积分) $HOME/ironfish-cli/bin/ironfish/ironfish testnet // 启动节点并同步 $HOME/ironfish-cli/bin/ironfish/ironfish start -v // 启动池子节点 $HOME/ironfish/ironfish-cli/bin/ironfish miners:pools:start --no-payouts Miner机器:// 启动矿工连接池子节点 // -p [池子节点ip] -a [矿工地址] $HOME/ironfish/ironfish-cli/bin/ironfish miners:start -p 192.168.1.100 -a 33f155db61c9af2b880bb51ce7316d7c2577d209481527d17f7691131cdd3c080539e93a0a1cdd1cbbfd16 -t -1 -v 这种情况在有多台机器且算力高的情况下,只需要启动1个节点+N个矿工。3.3 不运行节点只挖矿这里示例连接到官方矿池// 启动矿工连接池子节点 // -p [池子节点ip] -a [矿工地址] $HOME/ironfish/ironfish-cli/bin/ironfish miners:start -p pool.ironfish.network -a [your_address] -t -1 -v 这种情况适用于小算力难以爆块的矿工,连接官方池子或者第三方池子;但目前测试网获取积分的方式为在线节点+发送交易,所以仍需运行一个节点来干发送交易的活。4. 通过交易获取积分除了上一步运行节点保持在线可以获取积分,实则主要获取积分的方式还是要不断通过发送交易到官方账号。(1笔交易 = 1积分)// 发送一笔交易到官方存款账户 $HOME/ironfish/ironfish-cli/bin/ironfish deposit 自动发交易脚本(需要运行节点并同步完成): auto-tx.sh#!/bin/bash while true do echo 'Y' | $HOME/ironfish/ironfish/ironfish-cli/bin/ironfish deposit sleep 60 done exit 0 Done. thanks.Twitterhttps://twitter.com/kumata0x ## Publication Information - [Kuzi](https://paragraph.com/@2066/): Publication homepage - [All Posts](https://paragraph.com/@2066/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@2066): Subscribe to updates - [Twitter](https://twitter.com/kumata0x): Follow on Twitter