当前位置: 代码迷 >> 综合 >> filecoin-lotus链同步、链本地持久化存储源码分析
  详细解决方案

filecoin-lotus链同步、链本地持久化存储源码分析

热度:19   发布时间:2024-02-24 22:27:44.0

文章目录

    • 一、链存储
      • 1. lotus启动时, 从本地持久化存储的链头开始同步
    • 二、链相关常用命令
      • 1. 设置从某个高度开始同步
      • 2. 链导出
    • 三、参考

一、链存储

源码位置:
官方文档 documentation/en/architecture/architecture.md
chain/store/store.go

Store的设计基本是给ChainSync使用的

链存储 相关类型 ChainStore,

ChainStore的成员变量 ds dstore.Datastore它key-value形式,比如key 是 “head”表示链头,value就是 cids字符串数组的json.marshal操作。我们通过其的Get Put方法读写链头信息。

// ChainStore is the main point of access to chain data.
//
// Raw chain data is stored in the Blockstore, with relevant markers (gen
  相关解决方案