Email:filapp@protonmail.com

Twitter:

https://twitter.com/RalapXStartUp

Telegram:

https://t.me/bigdog403

全球Filecoin中文爱好者网站

  • X

    我们十分高兴地推出“go-filecoin 0.2.1”版本。该版本着重于后台升级,其特点包括支持文件系统回购协议迁移以及解决存储争议、更好的消息池、证明改进、以及对libp2p版本的改进,以支持更可靠的中继。该版本还包括一些面向用户的改进,比如新指令、新选项、更好的状态消息,并且修复许多软件缺陷。太棒了!

    链同步状态

    初次创建filecoin节点时,必须下载并验证链。我们称之为“链式同步”。虽然可以立即运行初始命令,如轻击水龙头或仪表板流量,但是任何其他命令,如挖掘命令都会返回错误,直到完成链同步。目前,安装过程可能需要几个小时。 为了明确这一点,我们更新了维基百科的条目,提供更好的状态消息,使控制台的输出更加精练,以便进行链式同步。在未来的版本中,我们还将解决链同步慢的潜在问题。

    扇区存储配置

    您希望filecoin节点在何处存储客户的数据?现在就可以选择了!有两种方法可选择扇区存储目录的位置——“sectorbase. rootdir”配置项,或“sectordir option to go-filecoin ini”选项。 如果没有指定位置,数据将存储在”$$HOME#.filecoin_sectors”默认目录下。

    可升级的回购协议

    除了加密的客户机数据,Filecoin节点可在磁盘上存储其他数据,如配置数据、区块链块、交易状态和加密密钥。随着研发的进展,我们需要一种方法,以安全地更改数据类型和模式。在该版本中,我们针对文件系统回购迁移进行了可接受的设计,并且针对迁移工具做了初始布局。这为在生产环境中运行时无缝更新filecoin节点铺平了道路。 请查看帮助文本,了解更多信息: 网址:tools#migration#go-filecoin-migrate –help

    仓储费

    该版本可解决与存储协议有关争议。现在,支付通道可提出条件,在凭证被赎回之前问询另一参与者。付款人也可以撤销支付渠道。如果通道的一方拒绝付款,将触发通道提前关闭。以上特性可与块包含证明(这一功能即将推出)一起使用,以便在存储客户向存储矿工付费时强制执行存储证明。

    您可在探险活动中,使用三项新的指令——“检查”、“协议”和“位交换”: “go-filecoin inspect all”功能可打印软件缺陷报告所需的所有必要信息(该报告可在GitHub公开发布),包括操作系统细节、当前go-filecoin配置和其他一些常用的统计信息。

    “go-filecoin protocol”功能可打印关于节点协议参数的详细信息,比如自动输入间隔和扇区大小。这有助于调试Filecoin证明和协议系统内部的某些软件缺陷。

    “go-filecoin bitswap”功能可打印节点的libp2p位交换系统的详细信息,例如块、数据、接收以及发送的消息。这些数据通常用于网络调试。 请运行紧随“help flag”之后的指令,以了解更多细节: 网址:For more details, run any command followed by the --help flag.

    libp2p最近对中继功能进行了一系列改进,解决了在一些生产中继节点中资源大量耗费的问题。我们已经升级到go-libp2p 0.0.16,以便对filecoin进行相同的改进。

    我们采取了多项步骤加固信息池。现在,信息池可拒绝那些显然会由于签名无效、资金不足、燃料告罄或不存在参与者等原因而无法处理的信息。信息池还可跟踪“nonces”值,以确保信息顺序的正确性,并确保信息池中的帐户没有滞留过多信息。最后,信息池可限制其接受的信息总量。

    该版本在幕后为开发更灵活、更强大的存储证明做了许多基础性工作。在该版本中,向扇区写入大块时可更有效地利用内存。该版本还可对块包含证明、多扇区大小和可变证明长度提供初始支持。

    围绕“rust-fil-proofs”协议的开发工作正在更全面、更高效地进行中,包括切换到“mmap”以获得更高效的“merkle”树、“hasher”抽象、在生成“groth”证明时限制并行性、以及跨分区计算、合计挑战等。

    自上个版本发布以来,我们已经显著改进了Filecoin的快速测试系统。现在,在测试失败时,FAST可自动提供相关的日志数据以及来自测试节点的信息。FAST还提供了一个全新的局域网(localnet)工具,可以快速、轻松地设置本地Filecoin节点集群,并进行测试和实验。 请参阅“localnet readme”,以了解更多细节。

    凭借Go 1.11对版本化模块的初步支持,我们切换到Go模块,以进行依赖管理。当处理来自上游的依赖更新时,可更容易地进行依赖性管理,并更迅速更新。

    在开始为重要特性或组件编写代码之前,我们定期撰写设计文档。这些简短的文档在获取知识、形式化思维和共享设计意图方面起着非常重要的作用。接下来,您可在“designdocs repo”中找到新的设计文档。

    阅读更多
  • X

    Author: @laser

    Proofs Walkthrough

    For infra (Part One):

    What artifacts are built and how are they distributed and consumed?
    What artifacts are accessed at runtime?
    What does "use small sectors" actually do?
    What is the status of PoRep and PoSt?

    For everybody else (Part Two):

    What is a sector base
    What responsibilities & code are in Rust
    Major APIs and how they are used
    Identifiers in use
    Metadata that needs to be kept
    What dials we have on performance of proofs
    What if any big changes are coming down the pipe

    Part One: Stuff Infra Cares About Build and Distribution libfilecoin_proofs

    When the master branch of rust-proofs-fil builds successfully in CircleCI, a gzipped-tarball gets pushed to GitHub releases (https://github.com/filecoin-project/rust-fil-proofs/releases). We build once in CircleCI using an OSX container and once using a Linux container. A release is identified (tagged) by the first 16 characters of the build's Git SHA.

    This tarball contains:

    libfilecoin_proofs.a (a "static library")
    libfilecoin_proofs.h (corresponding C-header file)
    libfilecoin_proofs.pc (a pkg-config manifest, used to specify linker dependencies)
    paramcache (populates Groth parameter-cache - typically /tmp/filecoin-proof-parameters)
    paramfetch (fetches Groth parameters from IPFS gateway into cache)
    parameters.json (contains the most recently-published Groth parameters)

    Groth Parameters

    On occasion, a rust-fil-proof developer will want to publish new Groth parameters. They might do this because we changed some aspect of VDF PoSt or ZigZag PoRep setup or public parameters which obsoletes the previously-published parameters.

    To do this, the developer first runs paramcache, which populates the Groth parameter-directory on their computer with parameters which reflect the state of the rust-fil-proofs proofs code. Then, the developer runs parampublish. The parampublish program facilitates the process of adding the parameters to a local IPFS node and adds the new parameters to the parameters.json file in the root of rust-fil-proofs which is tracked by Git.

    Finally, the developer messages the pinbot with the cid of the Groth parameters which have been pinned at the IPFS gateway.

    Consuming Distributed Artifacts libfilecoin_proofs

    go-filecoin depends on rust-fil-proofs as a submodule. At any time, the specific Git SHA of rust-fil-proofs which is consumed by go-filecoin can be determined by running the following command from the root of go-filecoin:

    git ls-tree master proofs/rust-proofs

    When the deps command is run (either in the CircleCI or on a developer computer), the install-rust-proofs.sh script is run.

    If both of the FILECOIN_USE_PRECOMPILED_RUST_PROOFS and GITHUB_TOKEN environment variables are set, the script attempts to download an OS-appropriate release tarball from rust-fil-proofs (GitHub) releases. The tarball, as previously mentioned, is identified by the first 16 characters of the Git SHA from which it was created. go-filecoin uses the SHA of its rust-fil-proofs submodule to construct a release URL and requests assets via cURL. Once downloaded, the precompiled assets are unpacked to locations hard-coded into the various go-filecoin Go files which consume them (e.g. rustverifier.go, rustsectorbuilder.go).

    If the aforementioned environment variables are not set or no matching release can be found, rust-fil-proofs is built from source from within the submodule directory. Once built, assets are unpacked to locations hard-coded into the various go-filecoin Go files which consume them (e.g. rustverifier.go, rustsectorbuilder.go).

    Groth Parameters

    Groth parameters can be fetched from IPFS using the paramfetch program or can be built using the paramcache program. These programs are part of rust-fil-proofs, and are available to go-filecoin developers who have downloaded a prebuilt rust-fil-proofs build. These programs can alternatively be built from source using the install-rust-proofs.sh script which is run by the deps subcommand.

    The paramfetch program is provided with a path to the parameters.json which is part of the rust-fil-proofs submodule. Groth parameters in this JSON file are downloaded (via cURL) from the IPFS gateway and placed into the Groth parameter directory (typically /tmp/filecoin-proofs-parameters).

    What Artifacts are Accessed At Runtime?

    A short list:

    Groth parameters are accessed by rust-fil-proofs PoSt and PoRep generation and verification routines at runtime.
    params.out (loaded once, at startup - @laser to research why this exists)
    parameters.json is accessed by paramfetch at runtime.

    What is the status of PoRep and PoSt? PoRep

    ZigZag PoRep is used in the nightly and user clusters today. @dignifiedquire is working on an alternative to ZigZag ("boring") PoRep which involves something called accumulators. He and @porcuquine are meeting on Friday to make a go/no-go decision on accumulators. Lots of math involved.

    PoSt

    VDF PoSt is neither complete (from a math-and-science standpoint) nor integrated into go-filecoin. According to @porcuquine, "There are parts of the circuit which haven't been implemented." In short, there are "theory problems" which prevent PoSt from being completed.

    I, Sir @laser, am working to integrate our current, incomplete PoSt implementation with go-filecoin today. There are some challenges which have emerged over the last few weeks which prevent this from being a straightforward process:

    We didn't until recently have a way to sample the blockchain for the randomness required by the challenge seed-generation process.
    Our mechanism for sampling the chain only works from within the state machine.
    A VDF PoSt can be created over a fixed number of sectors (currently 2), which means that I need to modify go-filecoin to call the PoSt generator in a loop (in the case of a miner needing to prove more than 2 sectors in a proving period).

    What Does "Use Small Sectors" Actually Do?

    Every call through CGO from go-filecoin to rust-fil-proofs includes a configuration value. This value is either Live or Test.

    When the FIL_USE_SMALL_SECTORS environment variable is set to true, go-filecoin will pass the Test value on all CGO calls to rust-fil-proofs. Otherwise, Live will be passed.

    When rust-fil-proofs operations run with the Live configuration, sectors are configured to hold 266338304 bytes (254MiB). When Test is provided, sectors are configured to hold 1016 bytes of user data.

    Sealing time is the sum of replication time (scales linearly with sector size) and proof-generation time (grows logarithmically with sector size). So: Environments (and tests) which want to seal in the smallest amount of time possible should use the Test configuration, AKA "small" sectors.

    Each configuration (sector size) uses its own circuit, and each circuit its own Groth parameters. Today, we publish both parameters (in parameters.json) to IPFS.

    Part Two: WTF is a Sector Base? What is a Sector Base?

    Today, the "Sector Base" is a grab-bag of functions and classes (traits) scattered across 3 Rust crates in the rust-proofs repository. These crates make up 19% of the of the 32446 lines of Rust in the rust-fil-proofs repository.

    Bundled up in libfilecoin_proofs, these crates are used by go-filecoin to:

    Write (and "preprocess") user piece-bytes to disk
    Schedules seal (proof-of-replication) jobs
    Schedules proof-of-spacetime generation jobs
    Schedules unseal (retrieval) jobs
    Provides an interface to proof-of-spacetime and proof-of-replication-verification tools (called from within the FIL state machine)
    Map between replica commitment and sealed sector-bytes
    Map between piece key (base-58 or base-58BTC-encoded CID of user piece) and sealed sector-bytes

    How does go-filecoin interact with the rust-fil-proofs Sector Base?

    The go-filecoin codebase contains two Go interfaces which are used to interact with the Sector Base:

    type Verifier interface { VerifyPoST(VerifyPoSTRequest) (VerifyPoSTResponse, error) VerifySeal(VerifySealRequest) (VerifySealResponse, error) } type SectorBuilder interface { AddPiece(ctx context.Context, pi *PieceInfo) (sectorID uint64, err error) ReadPieceFromSealedSector(pieceCid cid.Cid) (io.Reader, error) SealAllStagedSectors(ctx context.Context) error SectorSealResults() <-chan SectorSealResult GetMaxUserBytesPerStagedSector() (uint64, error) GeneratePoST(GeneratePoSTRequest) (GeneratePoSTResponse, error) Close() error }

    The Verifier interface is satisfied by the RustVerifier struct, and the SectorBuilder interface is satisfied with the RustSectorBuilder struct.

    Both the RustVerifier and RustSectorBuilder struct use CGO to call Rust code directly (in-process) in the Sector Base. CGO functions like C.CBytes are used to move bytes across CGO from Go to Rust; Go allocates in the Rust heap through CGO and then provides Rust with pointers from which it can reconstitute arrays, structs, and so forth.

    Lifecycle

    go-filecoin controls the lifecycle of the rust-fil-proofs SectorBuilder. When the node starts, a CGO call is made to Rust in order to construct a rust-fil-proofs SectorBuilder. Rust returns through its FFI system a pointer to the rust-fil-proofs SectorBuilder which go-filecoin holds on to. When go-filecoin is done with its RustSectorBuilder, it calls its destructor method which returns the pointer to Rust, allowing it to be freed.

    Calls through CGO

    Each method on RustSectorBuilder struct has a rust-fil-proofs SectorBuilder equivalent. When a method on the RustSectorBuilder is called, Go makes a CGO call to the Rust equivalent, passing along a pointer to the Rust-allocated, rust-fil-proofs SectorBuilder.

    For example, the go-filecoin SectorBuilder interface contains a method:

    AddPiece(ctx context.Context, pi *PieceInfo) (sectorID uint64, err error)

    which RustSectorBuilder turns into a CGO call to the following function in rust-fil-proofs:

    pub unsafe extern "C" fn add_piece( ptr: *mut SectorBuilder, piece_key: *const libc::c_char, piece_ptr: *const u8, piece_len: libc::size_t, ) -> *mut responses::AddPieceResponse Identifiers

    Sealed sector path
    Yet-to-be-sealed ("unsealed") path
    Piece key (base-58 encoded CID of user piece-bytes)

    Metadata

    The rust-fil-proofs SectorBuilder stores some mappings in its metadata:

    base-58(BTC) encoded piece CID to sealed sector
    sealed and yet-to-be-sealed sector to file path
    replica commitment to file path

    Dials on Performance

    For now, go-filecoin has none.

    Problems

    go-filecoin and rust-fil-proofs must live in same process
    go-filecoin does long polling to learn when sector has been sealed
    Can't scale rust-fil-proofs SectorBuilder to multiple machines
    No easy way for a miner to add more storage to an already in-use rust-fil-proofs SectorBuilder
    All rust-fil-proofs SectorBuilder metadata always buffered into memory
    A zillion other things

    Plans for the Future

    Our short-term plans include:

    Integrate our half-baked PoSt into go-filecoin
    Design PoRep and PoSt configuration
    Allow go-filecoin to make tradeoffs between time/space
    Support multiple sector sizes
    Brian V. involved in convos with @porcuquine
    @porcuquine has design in head but needs spec proposal
    NOTE: more sector sizes means more Groth parameters to be generated

    阅读更多
  • X
    本指南概述了挖矿原理,以及如何在Filecoin网络挖矿。 什么是采矿?

    在大多数区块链协议中,“矿工”是网络上的参与者,他们做必要的工作来保持区块链的有效性和安全性。为了提供这些服务,矿工得到本机加密货币的补偿。“矿工”一词的出现,是为了将确保区块链的工作与为扩大黄金供应而消耗资源的黄金矿商的工作进行比较。

    Filecoin网络将有多种类型的矿工:
    • 存储矿工
    • 检索矿工
    • 修复矿工
    在当前,我们主要关注存储矿工。存储矿工出售存储容量以换取filecoin。

    开始挖矿

    首先在Filecoin节点上运行Go-filecoin进程,默认情况下,Filecoin节点不会自动建立挖矿,您可以先创建一个矿工。

    1.建立一个矿工,承诺10个扇区(目前每个256 MIB)的储存和100 FIL作为抵押品,信息gas价格为0 FIL/单位,并限制为1000个gas上限。成功后,它返回新创建的矿工地址。
    注意:此步骤可能需要大约一分钟的时间处理,但如果时间过长,请再次检查。gas价格和gas上限。

    go-filecoin miner create 10 100 --price=0 --limit=1000 --peerid `go-filecoin id | jq -r '.ID'` # this may take a minute

    一旦创建了矿工,我们就可以运行以下操作来开始挖掘:

    go-filecoin mining start

    恭喜,你们现在正在挖掘FIL代币!现在,您正在挖掘包含网络上的块。

    探索已经挖出来的块
    您可以使用Filecoin块资源管理器,或者通过命令行来探索。例如,让我们获得blockID区块链的第一个区块,我们称他为创世块。

    1.显示创世块并复制块ID(可能有多个):

    go-filecoin chain head # returns JSON including the <blockID> of the chain head

    2.然后观察他的目录

    go-filecoin show block <blockID>

    许多命令还支持--enc=json机器可读输出选项。

    如何创建存储申请
    在Filecoin存储市场上,客户提出一个文件存储的需求,矿工们接受了需求订单,并向他们提供了一些关于其可用存储空间的详细信息。发起存储申请需要以下几点:

    您的矿工地址(在本教程前面创建)启动挖矿时创建) 矿工所有者地址(启动守护进程时自动创建) 你愿意出售这么多存储的价格(以FIL/字节/块为单位) 此要价有效的块数。 每一个天然气gas消耗单位所支付的价格,以挖掘这条信息(以FIL计价) 此消息要消耗的最大gas单位数。
    举例说明:
    1.获取矿工地址,并将其导出到一个变量中: export MINER_ADDR=`go-filecoin config mining.minerAddress | tr -d \"`

    2.获取矿工所有者地址,并将其导出到一个变量中:

    export MINER_OWNER_ADDR=`go-filecoin miner owner $MINER_ADDR`

    添加一个需求订单,其价格为0.000000001 FIL/字节/块,有效期为2880个区块,消息gas价格为0 FIL/单位,限制为1000个gas单位:

    go-filecoin miner set-price --from=$MINER_OWNER_ADDR --miner=$MINER_ADDR --price=0 --limit=1000 0.000000001 2880 # output: CID of the ask

    4.一旦您下了订单,等待您的请求的块被处理(大约30秒),然后检查client list-asks确认您的请求已被添加(请查找您的$miner_addr):

    go-filecoin client list-asks --enc=json | jq

    接受交易并得到报酬
    客户向储量充足、价格低于其支付意愿的矿商提出储存协议。
    关于截至2018年12月目前执行情况的几个说明:
    • 目前,矿商以足够的资金接受客户向他们提出的所有交易。付款确认是自动完成的,所以你不需要采取任何行动来接受交易。
    • 交易付款和支付渠道被已经完成。因此,在整个交易期内,矿商都会定期通过付款渠道贷记资金。
    停止开采
    如果在任何时候想停止开采,都可以停止:

    go-filecoin mining stop

    还可以删除与Filecoin节点实例关联的所有数据:

    rm -rf ~/.filecoin

    阅读更多
  • X

    0_1550470167080_51f82963-8806-4c58-8d79-0181b3f013c8-image.png

    运行Filecoin节点指南

    1.如果您以前运行过Go-filecoin,请删除现有的Filecoin初始化数据:

    rm -rf ~/.filecoin

    初始化Go-filecoin。devnet-user会把你连接到我们的主网。

    go-filecoin init --devnet-user --genesisfile=http://user.kittyhawk.wtf:8020/genesis.car

    3.启动你的go- filecoin守护进程

    go-filecoin daemon

    系统将会返回我的peer ID(<peerID>),peer ID是一个以QM开头的很长的字符串
    注意:如果您是一个开发人员,并且希望连接到构建网络而不是用户网络时,必须将节点配置为使用小领域扇区,并从devnet-nightly标签下构建。

    env FIL_USE_SMALL_SECTORS=true go-filecoin daemon

    4.检查是否连接

    go-filecoin swarm peers # lists addresses of peers to which you're connected

    这个段落的最后一部分peer地址就是你的peer ID,用这个测试你的peer是否连接

    go-filecoin ping <peerID> # Pings the peer and displays round-trip latency.

    恭喜!您现在正在运行Filecoin节点并连接到网络。这是一个基本节点的解剖结构(再加上一个矿工,您将在下一步创建该节点)

    注意:这个进程将会在终端中无限期地运行(Ctrl + C退出)。运行其他go-filecoin命令,则需要打开第二个终端选项卡或窗口(Cmd + T在Mac上)。
    您的节点可能需要几分钟来同步和验证现有的块,在此期间,您的CPU将会高负荷运行。
    Filecoin节点的命名
    默认情况下,节点由长的字母数字节点ID引用。你可以给你的节点换一个昵称。

    昵称只能包含字母字符(没有数字、空格或其他特殊字符)。
    1.打开一个新的终端窗口并设置节点昵称(直接替换Pizzanode即可):

    go-filecoin config heartbeat.nickname "Pizzanode"

    2.新名称立即生效,无需重新启动。您可以使用以下方法检查配置的名称:

    go-filecoin config heartbeat.nickname

    开始节点工作流
    我们有一些可视化工具来了解Filecoin网络的运行状况:网络统计和块资源管理器。

    要查看网络统计数据上的节点,您需要选择使用流节点的日志。打开一个新的终端窗口并运行:

    go-filecoin config heartbeat.beatTarget "/dns4/stats-infra.kittyhawk.wtf/tcp/8080/ipfs/QmUWmZnpZb6xFryNDeNU7KcJ1Af5oHy7fB9npU67sseEjR"

    现在你可以去网络统计并观察您的节点与其他节点达的状态,不需要重新启动节点。

    从Filecoin网络中获取代币Fil

    在Filecoin节点正式运行之前,它们需要一些启动代币(FIL)。矿工们在最初向网络保证存储时使用FIL作为抵押币。客户需要在自己的账户中与矿工达成储存协议。

    在早期测试中,您可以从Filecoin网络获得模拟代币FIL。使用模拟FIL可以对市场动态进行初步测试,而不需要任何资金来实际交换。
    所有的FIL余额都储存在钱包里。当一个节点是新创建的,它将有一个Filecoin钱包,余额为0 FIL。

    1.如果想获得Fil,找到你的钱包地址:

    go-filecoin wallet addrs ls

    2.输出应该是一个长字母数字字符串。转到用户Devnet http://user.kittyhawk.wtf:9797并提交钱包地址。大约需要等待一分钟。
    或者你可以输入代码执行命令:

    export WALLET_ADDR=`go-filecoin wallet addrs ls` # fetch your wallet address into a handy variable MESSAGE_CID=`curl -X POST -F "target=${WALLET_ADDR}" "http://user.kittyhawk.wtf:9797/tap" | cut -d" " -f4`

    网络很快将为您提供一个消息CID。但是如果您想要核实,可以运行以下命令等待其处理,并在完成后返回一个确认:

    go-filecoin message wait ${MESSAGE_CID}

    4.若要验证代币是否已转入在您的钱包中,请检查您的钱包余额:

    go-filecoin wallet balance ${WALLET_ADDR}

    恭喜,您现在已经连接到Filecoin,并且可以开始在Filecoin网络上挖掘或存储数据!

    阅读更多

Looks like your connection to Filecoin.cn中国爱好者社区 was lost, please wait while we try to reconnect.