• lotus-local-net 8MiB v1.17.0 本地测试环境


    1. 清理环境

    rm -rf $LOTUS_PATH
    rm -rf $LOTUS_MINER_PATH
    rm -rf ~/.lotus/
    rm -rf ~/.lotusminer/
    rm -rf ~/.genesis-sectors/
    rm -rf ~/devgen.car
    rm -rf ~/localnet.json
    rm -rf /root/lotus-local-net/localnet.json
    rm -rf /root/lotus-local-net/devgen.car
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    2. 源码编译

    # cat .bashrc
    # lotus 2k
    #export LOTUS_PATH=/2k/lotus-local-net
    #export LOTUS_MINER_PATH=/2k/lotus-miner-local-net
    
    export LOTUS_SKIP_GENESIS_CHECK=_yes_
    export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
    export CGO_CFLAGS="-D__BLST_PORTABLE__"
    
    export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
    
    # lotus 8MB
    export LOTUS_PATH=/8MB/lotus-local-net
    export LOTUS_MINER_PATH=/8MB/lotus-miner-local-net
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    make clean 2k
    
    • 1
    # lotus --version
    lotus version 1.17.0+2k+git.2830429ad
    
    • 1
    • 2

    3. lotus daemon

    • 复制证明参数
    ./lotus fetch-params 8MiB
    
    • 1
    ./lotus-seed pre-seal --sector-size 8MiB --num-sectors 2
    ./lotus-seed genesis new localnet.json
    ./lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
    
    • 1
    • 2
    • 3
    • 运行 lotus daemon
    ./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false
    
    • 1

    4. 初始化miner

    • 导入钱包
    ./lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
    
    • 1
    # lotus wallet list
    Address                                                                                 Balance                          Nonce  Default
    t3u7rtyt7ghkmfddprywxpqszp6zazs2tw4xkoady32h4pkorx62b6pmkevyd6gxfjrwmon3tvwsprqq6u6fva  49999999.986720741215281422 FIL  0      X
    
    • 1
    • 2
    • 3
    • 初始化 miner
    ./lotus-miner init --genesis-miner --actor=t01000 --sector-size=8MiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
    
    • 1
    ./lotus-miner run --nosync
    
    • 1

    5. 后台运行

    nohup lotus daemon --genesis=/root/lotus-local-net/devgen.car --profile=bootstrapper >> /var/log/8MB/daemon.log 2>&1 &
    
    • 1
    nohup lotus-miner run --nosync >> /var/log/8MB/miner.log 2>&1 &
    
    • 1
    # lotus-miner info
    Enabled subsystems (from miner API): [Mining Sealing SectorStorage Markets]
    Enabled subsystems (from markets API): [Mining Sealing SectorStorage Markets]
    Chain: [sync ok] [basefee 100 aFIL]
    Miner: t01000 (8 MiB sectors)
    Power: 160 Mi / 160 Mi (100.0000%)
    	Raw: 16 MiB / 16 MiB (100.0000%)
    	Committed: 16 MiB
    	Proving: 16 MiB
    Projected average block win rate: 20024.16/week (every 30s)
    Projected block win with 99.9% probability every 41s
    (projections DO NOT account for future network and miner growth)
    
    Miner Balance:    29461.406 FIL
          PreCommit:  0
          Pledge:     2 aFIL
          Vesting:    22096.044 FIL
          Available:  7365.361 FIL
    Market Balance:   0
           Locked:    0
           Available: 0
    Worker Balance:   49999999.986 FIL
    Total Spendable:  50007365.348 FIL
    
    Sectors:
    	Total: 2
    	Proving: 2
    
    Workers: Seal(1) WdPoSt(0) WinPoSt(0)
    
    Storage Deals: 0, 0 B
    
    Retrieval Deals (complete): 0, 0 B
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33

    6. 创建其它节点

    • 清理环境
    rm -rf $LOTUS_PATH
    rm -rf $LOTUS_MINER_PATH
    rm -rf ~/.lotus/
    rm -rf ~/.lotusminer/
    rm -rf ~/.genesis-sectors/
    rm -rf ~/devgen.car
    rm -rf ~/localnet.json
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    # cat .bashrc
    
    ulimit -n 1024000
    
    # lotus 2k
    #export LOTUS_PATH=/2k/lotus-local-net
    #export LOTUS_MINER_PATH=/2k/lotus-miner-local-net
    
    export LOTUS_SKIP_GENESIS_CHECK=_yes_
    export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
    export CGO_CFLAGS="-D__BLST_PORTABLE__"
    
    export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
    
    # lotus 8MB
    export LOTUS_PATH=/8MB/lotus-local-net
    export LOTUS_MINER_PATH=/8MB/lotus-miner-local-net
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 从创世节点拷贝同步数据
    scp /root/lotus-local-net/devgen.car root@192.168.2.2:/root
    
    • 1
    • 下载复制证明参数
    lotus fetch-params 8MiB
    
    • 1

    6.1 运行 lotus daemon

    nohup lotus daemon --genesis=devgen.car --bootstrap=false >> /var/log/8MB/daemon.log 2>&1 &
    
    • 1
    • 连接创世节点,同步链高度
    # lotus net listen
    /ip4/192.168.2.1/tcp/44241/p2p/12D3KooWA8CZGMccaCywiaUnXEwymGHYhsRaW4Sn48VzsVDZE9Q6
    
    • 1
    • 2
    # lotus net connect /ip4/192.168.2.1/tcp/44241/p2p/12D3KooWA8CZGMccaCywiaUnXEwymGHYhsRaW4Sn48VzsVDZE9Q6
    connect 12D3KooWA8CZGMccaCywiaUnXEwymGHYhsRaW4Sn48VzsVDZE9Q6: success
    
    • 1
    • 2
    • 新建钱包地址
    # lotus wallet new bls
    t3spuqjipy77mtoxdhfwfmhiakl4qtq7qte4nf7hyjtebyma3jramyei4zbrvjekiylwpjtqb2zc7izsfrobya
    # lotus wallet new bls
    t3sr23yk3llalpn7wguaocvc4w6ky7fzjra54phgscytmj24hwynqdw6q7db73z4mowzpvelrawdzlwzodrovq
    
    • 1
    • 2
    • 3
    • 4
    • 从创世节点发送测试币
    # lotus send t3spuqjipy77mtoxdhfwfmhiakl4qtq7qte4nf7hyjtebyma3jramyei4zbrvjekiylwpjtqb2zc7izsfrobya 5041277
    
    • 1

    6.2 初始化 miner

    # lotus-miner init --owner=t3spuqjipy77mtoxdhfwfmhiakl4qtq7qte4nf7hyjtebyma3jramyei4zbrvjekiylwpjtqb2zc7izsfrobya --worker=t3sr23yk3llalpn7wguaocvc4w6ky7fzjra54phgscytmj24hwynqdw6q7db73z4mowzpvelrawdzlwzodrovq --sector-size=8MiB --no-local-storage
    
    • 1

    6.3 运行 miner

    nohup lotus-miner run >> /var/log/8MB/miner.log 2>&1 &
    
    • 1
    # lotus-miner info
    Enabled subsystems (from miner API): [Mining Sealing SectorStorage Markets]
    Enabled subsystems (from markets API): [Mining Sealing SectorStorage Markets]
    Chain: [sync ok] [basefee 100 aFIL]
    Miner: t01003 (8 MiB sectors)
    Power: 0  / 160 Mi (0.0000%)
    	Raw: 0 B / 16 MiB (0.0000%)
    	Committed: 0 B
    	Proving: 0 B
    Below minimum power threshold, no blocks will be won
    Miner Balance:    0
          PreCommit:  0
          Pledge:     0
          Vesting:    0
          Available:  0
    Market Balance:   0
           Locked:    0
           Available: 0
    Worker Balance:   504127 FIL
    Total Spendable:  504127 FIL
    
    Sectors:
    	Total: 0
    
    Workers: Seal(1) WdPoSt(0) WinPoSt(0)
    
    Storage Deals: 0, 0 B
    
    Retrieval Deals (complete): 0, 0 B
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    6.4 添加长期存储路径

    lotus-miner storage attach --init --store /storage
    
    • 1
    # lotus-miner storage list
    4ec36c85-0ab0-496e-80c9-a161f0b7b3d3:
    	[##                                                ] 5.016 GiB/97.87 GiB 5%
    	Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
    	Weight: 10; Use: Store
    	Local: /storage
    	URL: http://127.0.0.1:2345/remote
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 修改配置文件
    # cat config.toml| grep -Ev "^$|#"
    [API]
      ListenAddress = "/ip4/192.168.2.2/tcp/2345/http"
      RemoteListenAddress = "192.168.2.2:2345"
    [Backup]
    [Logging]
      [Logging.SubsystemLevels]
    [Libp2p]
    [Pubsub]
    [Subsystems]
    [Dealmaking]
      [Dealmaking.RetrievalPricing]
        [Dealmaking.RetrievalPricing.Default]
        [Dealmaking.RetrievalPricing.External]
    [IndexProvider]
    [Proving]
    [Sealing]
      BatchPreCommits = false
      AggregateCommits = false
    [Storage]
      AllowAddPiece = false
      AllowPreCommit1 = false
      AllowPreCommit2 = false
      AllowCommit = false
      AllowUnseal = false
      AllowReplicaUpdate = false
      AllowProveReplicaUpdate2 = false
      AllowRegenSectorKey = false
    [Fees]
      [Fees.MaxPreCommitBatchGasFee]
      [Fees.MaxCommitBatchGasFee]
    [Addresses]
    [DAGStore]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    # lotus-miner auth api-info --perm admin
    MINER_API_INFO=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.GwfWw2nGuUGtTMHtBW__Wi4cDxK9B4TAny4BuNcWsIw:/ip4/192.168.2.2/tcp/2345/http
    
    • 1
    • 2

    7. 运行 worker

    ulimit -n 1024000
    
    # lotus 2k
    #export LOTUS_PATH=/2k/lotus-local-net
    #export LOTUS_MINER_PATH=/2k/lotus-miner-local-net
    
    export LOTUS_SKIP_GENESIS_CHECK=_yes_
    export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
    export CGO_CFLAGS="-D__BLST_PORTABLE__"
    
    export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
    
    # lotus 8MB
    export LOTUS_PATH=/8MB/lotus-local-net
    export LOTUS_MINER_PATH=/8MB/lotus-miner-local-net
    export LOTUS_WORKER_PATH=/8MB/lotus-worker-net
    export LOTUS_WORKER_NAME="ubuntu-04-workers-01"
    
    # miner api
    export MINER_API_INFO=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.GwfWw2nGuUGtTMHtBW__Wi4cDxK9B4TAny4BuNcWsIw:/ip4/192.168.2.2/tcp/2345/http
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 运行 worker
    nohup lotus-worker run >> /var/log/8MB/worker.log 2>&1 &
    
    • 1
  • 相关阅读:
    DC-7靶场下载及渗透实战详细过程(DC靶场系列)
    PyTorch笔记 - Vision Transformer
    Tomcat 7.0 win7 64位免安装解压版 安装及配置
    【HMS Core】安全检测服务相关问题解答
    3.4向量范数与矩阵范数&3.5线性方程组的迭代解法
    算法|图论 4
    wpf Grid布局详解 `Auto` 和 `*` 是两种常见的设置方式 行或列占多个单元格,有点像excel里的合并单元格。使其余的列平均分配剩余的空间
    入门JavaWeb之 Response 下载文件
    Lvs+Nginx+NDS
    HTML基础
  • 原文地址:https://blog.csdn.net/u010953692/article/details/126346439