1.0.8 • Published 20 hours ago

ethfs-cli v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
20 hours ago

ethfs-cli

Installation

Globally:

npm install -g ethfs-cli
ethfs-cli upload -f <directory|file> -a <address> -p <private-key> -r [rpc] -t [upload-type]

Locally:

npm install ethfs-cli
npx ethfs-cli upload -f <directory|file> -a <address> -p <private-key> -r [rpc] -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 save typeon chain: 1blob: 2

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

Usage

Support EIP-3770 Address

ethereum
    eth:<name|address>

... 

galileo
    w3q-g:<name|address>       
Example
ethereum
    eth:ens.eth

...

galileo
    w3q-g: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 <privateKey>
ethfs-cli create -p <privateKey> -c [chainId]
ethfs-cli create -p <privateKey> -c [chainId] -r [rpc]

// output: contract address 
Example
ethfs-cli create -p 0x32...
ethfs-cli create -p 0x32... -c 5
ethfs-cli create -p 0x32... -c 1 -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.

FlatDirectory address
  ethfs-cli upload -f <directory|file> -a <address> -p <privateKey> -r [rpc] -t [uploadType]
ens
  ethfs-cli upload -f <directory|file> -a <name> -p <privateKey> -r [rpc] -t [uploadType]
w3ns
  ethfs-cli upload -f <directory|file> -a <name> -p <privateKey> -r [rpc] -t [uploadType]
Example
FlatDirectory address
  ethfs-cli upload -f index.html -a gor:0x1825...2388 -p 0x32...
  ethfs-cli upload -f index.html -a xxx:0x1825...2388 -p 0x32... -r https://rpc.xxx -t 1
ens
  ethfs-cli upload -f dist -a eth:ens.eth -p 0x32... -r https://rpc.ankr.com/eth -t 2
w3ns
  ethfs-cli upload -f dist -a w3q-g:home.w3q -p 0x32... -t 2

Set FlatDirectory Default Entrance

FlatDirectory address
  ethfs-cli default -a <address> -f <fileName> -p <privateKey> -r [rpc]
ens
  ethfs-cli default -a <name> -f <fileName> -p <privateKey> -r [rpc]
w3ns
  ethfs-cli default -a <name> -f <fileName> -p <privateKey> -r [rpc]
Example
FlatDirectory address
  ethfs-cli default -a gor:0x1825...2388 -f index.html -p 0x32...
  ethfs-cli default -a xxx: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
w3ns
  ethfs-cli default -a w3q-g:home.w3q -f index.html -p 0x32...  -r https://rpc.ankr.com/eth

Remove File

FlatDirectory address
  ethfs-cli remove -a <address> -f <fileName> -p <privateKey> -r [rpc]
ens
  ethfs-cli remove -a <name> -f <fileName> -p <privateKey> -r [rpc]
w3ns
  ethfs-cli remove -a <name> -f <fileName> -p <privateKey> -r [rpc]
Example
FlatDirectory address
  ethfs-cli remove -a gor:0x1825...2388 -f index.html -p 0x32...
  ethfs-cli remove -a xxx:0x1825...2388 -f index.html -p 0x32... -r https://rpc.xxx
ens
  ethfs-cli remove -a eth:ens.eth -f src/home.vue -p 0x32... -r https://rpc.ankr.com/eth
w3ns
  ethfs-cli remove -a w3q-g:home.w3q -f src/home.vue -p 0x32... -r https://rpc.ankr.com/eth

Download File

FlatDirectory address
  ethfs-cli download -a <address> -f <fileName> -r [rpc]
ens
  ethfs-cli download -a <name> -f <fileName> -r [rpc]
w3ns
  ethfs-cli download --address <name> --file <fileName> --rpc [rpc]
Example
FlatDirectory address
    npx ethfs-cli download -a gor:0x1825...2388 -f index.html
    npx ethfs-cli download -a xxx:0x1825...2388 -f index.html -r https://rpc.xxx
ens
    npx ethfs-cli download -a eth:ens.eth -f home.vue
w3ns
    npx ethfs-cli download --address w3q-g:home.w3q --file home.vue --rpc https://rpc.xxx

Repo

Github Repo

1.0.8

20 hours ago

1.0.7

4 days ago

1.0.6

4 days ago

1.0.5

14 days ago

1.0.4

23 days ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

1.0.0-beta.0.2

2 months ago

1.0.3

2 months ago

1.0.0-beta.0.1

2 months ago

1.0.0-beta.0

2 months ago