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 接入安全指南
Build local test node
Note: Please make sure to install FIBOS locally before setting up the node.
【Install runtime environment】
Start a local FIBOS node so that you can develop the specific content of FIBOS locally. In the actual development environment, you need to develop FIBOS nodes through the different plug-ins below.
Create a new start_fibos
folder, and save the code to start_fibos/node.js
:
1 | var fibos = require('fibos'); |
Configure HTTP service
http plugin
For example: http-server-address can be used to configure the local service address, default value is 127.0.0.1:8888.
1 | fibos.load('http', { |
Specific http configuration information please see http plugin
Configure block info
chain plugin
For example: delete-all-blocks can be used to determine whether all state data and block data are deleted, with the default value is false.
1 | fibos.load('chain',{ |
Specific chain configuration information please see chain plugin
Obtain P2P information
net plugin
p2p-listen-endpoint can be used to monitor the address and port of the p2p link, with the default value is 0.0.0.0:9876.
1 | fibos.load('net',{ |
Specific net configuration information see net plugin
Control block production information
producer plugin
producer-name:refers to the account name that control block production of nodes.
enable-stale-production:: enables the production of blocks, even if the block is static.
1 | fibos.load('producer', { |
Specific producer configuration information see producer plugin
Modify and view FIBOS config and data directory
fibos.data_dir:refers to the data storage directory of fibos.
fibos.config_dir:refers to the config storage directory of fibos.
1 | fibos.config_dir = 'fibos_config_dir/'; |
JS smart contract status
Boolean can be used to query and set the JavaScript smart contract status. When it is True, it can support JavaScript smart contracts.
1 | fibos.enableJSContract = true; |
Start node
1 | fibos.start(); |
Advanced Config
Modify FIBOS monitoring port and address
Enable the HTTP service to monitor the 8889 Port of all addresses
Enable the P2P service to monitor the 9877 Port of all addresses
1 | fibos.load('http', { |
- Modify and view FIBOS config and data directory
1 | // View FIBOS config and data directory |
- Set the reset of environment data when the FIBOS service starts
1 | fibos.load('chain', { |
Node code example
The following code is stored to start_fibos/node.js, and used to start a local FIBOS node.
1 | var fibos = require('fibos'); |
Note: In case of any problems in subsequent development and testing, please restart the FIBOS node service and try again!
Run the FIBOS development environment:
1 | fibos-todomvc$ fibos start_fibos/node.js |
Run results log (partial)
1 | fibos-todomvc$ fibos start_fibos/node.js |
If you see the above, it means operation is successful and fibos
has started block production.
The GitHub source code of this article: start_fibos
folder of https://github.com/fengluo/fibos-todomvc
Next Chapter
👉 【Write ABI File】