Swan Network
English
  • Getting Started
    • Overview
    • Protocol Stack
      • Cross-chain Consensus Layer
      • Peer-to-peer (P2P) Network
      • Payment Channels
      • Service Discovery
      • Data Marketplace
      • Indexing and Caching Marketplace
      • Web3 Task Auction
      • Storage Layer
      • Computing Layer
      • CDN Layer
      • Economic System
        • Grants
        • Computing Jobs
        • Universal Basic Income (UBI)
        • Swan Provider Income
      • Token
      • Governance
        • Treasure DAO
      • Glossary
    • Contact Us
      • Social Accounts & Communities
      • Business Partnerships
    • FAQ
  • QuickStarts
    • Dive into QuickStarts
      • Swan Chain: Developing Smart Contracts with Go
  • Swan Storage Market
    • Overview
      • Swan Auction System
      • Reputation System
    • Key functionalities
      • Task Management
        • Create a New Task
        • Navigate Tasks
        • Update Tasks
        • Assign Tasks
      • My Profile
        • Register as a storage provider
      • Find Storage Providers
        • Storage Provider Details
      • Extend DataCap Terms Service
  • Swan IPFS Storage
    • Overview
      • Flink
    • Swan IPFS Storage User Guide
      • Networks
      • Setup MetaMask
    • Developer Quickstart
      • SDK
        • js MCS SDK
          • Prerequisites
          • Get Started
          • Bucket Storage
          • Onchain Storage
          • SDK JS Installation Tutorial Video
        • python MCS SDK
          • Quickstart
          • Bucket Storage
          • Onchain Storage
          • SDK Python Installation Tutorial Video
      • Additional Resources
    • Best Practice
      • Use Swan IPFS Storage as Platform Storage Solution
        • Single Organization Design
        • Multiple Organization Design
    • FAQ
  • Swan Provider
    • Overview
    • Features
    • Tutorial
      • Prerequisites
      • Installation
      • Configure and Run
      • Swan Provider Tutorial Video
    • FAQ
      • 1. Change the linked Email
      • 2. Check Storage Provider connectivity/stability
      • 3. How to stop accepting "auto-bid" deals?
      • 4. `aria2_download_dir` vs. `aria2_candidate_dirs`
      • 5. How to configure "import deals from Swan Provider" when Boostd is running normally
      • 6. A rejection msg always appears during the deal-importing process
      • 7. How to check if aria2 is running?
      • 8. No response from Swan Platform?
      • 9. Why Storage Provider status shows offline?
      • 10. How to check the Task Status?
      • 11. How to configure the Storage Provider Market?
      • 12. How to set the "ask price"?
      • 13.aria2_download_dir VS. aria2_candidate_dirs
      • 14. How to control the number of deals imported?
  • Swan Client
    • Overview
    • Basic Concepts
    • Tutorial
      • Filecoin Deal Sender
        • Installation
        • Configuration
        • Prerequisites
        • Generate CAR Files
        • Meta-CAR
        • Upload CAR Files to IPFS
        • Create a Task
      • Blockchain RPC Service
        • Deploy RPC Service
        • RPC Command Service
      • Swan Client Tutorial Video
    • FAQ
      • How to prepare data?
  • FS3
    • Overview
    • Setup your FS3
      • Prerequisites
      • Install FS3
      • FS3 Set up Video
    • FS3 User Guide
    • FS3 User Guide (Cloud Version)
  • Lagrange DAO
    • Overview
  • Development Resource
    • Swan Token Contract
      • Acquire Testnet USDC and MATIC tokens
    • Swan API
    • Swan IPFS Storage API
    • Swan IPFS Storage 2.0 API
    • Flink API
    • FS3 API
    • API keys
  • Swan Testnet
    • Swan Jupiter Testnet
      • How to Participate
      • Before You Get Started
      • Network Early Adopter
      • Computing Provider Setup
        • Prerequisites
        • Install the Kubernetes
        • Install and config the Nginx
        • Install the Hardware resource-exporter
        • Install the Redis service
        • Build and config the Computing Provider
        • Install AI Inference Dependency(Optional)
        • Start the Computing Provider
        • CLI of Computing Provider
        • FAQ
      • FAQ
