Swan Chain
  • BULDERS
    • Getting Started
    • DApp Developer
      • Deploying Your First Smart Contract with Remix
      • Interacting with Smart Contract on Swan Chain Using Go
    • App Developer
      • Building Docker Images and Deployment file with LDL
        • Lagrange Definition Language(LDL)
      • Deploying with Swan SDK
      • Store and Retrieve a File with Swan Storage
        • 1. Set up the python-MCS-SDK
        • 2.Create and Manage Buckets
        • 3.Upload Files and Folders
        • 4.Retrieve and Download Files
        • 5.Delete Files and Buckets
    • Node Operator
      • Swan Node Snapshots
    • Market Provider
      • Storage Market
      • AI/ML Orchestrator
        • Decentralized AI Marketplace
        • Connect to Orchestrator
      • Web3 ZK Computing Market
        • ZK Auction Engine
        • Sequencer
        • Contribute zk-UBI-task
          • How to Contribute
        • Example
      • Customized Market Provider
    • Computing Provider
      • Fog Computing Provider(FCP)
        • FCP Setup
        • Migrating FCP to Swan Mainnet
        • FCP Funding Operations Guide
        • FCP FAQ
      • Edge Computing Provider (ECP)
        • ECP Setup
        • ECP Funding Operations Guide
        • ECP FAQ
      • FAQ
    • Storage Provider
      • Storage Auction System
    • Developer Tools
      • Swan SDK
        • Python Swan SDK
          • Special Case: Create ssh login instance
          • SWAN Orchestrator SDK - Function and Parameter Reference
        • Go Swan SDK
          • A Sample Tutorial
      • Swan Console
        • Getting Started
        • Blockchain GPU Task Example
        • Custom Blockchain GPU Task Pools
      • Lagrange
      • Swan IPFS Storage
      • Nebula Block Cloud
      • Ecosystem Projects
    • Mission 3.0
      • Get Started
        • For Users
        • For Space Holders
  • NETWORK REFERENCE
    • Network Info
      • Set Up Your Wallet
      • Bridge Token
    • Contract Addresses
    • Fees
  • Core Concepts
    • Introduction to Swan Chain
    • Consensus Layer
    • Peer-to-peer (P2P) Network
    • Payment Channels
    • Service Discovery
    • Market Provider
      • Storage Market
      • AI Computing Marketplace
        • Orchestrator
        • Auction Engine
        • Bidding Task State Machine
      • ZK Proof Marketplace
        • ZK Task
        • ZK Pool
    • Storage Layer
    • Computing Layer
      • Computing Provider Protocol
      • Computing Provider Account
      • Layer3 Computing Protocol
      • Reputation System
      • Dynamic Pricing
    • CDN Layer
    • Tokenomics
      • UBI Allocation Curve
      • Computing Provider Income
      • Computing Provider Collateral
        • Collateral Requirement and Computing Unit
        • DePIN Oracle
      • Governance
        • Treasure DAO
    • Glossary
  • Swan Chain Campaign
    • Swan CP UBI
    • Swan Chain Mainnet
      • Network Information
      • Swan Token
      • Swan Chain Mission
        • Social Mission
        • Onchain Mission
        • Mission: Celestial Bloom
      • Swan Provider Campaign
        • Fog Computing Provider (FCP)
        • Edge Computing Provider (ECP)
        • Market Provider (MP)
      • GALXE Campaign
      • Free Tier and Special Credit Programs
    • Atom Accelerator Race
      • Before You Get Started
        • Set Up MetaMask
        • Claim SepoliaETH
        • Claim testSWAN
      • CP Acceleration Program
      • Builder Acceleration Program
      • On-chain Interaction Race
      • Community Engagement Challenge
      • FAQ
    • Swan Saturn Testnet
      • Before You Get Started
        • Set Up MetaMask
        • Claim Faucet Tokens
        • Bridge Tokens
      • Transaction Drive Program
      • Community and Educational Events
      • Partnership and Integration Program
      • KOL Program
      • Computing Provider Program
        • FAQ
      • Developer Grant Program
      • FAQ
    • Swan Jupiter Testnet
      • How to Participate
      • Before You Get Started
      • Network Early Adopter
      • FAQ
  • RESOURCE
    • Links
    • Brand Kit
