Guidelines
- Introduction
- Installation
- Quick Start
Guides
- Introductions
- Build local test node
- Smart Contract - ABI Files
- Smart Contract——JS Contract
- Deploy Contracts
- Test Contract
- Develop DApp Client
Smart Contracts
- Contract Introduction
- ABI File
- Database
- Account Authority
- Call In-contract
- Notification
System Contracts
- Resources
- Account
- Permission
Token Contracts
- Transfer
- Token
- Token Exchange
- Contract Sub-Wallet
Node Guide
- Node Introduction
- Add to nodes network
- Node Data Persistence
Access Guide
- FO 接入安全指南
Resources
There are 2 types of FIBOS Resources: one is mortgage type resources, includes CPU and NET; the other one is a consumption resource, called RAM or storage.
Enough RAM,CPU and NET are required if a user wants to release a contract.
RAM and Resources
RAM
- RAM is a necessary resource to storage data on blockchain. It requires users to buy from the system, the more data stored, the more is RAM needed.
- The price of RAM is decided by market, it will adjust automatically according to the market. When a program is done using RAM, RAM can be released and sold at current market price.
- No matter buying RAM or selling RAM, the process is only between user and the system account instead of market trading. Only the price will be set by bancor algorithm.
Network Bandwidth
- User can get larger bandwidth by mortgaging more FO. Also the mortgage can be reversed to unload network bandwidth and get FO back.
- Network bandwidth can be understood as mobile phone flow. It can be obtained flexibly according to requirement.
CPU Bandwidth
- CPU bandwidth is used to measure the computing time (milliseconds) while executing the contract in the last 3 days
- CPU bandwidth is similar to network bandwidth, it is a temporary consumption. When the usage drops. the consumption drops too, the minimum is 0.
- You can get larger CPU by mortgaging FO or cancel the mortgaging to decrease CPU and get your FO back.
How to buy or mortgage resources
Buy RAM
RAM consumption is required to store account information on chain, thus the creator needs to buy RAM for the user to save new account information.
This is done by by calling the
buyrambytes
method. The parameters and explanation:
1 | const FIBOS = require('fibos.js'); |
- Buy storage resources. The difference is to buy specific amount of tokens or specific size of content.
By calling buyram
method. The parameters and explanation:
1 | const FIBOS = require('fibos.js'); |
Mortgage Resources
Creator mortgages FO for receiver to get CPU and NET in order to let new account be able to transfer.
By calling delegatebw
method, the parameters and explain are as below:
1 | const FIBOS = require('fibos.js'); |
Cancel Mortgage
Used to cancel mortgaging, release resources and get token back.
By calling updelegatebw
method, the parameters and explain are as below:
1 | const FIBOS = require('fibos.js'); |
Sell Resources
By calling sellram
method, the parameters and explaination are as below:
1 | const FIBOS = require('fibos.js'); |