npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tfc-chain/core

v2.0.7

Published

[![npm version](https://badge.fury.io/js/%40tfc-chain%2Fcore.svg)](https://badge.fury.io/js/%40tfc-chain%2Fcore)

Downloads

6

Readme

@tfc-chain/core

npm version

TFC-Chain的以太坊智能合约实现。

Change Logs

配置文件

复制env.example.yml为env.yml,这是本项目的环境变量配置文件,配置TFC-Chain(以太坊)接入点和部署合约所使用的TFC-Chain(以太坊)账户私钥。关于TFC-Chain(以太坊)接入点和账户参考这里

env.yml:

endpoint: ETHEREUM_ENDPOINT
turboFilContract: DEPLOYED_CONTRACT_ADDRESS
accountPrivateKey: 
  - PRIVATE_KEY

合约部署

我们使用 hardhat 作为智能合约开发框架。部署合约的hardhat脚本可以在 tasks.tx 中找到,使用方法如下:

yarn workspace @tfc-chain/core hardhat --network development deploy --sector-reward 100000000000000000 --seed-reward 100000000000000000 --verify-reward 100000000000000000 --lock-period 90 --submit-proof-timeout 6 --verify-proof-timeout 12 --verify-threshold 3

以上脚本包含了智能合约的一些初始配置:

  • 0.1 TFC 作为sector验证通过的奖励
  • 0.1 TFC 作为seed被用作验证之后的奖励
  • 0.1 TFC 作为验证proof的奖励
  • sector奖励锁定90个周期(例如,第一次的奖励在第九十次奖励发出时解锁)
  • sector拥有者必须在sector被选中进行验证的事件发生后6个区块的时间内上传proof
  • sector验证者必须在proof上传之后12个区块内提交验证结果
  • 至少3个验证者认为验证通过/失败后,sector被认为仍然有效(发放奖励)或已经失效(扣除押金)
  1. 保存部署的合约地址:

部署完成后会在控制台打印TurboFil智能合约的地址。 将这个地址复制后更新到env.yml文件和deployment.json文件中。 @tfc-chain/core会作为一个独立的node.js包发布,提供调用合约的底层API,deployment.json文件中的合约地址会随着这个包一起发布。

测试

智能合约的单元测试使用hardhat+jest编写,源码在test文件夹中。

yarn workspace @tfc-chain/core test

合约设计