Powered by GitBook
On this page
  • Install PostgreSQL Database
  • Install From Source
  • Checkout source code
  • Build the Source Code
  • Run a Standalone FS3 Server
  • Open FS3 Browser

Was this helpful?

  1. FS3
  2. Setup your FS3

Install FS3

PreviousPrerequisitesNextFS3 Set up Video

Last updated 3 years ago

Was this helpful?

Install PostgreSQL Database

PostgreSQL

A PostgreSQL database is required to be pre-built for FS3 server usage. Check on installation and connection instructions.

Install PostgreSQL on Ubuntu

First, execute the following command to create the file repository configuration:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Second, import the repository signing key:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Third, update the package list:

sudo apt-get update

Finally, install the latest version of PostgreSQL:

sudo apt-get install postgresql

Connect to the PostgreSQL database server via psql

sudo -i -u postgres

Next, It’ll prompt for the password of the current user. You need to provide the password and hit the Enter keyboard.

psql

You’ll access the postgres prompt like this:

postgres=#

To quit the PostgreSQL prompt, you run the following command:

postgres=# \q

This above command will bring you back to the postgres Linux command prompt.

postgres@ubuntu-dev:~$

To return to your regular system user, you execute the exit command like this:

postgres@ubuntu-dev:~$ exit

Create PostgreSQL Database

Create USER and PASSWORD as 'root'

sudo -u postgres psql
postgres=# create database fs3;                                                //create 'fs3' PostgreSQL database                                    
postgres=# create user root with encrypted password 'root';                    //create USER and PASSWORD as 'root'
postgres=# grant all privileges on database fs3 to root;                       //grant privileges
postgres=# \q                                                                  //logout postgres

Install From Source

Checkout source code

git clone https://github.com/filswan/fs3
cd fs3
git checkout <release_branch>

Build the Source Code

Build UI

cd browser
npm install
npm run release

Install Filecoin dependency

sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -

Install go module dependency

cd ..
git submodule update --init --recursive
make ffi

Build up Tables in Postgresql Database

bash db_setup.sh       

Set up FS3 configuration

Set up and customize FS3 configuration by making modifications on .env file, which stores your information as environment variables. An example config is given as .env.example for reference.

vim .env

Please Modify the .env file based on your use cases:

  • SWAN_ADDRESS : The address of filswan platform, default as https://api.filswan.com.

  • FS3_VOLUME_ADDRESS : The address of FS3 VOLUME, default as ~/minio-data. If changed, the FS3 server start command has to be changed accordingly.

  • FS3_WALLET_ADDRESS : A wallet address is a must for sending deals to miner.

  • CAR_FILE_SIZE : A fixed car file size in bytes need to be predefined before generating car files for trunk via variable CarFileSize, such as 8589934592 for 8Gb as default.

  • IPFS_API_ADDRESS : An available ipfs address with port need to be set up. For example, https://MyIpfsUrl:Port.

  • IPFS_GATEWAY : An available ipfs address with port need to be set up for file downloading. For example, https://MyIpfsGatewayUrl:Port.

Build up FS3 server

make

Run a Standalone FS3 Server

Run the FS3 Server

./minio server ~/fs3-data

Access Key and Secret Key

The FS3 deployment starts using default root credentials minioadmin:minioadmin but you can change it with your own credentials.

Change your Access Key and Secret Key

export MINIO_ROOT_USER= MY_FS3_ACCESS_KEY
export MINIO_ROOT_PASSWORD=MY_FS3_SECRET_KEY

If you change the credential, build up FS3 server again to make it take effect. Then re-run the fs3 server.

make
./minio server ~/fs3-data

Open FS3 Browser

SWAN_TOKEN : A valid swan token is required for posting task on swan platform. It can be received after creating an account on . Check for more details on how to get authorization token.

You can test the deployment using the FS3 Browser, an embedded web-based object browser built into FS3 Server. Point a web browser running on the host machine to and log in with the root credentials. You can use the Browser to create buckets, upload objects, send deals, retrieve data and browse the contents of the FS3 server.

You can also connect using any S3-compatible tool, such as the commandline tool.

PostgreSQL Tutorial
Filswan
Filswan APIs
http://127.0.0.1:9000
FS3-mc