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

ethfs-cli

v1.1.3

Published

A tool to upload files easily to a filesystem smart contract following ERC-5018.

Downloads

44

Readme

ethfs-cli

Installation

Globally:

npm install -g ethfs-cli

Once installed, you can upload file or directory using:

ethfs-cli upload -f <directory|file> -a <address> -p <private-key> -c [chain-id] -t [upload-type]

Locally:

npm install ethfs-cli

After installation, use npx to run the command:

npx ethfs-cli upload -f <directory|file> -a <address> -p <private-key> -c [chain-id] -t [upload-type]

Command

| Short Name | Full Name | description |
|------------|------------------|--------------------------------------------------------------------------------------------------------| | -p | --privateKey | private key | | -a | --address | contract address / domain name | | -f | --file | upload file path / name | | -c | --chainId | chain id | | -r | --rpc | provider url | | -t | --type | file upload type:calldata: 1 or calldata blob: 2 or blob | | -g | --gasIncPct | gas price increase percentage | | -s | --threadPoolSize | number of threads for concurrent file uploads, default value:QuarkChain L2: 15 others: 6 | | -e | --estimateGas | estimate gas |

Supported networks

| Chain Name | Chain Short Name and Chain Id | |----------------------------|-------------------------------| | Ethereum Mainnet | eth / 1 | | Goerli Testnet | gor / 5 | | Sepolia Testnet | sep / 11155111 | | Optimism | oeth / 10 | | Optimism Testnet | ogor / 420 | | Arbitrum One | arb1 / 42161 | | Arbitrum Nova | arb-nova / 42170 | | Arbitrum Testnet | arb-goerli / 421613 | | Web3Q Galileo Testnet | w3q-g / 3334 | | BNB Smart Chain | bnb / 56 | | BNB Smart Chain Testnet | bnbt / 97 | | Avalanche C-Chain | avax / 43114 | | Avalanche Fuji Testnet | fuji / 43113 | | Fantom Opera | ftm / 250 | | Fantom Testnet | tftm / 4002 | | Polygon Mainnet | matic / 137 | | Polygon Mumbai | maticmum / 80001 | | Polygon zkEVM Testnet | zkevmtest / 1402 | | QuarkChain Mainnet Shard 0 | qkc-s0 / 100001 | | QuarkChain Devnet Shard 0 | qkc-d-s0 / 110001 | | Harmony Mainnet Shard 0 | hmy-s0 / 1666600000 | | Harmony Testnet Shard 0 | hmy-b-s0 / 1666700000 | | Evmos | evmos / 9001 | | Evmos Testnet | evmos-testnet / 9000 | | QuarkChain L2 Testnet | esl2-t / 43069 |

Usage

Support EIP-3770 Address

Ethereum
    eth:<name|address>
Sepolia
    sep:<name|address>
...    
Example
Ethereum
    eth:ens.eth
Sepolia
    sep:0x1825...2388
...

Create FlatDirectory Command

Ethereum is the default network if it's not specified, otherwise, you should use "--chainId" to set it. RPC should also be specified if the network is an unlisted network.

ethfs-cli create -p <private-key> -c [chain-id] -r [rpc]

// output: contract address 
Example
ethfs-cli create -p 0x32...
ethfs-cli create -p 0x32... -c 11155111
ethfs-cli create -p 0x32... -r https://rpc.ankr.com/eth

Upload Command

Upload files, you need to specify the upload type. The default type is blob:2. If you want to use name instead of FlatDirectory address, the name should be pointed to the FlatDirectory address in advance. Click here for details.

ethfs-cli upload -f <address|domain> -a <address> -p <private-key> -t [upload-type] -c [chain-id] -r [rpc] -g [gas-price-increase-percentage] -e [estimate-gas] -s [thread-pool-size]
Example
FlatDirectory address
  ethfs-cli upload -f index.html -a gor:0x1825...2388 -p 0x32... -t 1
  ethfs-cli upload -f index.html -a 0x1825...2388 -p 0x32... -c 11155111 -t 1
  ethfs-cli upload -f index.html -a 0x1825...2388 -p 0x32... -r https://rpc.xxx -t calldata -g 20
  ethfs-cli upload -f index.html -a 0x1825...2388 -p 0x32... -r https://rpc.xxx -t calldata -s 12
  ethfs-cli upload -f index.html -a 0x1825...2388 -p 0x32... -r https://rpc.xxx -t calldata -e
ens
  ethfs-cli upload -f dist -a eth:ens.eth -p 0x32... -r https://rpc.ankr.com/eth -t 2
  ethfs-cli upload -f dist -a eth:ens.eth -p 0x32... -r https://rpc.ankr.com/eth -t blob

Set FlatDirectory Default Entrance

ethfs-cli default -a <address|domain> -f <file-name> -p <private-key> -c [chain-id] -r [rpc]
Example
FlatDirectory address
  ethfs-cli default -a sep:0x1825...2388 -f index.html -p 0x32...
  ethfs-cli default -a 0x1825...2388 -f index.html -p 0x32... -c 11155111
  ethfs-cli default -a 0x1825...2388 -f index.html -p 0x32... -r https://rpc.xxx
ens
  ethfs-cli default -a eth:ens.eth -f index.html -p 0x32... -r https://rpc.ankr.com/eth

Download File

ethfs-cli download -a <address|domain> -f <fileName> -c [chain-id] -r [rpc]
Example
FlatDirectory address
  ethfs-cli download -a sep:0x1825...2388 -f index.html
  ethfs-cli download -a 0x1825...2388 -f index.html -c 11155111
  ethfs-cli download -a 0x1825...2388 -f index.html -r https://rpc.xxx
ens
  ethfs-cli download -a eth:ens.eth -f home.vue

Remove File

ethfs-cli remove -a <address|domain> -f <file-name> -p <private-key> -r [rpc] -c [chain-id]
Example
FlatDirectory address
  ethfs-cli remove -a sep:0x1825...2388 -f index.html -p 0x32...
  ethfs-cli remove -a 0x1825...2388 -f index.html -p 0x32... -c 11155111
  ethfs-cli remove -a 0x1825...2388 -f index.html -p 0x32... -r https://rpc.xxx
ens
  ethfs-cli remove -a eth:ens.eth -f home.vue -p 0x32...

Repo

Github Repo