Powered by GitBook
On this page
  • Q: What is CU?
  • Q: How is the CP collateral calculated?
  • Q: How to Change Owner Address
  • Q: How to Change Worker Address
  • Q: How to Change Beneficiary Address
  • Q: How to Change Task Types
  • Q: How to Change Multi-Address
  • ECP FAQ
  • Q: How to Initialize Repository
  • Q: How to Create Account
  • Q: How to Add Collateral
  • Q: How to Withdraw Collateral
  • Q: How to Manag Sequencer Balance
  • FCP FAQ
  • Q: How to Initialize Repository
  • Q: How to Create Account
  • Q: How to Add Collateral
  • Q: How to Withdraw Collateral
  • Q: What is the difference between ECP and FCP, and what are the minimum configuration requirements?
  • Q: What do the Owner, Worker, and Beneficiary addresses represent, and what are the differences?
  • Q: What should I do if my server's public IP changes?
  • Q: How can I check how much collateral my CP needs, and is my collateral sufficient?
  • Q: What is the current slashing mechanism for CP?
  • Q: How to verify if FCP is running properly?
  • Q: How to verify if ECP is running properly?
  1. BULDERS
  2. Computing Provider

FAQ

PreviousECP FAQNextStorage Provider

Last updated 2 months ago

Q: What is CU?

CU, short for Computing Unit, is a key parameter in Swan Chain. It is a virtual unit used to measure the computing resource contributions of Computing Providers (CPs). CU plays a crucial role in determining the collateral requirements for CPs.

The primary function of CU is to help calculate the collateral requirements for CPs. This ensures that CPs have sufficient staking to qualify for UBI rewards and task allocations on Swan Chain. Each CP’s CU value can be checked via the .

Q: How is the CP collateral calculated?

The required collateral is calculated using the following formula:

Collateral=CU×BaseCollateral Collateral=CU×Base CollateralCollateral=CU×BaseCollateral

Currently, the Base Collateral is set at 3,533.

Example Calculation

If a CP has a CU of 100, the collateral requirement would be:

100×3,533=353,300100×3,533=353,300100×3,533=353,300

Q: How to Change Owner Address

To change the owner address of your CP account, use the following command:

computing-provider --repo <YOUR_CP_REPO> account changeOwnerAddress --ownerAddress <YOUR_OLD_OWNER_ADDRESS> <YOUR_NEW_OWNER_ADDRESS>

Note: The YOUR_NEW_OWNER_ADDRESS does not need to be on the CP machine, but the owner’s private key is required for this operation.

Q: How to Change Worker Address

To change the worker address, run:

computing-provider --repo <YOUR_CP_REPO> account changeWorkerAddress --ownerAddress <YOUR_OWNER_ADDRESS> <YOUR_NEW_WORKER_ADDRESS>

Note: The YOUR_NEW_WORKER_ADDRESS must be stored on the CP machine for two essential purposes:

  • Verification of bidirectional signatures by the UBI engine when receiving UBI tasks. Tasks will not be accepted if verification fails.

  • Proof submission to the chain. While this direct submission method provides faster confirmation, it requires the worker wallet to maintain an ETH balance for gas fees. Alternatively, using the sequencer method for submission can help reduce gas costs

Q: How to Change Beneficiary Address

Update the beneficiary address with:

computing-provider --repo <YOUR_CP_REPO> account changeBeneficiaryAddress --ownerAddress <YOUR_OWNER_ADDRESS> <YOUR_NEW_BENEFICIARY_ADDRESS>

Note: The beneficiary address is for receiving rewards, and no private key is required on the CP machine.

  • For CP maintenance personnel, this separation enhances security as they can manage the CP without direct access to the beneficiary wallet. Additionally, all CP rewards (including UBI rewards, application deployment rewards, etc.) are distributed to this address.

Q: How to Change Task Types

CP currently supports five task types, each corresponding to different workloads and associated rewards. The more task types you set, the more diverse tasks your CP can accept.

There are two CP roles: FCP and ECP.

You can set the task types using the following command:

computing-provider --repo <YOUR_CP_REPO> account changeTaskTypes --ownerAddress <YOUR_OWNER_ADDRESS> <task_type1>,<task_type2>,...

