1.1.4 • Published 6 months ago

ethfs-cli v1.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

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 NameFull Namedescription
-p--privateKeyprivate key
-a--addresscontract address / domain name
-f--fileupload file path / name
-c--chainIdchain id
-r--rpcprovider url
-t--typefile upload type:calldata: 1 or calldata blob: 2 or blob
-g--gasIncPctgas price increase percentage
-s--threadPoolSizenumber of threads for concurrent file uploads, default value:QuarkChain L2: 15 others: 6
-e--estimateGasestimate gas

Supported networks

Chain NameChain Short Name and Chain Id
Ethereum Mainneteth / 1
Goerli Testnetgor / 5
Sepolia Testnetsep / 11155111
Optimismoeth / 10
Optimism Testnetogor / 420
Arbitrum Onearb1 / 42161
Arbitrum Novaarb-nova / 42170
Arbitrum Testnetarb-goerli / 421613
Web3Q Galileo Testnetw3q-g / 3334
BNB Smart Chainbnb / 56
BNB Smart Chain Testnetbnbt / 97
Avalanche C-Chainavax / 43114
Avalanche Fuji Testnetfuji / 43113
Fantom Operaftm / 250
Fantom Testnettftm / 4002
Polygon Mainnetmatic / 137
Polygon Mumbaimaticmum / 80001
Polygon zkEVM Testnetzkevmtest / 1402
QuarkChain Mainnet Shard 0qkc-s0 / 100001
QuarkChain Devnet Shard 0qkc-d-s0 / 110001
Harmony Mainnet Shard 0hmy-s0 / 1666600000
Harmony Testnet Shard 0hmy-b-s0 / 1666700000
Evmosevmos / 9001
Evmos Testnetevmos-testnet / 9000
QuarkChain L2 Testnetesl2-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

1.1.5

4 months ago

1.1.4

6 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

12 months ago

1.1.0

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.11

1 year ago

1.0.12

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-beta.0.2

1 year ago

1.0.3

1 year ago

1.0.0-beta.0.1

1 year ago

1.0.0-beta.0

1 year ago