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

@filecoin-station/spark-recent-participants

v1.0.0

Published

Smart contract exposing recent participant ids in the Spark network.

Downloads

70

Readme

spark-evaluations: Recent Participants

Smart contract exposing recent participant ids in the Spark network.

Contract deployed at 0xcb3e3291a298a44224bc3bafd04957e9feed5767.

API

constructor (address owner)

.get() public view (uint[])

Get all recent participants.

.set(uint date, uint[] participants) public

Owner only. Set participants for given date (0-30).

Development

This repo requires Rust and Cargo, which can be installed from here

Install Foundry

We recommend you install it from source:

git clone https://github.com/foundry-rs/foundry
cd foundry
git checkout 9a4bb7f5
# install cast + forge
cargo install --path ./cli --profile local --bins --locked --force
# install anvil
cargo install --path ./anvil --profile local --locked --force
Clone Repo and Install
git clone https://github.com/filecoin-station/spark-impact-evaluator.git
cd spark-impact-evaluator
git submodule update --init --recursive
forge test

Node.js API

import * as SparkRecentParticipants from '@filecoin-station/spark-recent-participants'

console.log({
  abi: SparkRecentParticipants.ABI,
  address: SparkRecentParticipants.ADDRESS
})

Deployment

The deployment relies on contract bindings generated in the /contract-bindings directory. If you make changes to the contracts, run:

rm -rf contract-bindings
forge bind  --crate-name contract-bindings -b ./contract-bindings

This will create new bindings with the modified contracts.

Deployment can then proceed either with a locally stored mnemonic or a connected ethereum ledger wallet. To use with a mnemonic, create a secrets/mnemonic file in the root directory.

To deploy, run:

(cd contract-utils && cargo run)

Tests

Integration Tests

Integration tests run on the filecoin calibration net and require a wallet with test FIL to pay for gas fees on the calibration net. Test FIL is free and can be obtained using the faucet.

Before running integration tests, these env vars are required:

export TEST_RPC_URL=https://api.calibration.node.glif.io/rpc/v1
export TEST_MNEMONIC={insert wallet mnemonic here}
export TEST_CONTRACT_ADDRESS={this can be an empty string}

To run tests, run:

cd contract-utils
cargo test  -- --nocapture --test-threads 1