Task Types:

  1. Fil-C2: Time-space proof tasks for Filecoin.

  2. Mining: Mining-related tasks.

  3. AI: AI and web service tasks.

  4. Inference: Large model inference API tasks.

  5. NodePort: VM-like services or multi-port services.

Q: How to Change Multi-Address

MultiAddress defines how your CP is accessible on the network.

  1. Update network configuration:

  • For cloud providers: Configure in provider console

  • For private datacenters: Configure on network egress devices

  1. To update the public IP or internal port mapping, modify the config.toml file:

[API]
MultiAddress = "/ip4/<public_ip>/tcp/<port>"
  1. Then run the update command:

computing-provider --repo <YOUR_CP_REPO> account changeMultiAddress --ownerAddress <YOUR_OLD_OWNER_ADDRESS> <YOUR_NEW_MULTI_ADDRESS>
  1. Finally, verify the update:

# Step 1: Check local configuration
computing-provider --repo <YOUR_CP_REPO> info

# Step 2: Verify API accessibility
# For FCP:
curl -k https://<PUBLIC_IP>:<PORT>/api/v1/computing/cp
# For ECP:
curl http://<PUBLIC_IP>:<PORT>/api/v1/computing/cp

ECP FAQ

Q: How to Initialize Repository

The first step in setting up an ECP is initializing the repository. This creates a config.toml file containing essential configuration settings and defines data storage parameters.

computing-provider --repo <YOUR_CP_REPO> init --multi-address=/ip4/<YOUR_PUBLIC_IP>/tcp/<YOUR_PORT> --node-name=<YOUR_NODE_NAME>

Q: How to Create Account

In the Swan network, each CP exists as a contract address. The CP account serves as your unique identifier for all operations, including task distribution, reward collection, and collateral management. It represents your primary token of identity within the Swan network.

computing-provider --repo <YOUR_CP_REPO> account create \
    --ownerAddress <YOUR_OWNER_WALLET_ADDRESS> \
    --workerAddress <YOUR_WORKER_WALLET_ADDRESS> \
    --beneficiaryAddress <YOUR_BENEFICIARY_WALLET_ADDRESS> \
    --task-types 1,2

Q: How to Add Collateral

To participate in the Swan network and receive tasks, ECPs must stake SWAN tokens as collateral. This stake serves as a security mechanism - if service availability falls below acceptable levels, penalties may be applied against this collateral.

computing-provider --repo <YOUR_CP_REPO> collateral add --ecp --from <YOUR_WALLET_ADDRESS> <amount>

Q: How to Withdraw Collateral

There are two methods for withdrawing collateral, each with different processing times:

  1. Direct Withdrawal from Collateral Balance

    computing-provider --repo <YOUR_CP_REPO> collateral withdraw --ecp --owner <YOUR_WALLET_ADDRESS> --account <YOUR_CP_ACCOUNT> <amount>

    Note: Funds are transferred immediately to the owner address.

  2. Withdrawal from Escrow Balance This process requires a waiting period and multiple steps:

    # Submit withdrawal request
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-request --ecp --owner <YOUR_OWNER_ADDRESS> <AMOUNT>
    
    # Confirm withdrawal (after 7-day waiting period)
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-confirm --ecp --owner <YOUR_OWNER_ADDRESS>
    
    # Check withdrawal status
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-view --ecp

    Note: After submitting the withdrawal request, there is a mandatory 7-day waiting period before confirmation can be processed. Use the command withdraw-view to monitor the withdrawal status.

Q: How to Manag Sequencer Balance

  1. Adding Funds to Sequencer

    computing-provider --repo <YOUR_CP_REPO> sequencer add --from <YOUR_WALLET_ADDRESS> <amount>
  2. Withdrawing from Sequencer

    computing-provider --repo <YOUR_CP_REPO> sequencer withdraw --owner <YOUR_OWNER_ADDRESS> <amount>

FCP FAQ

Q: How to Initialize Repository

The first step in setting up an FCP is initializing the repository. This creates a config.toml file that contains essential configuration settings and defines data storage parameters.

computing-provider --repo <YOUR_CP_REPO> init --multi-address=/ip4/<YOUR_PUBLIC_IP>/tcp/<YOUR_PORT> --node-name=<YOUR_NODE_NAME>

Q: How to Create Account

