Skip to content

FS3 Function Design

Charles Cao edited this page May 19, 2021 · 2 revisions
  • Swan API sort eligible miners
  1. Miner list
  2. Miner Price
  • Choose Miner/miners to backup
  1. Miner select box
  2. Set price
  3. Bind Wallet
  • Deal sending process
  1. swan client
$> mc list miners <region>
  1. folder/file to car
$> mc car generate <folder/file>
  1. config deal send parameter

config file or env @chi TBD

  1. Sending out deals

Before sending out the deals, user need to have a wallet setup locally and pay for the deal. User can either running a local lotus node or ask a 3rd party payment gateway for payment.

$> mc send <folder/file> <miner_id>

User Sample

Init the setup

$> export MINIO_ACCESS_KEY=fs3
$> export MINIO_SECRET_KEY=fs3torage
$> export fil_wallet=f12bxpqyyc...7hffregtypiifjq
# add the host to our mc config
$> mc config host add fs3 http://127.0.0.1:9000 minio miniostorage 
# create a bucket called testbucket
$> mc mb fs3/testbucket
# copy a local file called file.txt inside of testbucket
$> mc cp file.txt fs3/testbucket

# Generate car for uploading
$> mc car generate <folder/file>
# send file.txt as a deal to filecoin miner id f019104
$> mc send fs3/testbucket/file.txt f019104
# get the cid of the object in the bucket on filecoin
$> curl "http://localhost:8889/info?bucket=testbucket&object=file.txt"

https://github.com/filecoin-project/devgrants/blob/babea053951ae6cfa3334a8454f74b110ac1d115/open-grant-proposals/FS3_S3_compatible_storage_gateway.md

Clone this wiki locally