Skip to content

Commit ca04ad5

Browse files
Update tutorial docs
1 parent 47ee37c commit ca04ad5

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

doc/en/Decentralized_message_board_development/3.Implement_your_own_message_service.md

+32
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,38 @@ Development phase: Complete the front-end and service-side development under the
3737
Publishing stage: Package the file resources required by the front-end and service-side, depending on the configuration of cyfs.config.json.
3838
Installation and running phases: DEC Service starts, runs and terminates on OOD, depending on the configuration of service_package.cfg.
3939

40+
### cyfs.config.json
41+
42+
1. config_version: the version number of the configuration file
43+
2. app_name: The name entered in `cyfs create -n` is also the name of the app. The app names of the same owner cannot be the same. Support non-ASCII characters such as Chinese, the name will be displayed on the app store and app management interface
44+
3. version: Indicates the `current version` of the App. When cyfs deploy is executed, the current version of the App will be packaged and deployed. After deployment, the third digit of the version will be automatically incremented by one as the new current version
45+
4. description: The description of the App. Each time it is deployed, the description text filled in here will be updated to the App object and displayed on the App Store.
46+
5. icon: App icon, only supports cyfs link. Update every time you deploy, display on the App Store and App Admin UI
47+
6. service: Configure Dec App Service related packaging and running configuration, the details are as follows
48+
- pack: Indicates which directories need to be packaged when packaging the Service
49+
- type: Specifies the type of service, currently supports "node" and "rust"
50+
When specified as "node", the package directory of the service, the cyfs directory, and the package.json file will be copied to the ${dist}/service/${target} directory
51+
When it is specified as "rust", only the package directory of the service is copied to ${dist}/service, and the compilation of the service needs to be manually performed by the user in advance
52+
- dist_targets: Specifies which platforms the service supports. The default is the same as the platforms supported by ood. If the Dec App is installed on a platform that is supported by OOD but not supported by service, an installation failure error will be returned
53+
- app_config: configure the run configuration of the service. You can configure a different run configuration for each platform by adding the [target_name]:[config_path] field. The default default indicates the default configuration used when there is no corresponding configuration for the platform
54+
7. web: Configure the relevant packaging and runtime configuration of the Dec App Web section, as detailed below
55+
- folder: The root directory for configuring the Dec App Web section
56+
- entry: The file name of the configurable web home page, the current configuration modification is invalid, the home page file name must be index.html
57+
8. dist: The name of the packaging temporary directory, the default is "dist". If the default value conflicts with other local directories, it can be changed to other non-conflicting directory names
58+
9. owner_config: owner configuration file
59+
10. ext_info: Other configurations unrelated to App deployment, installation, and running, generally related to App display. Details are as follows
60+
- medias: Configure the media information related to the app, which is currently used in the DecApp details page of the app store
61+
11. app_id: The app id calculated from owner id and app_name, cannot be modified by yourself. Anywhere in your code you need to use the Dec App Id, you need to use the ID shown here.
62+
63+
### service_package.cfg
64+
65+
1. id: identification
66+
2. version: version number
67+
3. install: install script
68+
4. start: start the script
69+
5. stop: stop the script
70+
6. status: run the status query script
71+
4072
## file structure
4173

4274
In the project root directory, there are 4 folders and 11 files:

doc/zh-CN/实战留言板系统/3.实现自己的留言服务.md

+32
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,38 @@ _cyfs-dapp-cli 使用注意_
3737
发布阶段:打包前端和 Service 端所需的文件资源,依赖 cyfs.config.json 的配置。
3838
安装和运行阶段:DEC Service 在 OOD 上从启动、运行到终止的各阶段,依赖 service_package.cfg 的配置。
3939

40+
### cyfs.config.json
41+
42+
1. config_version: 配置文件的版本号
43+
2. app_name: 在 `cyfs create -n` 中输入的名字,也是该 app 的名字。同一个 owner 的 app 名字不能相同。支持中文等非 ASCII 字符,这个名字会显示在应用商店和 App 管理界面上
44+
3. version: 表示 App 的`当前版本`,当执行 cyfs deploy 时,会打包并部署 App 的当前版本,部署后,会将该版本的第三位自动加一,作为新的当前版本
45+
4. description:App 描述,每次部署时,此处填写的描述文字会更新到 App 对象中,在应用商店上显示。
46+
5. icon: App 图标,只支持 cyfs 链接。每次部署时更新,在应用商店和 App 管理界面上展示
47+
6. service:配置 Dec App Service 相关打包和运行配置,详情下述
48+
- pack: 指示打包 Service 时,需要打包哪些目录
49+
- type: 指定 service 的类型,目前支持"node"和"rust"两种
50+
当指定为"node"时,会将 service 的打包目录,cyfs 目录,package.json 文件一起拷贝到${dist}/service/${target}目录下
51+
当指定为"rust"时,只将 service 的打包目录拷贝到${dist}/service 下,service 的编译等工作需用户事先手动执行
52+
- dist_targets:指定 service 支持哪些平台,默认和 ood 支持的平台一致。如果在 OOD 支持,但 service 不支持的平台上安装该 Dec App,会返回安装失败错误
53+
- app_config: 配置 service 的运行配置。可以通过添加[target_name]:[config_path]字段的形式,给每个平台配置不同的运行配置。默认的 default 表示当没有该平台对应配置时,使用的默认配置
54+
7. web: 配置 Dec App Web 部分的相关打包和运行配置,详情下述
55+
- folder: 配置 Dec App Web 部分的根目录
56+
- entry: 可配置 Web 首页的文件名,当前该配置修改无效,首页文件名必须为 index.html
57+
8. dist: 打包临时目录的名字,默认为"dist"。如果该默认值与其他本地目录冲突,可以修改为其他不冲突的目录名
58+
9. owner_config: owner 配置文件
59+
10. ext_info:与 App 部署,安装,运行无关的其他配置,一般与 App 的展示有关。详情下述
60+
- medias: 配置 App 相关的媒体信息,目前应用商店的 DecApp 详情页会使用该信息
61+
11. app_id:由 owner id 和 app_name 计算得来的 app id,不能自行修改。在代码中任何需要使用 Dec App Id 的地方,需要用这里展示的 ID。
62+
63+
### service_package.cfg
64+
65+
1. id: 标识
66+
2. version: 版本号
67+
3. install:安装脚本
68+
4. start:启动脚本
69+
5. stop:停止脚本
70+
6. status:运行状态查询脚本
71+
4072
## 文件结构
4173

4274
在项目根目录下,有 4 个文件夹及 11 个文件:

0 commit comments

Comments
 (0)