In the Swan network, each CP exists as a contract address, with the CP account serving as the unique identifier for all operations. This account handles task distribution, reward collection, and collateral management. It's your primary token of identity within the Swan network.

computing-provider --repo <YOUR_CP_REPO> account create \
    --ownerAddress <YOUR_OWNER_WALLET_ADDRESS> \
    --workerAddress <YOUR_WORKER_WALLET_ADDRESS> \
    --beneficiaryAddress <YOUR_BENEFICIARY_WALLET_ADDRESS> \
    --task-types 3

Q: How to Add Collateral

To participate in the Swan network and receive tasks, FCPs must stake SWAN tokens as collateral. This stake serves as a security mechanism - if service availability falls below acceptable levels, penalties may be applied against this collateral.

computing-provider --repo <YOUR_CP_REPO> collateral add --fcp --from <YOUR_WALLET_ADDRESS> <amount>

Q: How to Withdraw Collateral

There are two methods for withdrawing collateral, each with different processing times:

  1. Direct Withdrawal from Collateral Balance

    computing-provider --repo <YOUR_CP_REPO> collateral withdraw --fcp --owner <YOUR_WALLET_ADDRESS> --account <YOUR_CP_ACCOUNT> <amount>

    Note: Funds are transferred immediately to the owner address.

  2. Withdrawal from Escrow Balance This process requires a waiting period and multiple steps:

    # Submit withdrawal request
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-request --fcp --owner <YOUR_OWNER_ADDRESS> <AMOUNT>
    
    # Confirm withdrawal (after 7-day waiting period)
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-confirm --fcp --owner <YOUR_OWNER_ADDRESS> 
    
    # Check withdrawal status
    computing-provider --repo <YOUR_CP_REPO> collateral withdraw-view --fcp

    Note: After submitting the withdrawal request, there is a mandatory 7-day waiting period before confirmation can be processed. Use the view command to monitor the withdrawal status.

Q: What is the difference between ECP and FCP, and what are the minimum configuration requirements?

FCP:

  • For applications deployed with Kubernetes or large model inference API services. Users can directly offer services via a running URL. Kubernetes deployment and maintenance are technically more challenging but provide higher rewards.

  • Configuration Requirements:

    • A public IP

    • A wildcard domain (e.g., *.example.com)

    • An SSL certificate, primarily for Kubernetes Ingress reverse proxy

    • At least 1 GPU

    • At least 8 vCPUs

    • At least 100 GB SSD storage

    • At least 64 GB RAM

    • At least 50 MB bandwidth

ECP:

  • For applications deployed with Docker or Mining-type services. Easier to deploy with scripts available for quick setup.

  • Configuration Requirements:

    • A public IP

    • At least 1 GPU

    • At least 4 vCPUs

    • At least 300 GB HDD storage

    • At least 32 GB RAM

    • At least 20 MB bandwidth


Q: What do the Owner, Worker, and Beneficiary addresses represent, and what are the differences?

  • ownerAddress: The owner of the cpAccount. Only the owner has permission to change account details, such as multi-address, worker address, beneficiary address, etc. The owner's private key should not appear on the server under normal circumstances.

  • workerAddress: The working address, used for submitting messages (e.g., submitProof). A certain amount of sETH is required for gas fees.

  • beneficiaryAddress: The beneficiary address where earnings from the cpAccount are paid. This address is only used to receive funds, so its private key should not be stored on the server for security reasons. The purpose of these three address types is to ensure the security of the cpAccount. Typically, the server should only need to maintain the private key for the worker address, not the owner or beneficiary addresses.


Q: What should I do if my server's public IP changes?

Follow the instructions in the CP Common Account Operations section to change the multiAddress.

Q: How can I check how much collateral my CP needs, and is my collateral sufficient?

  • Collateral Calculation:

    • The collateral formula is: cu * base_collateral. Currently, base_collateral = 3533. It’s recommended to add 10% extra for safety.

  • You can check your collateral status via the CP Dashboard:

Sufficient collateral (Example):

Insufficient collateral (Example):

Q: What is the current slashing mechanism for CP?

Q: How to verify if FCP is running properly?

  • Step 1: Check Collateral:

computing-provider --repo info

Ensure that the sum of Collateral and Escrow under the FCP Balance is greater than the calculated collateral amount for proper staking.

  • Step 2: Check Versions:

    • CP Version:

computing-provider -v
  • Resource-Exporter Version:

kubectl get daemonset resource-exporter-ds -n kube-system -o yaml | grep image:
  • Step 3: Check Resource Endpoint:

curl -k https://<cp-ip>:<port>/api/v1/computing/cp

Note: Replace <cp-ip> and <port> with the corresponding information from your CP_REPO configuration file, where MultiAddress = "/ip4/<ip>/tcp/<port>".

  • Step 4: Self-check by submitting a job:

curl -k --location --request POST 'https://<cp-ip>:<port>/api/v1/computing/lagrange/jobs' \
--header 'Content-Type: application/json' \
--data-raw '{
"uuid": "5641877b-dc94-469a-bb3b-ecab6d10f7dd",
"name": "Job-5641877b-dc94-469a-bb3b-ecab6d10f7dd",
"status": "Submitted",
"duration": 900,
"job_source_uri": "https://api.lagrangedao.org/spaces/51d6abbb-f928-43e4-91fd-79e93e2b276f",
"storage_source": "lagrange",
"task_uuid": "92cd5595-9789-4af3-9100-7c7e4aacb456"
}'

Q: How to verify if ECP is running properly?

  • Step 1: Check Collateral:

computing-provider --repo info

Ensure that the sum of Collateral and Escrow under the ECP Balance is greater than the calculated collateral amount for proper staking.

  • Step 2:Check Versions:

    • CP Version:

computing-provider -v
  • Resource-Exporter Version:

kubectl get daemonset resource-exporter-ds -n kube-system -o yaml | grep image:
  • Step 3: Check Resource Endpoint:

curl http://<cp-ip>:<port>/api/v1/computing/cp

Note: Replace <cp-ip> and <port> with the corresponding information from your CP_REPO configuration file, where MultiAddress = "/ip4/<ip>/tcp/<port>".

  • Step 4: Self-check by submitting a job:

curl --location --request POST 'http://<cp-ip>:<port>/api/v1/computing/cp/ubi' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 26384,
    "name": "1000-0-7-26381",
    "type": 1,
    "resource_type": 0,
    "deadline": 2000000,
    "check_code": "check_code-demo",
    "input_param": "https://286cb2c989.acl.swanipfs.com/ipfs/QmTgoX6LkzZTsTjSjXvujzgJEHBLTEg3KMUadQGnyTrNFG",
    "verify_param": "https://286cb2c989.acl.swanipfs.com/ipfs/QmTgoX6LkzZTsTjSjXvujzgJEHBLTEg3KMUadQGnyTrNFG.verify",
    "resource":{"cpu":"10","memory":"5.00 GiB","storage":"10.00 GiB"}
    "signature":"Signing_cpAccountAddress_and_id_with_ownerAddress"
}'

For FCP: The default task types are 3 and 4. To accept more tasks, additional configurations are needed, such as enabling .

For ECP: The default task types are 1 and 2. To accept more tasks, additional configurations are needed, such as enabling .

Note: Separate task types with commas. The full list of task types can be found in the Swan Chain documentation .

check details about collateral .

check details about collateral .

First, visit the to query your cpAccount and find the CU value.

When you deploy an application to CP, the CP runs the service, and the SWAN monitoring system will penalize the CP if the service's availability is deemed poor. For more details, refer to the .

Verify the CP version by checking the commit number in the official repository to confirm if your version is up-to-date or the recommended stable version.

Verify the version of resource-exporter by checking the required version in the .

Step 5: Dashboard Status Check: In the , locate your CP using the cpAccount. Check that the status is Online, and ensure collateral is sufficient (as shown in the example). If so, your CP is running properly.

Verify the CP version by checking the commit number in the official repository to confirm if your version is up-to-date or the recommended stable version.

Verify the version of resource-exporter by checking the required version in the .

Dashboard Status Check: In the , locate your CP using the cpAccount. Check that the status is Online, and ensure collateral is sufficient (as shown in the example). If so, your CP is running properly.

Provider Dashboard
NodePort
Inference
here
here
here
Provider Dashboard
Slashing Mechanism
go-computing-provider
official repository
go-computing-provider
official repository
Provider Dashboard
Provider Dashboard