节点配置
计算需求节点
config/config-cli.toml 文件配置说明如下:
# Blockchain used by the executor.
# Client initiate a task to the executor by the blockchain.
[blockchain]
# blockchain type, only 'xchain' supported currently
type = 'xchain'
[blockchain.xchain]
mnemonic = "助 应 讨 乳 拔 夏 弃 从 干 歌 吊 像 目 那 革 摩 姜 扣 赵 秘 扬 杜 烷 法"
contractName = "mpc3"
contractAccount = "XC1111111111111111@xuper"
chainAddress = "10.144.94.17:37104"
chainName = "xuper"
配置说明
Distributed AI的计算需求节点是直接与区块链网络交互,用户通过智能合约调用将任务发布到区块链上,因此config-cli.toml需配置合约调用所需的助记词、合约账户等;
任务执行节点
config/config.toml 文件配置说明如下:
#########################################################################
#
# [executor] defines the network features of the trusted computing server, which
# serves user clients and other servers.
#
#########################################################################
[executor]
# Define a name of the trusted computing server, for readability
# The length of the executor node name is 4-16 characters, only support lowercase letters and numbers
name = "executor1"
# The Address this server will listen on
listenAddress = ":8184"
# The endpoint can be connected by other trusted computing servers, and showed in blockchain.
# In essence, it is the same with [server].listenAddress.
# If your network mode is 'host', it is the machine's ip and the port in [server].listenAddress in before section.
publicAddress = "10.144.94.17:8184"
# PaddleFLAddress is the endpoint of the container which has a runninng environment of PaddleFL.
# Containers belong to different executors constitute a mpc network
paddleFLAddress = "paddlefl-env1:38302"
# PaddleFLRole is the role of the container in paddlefl mpc network.
paddleFLRole = 0
# The private key of the trusted computing server.
# Different key express different identity.
# Only need to choose one from 'privateKey' and 'keyPath', and if both exist, 'privateKey' takes precedence over 'keyPath'
# privateKey = "858843291fe4ed4bd2afc1120efd7315f3cae2d3f79e582f7df843ac6eb0543b"
keyPath = "./keys"
[executor.httpserver]
# Whether to start the httpserver of the executor node, default "on"
switch = "on"
# The port of this httpserver will listen on
httpPort = ":8013"
# Whether to allow cross-domain requests, the default is false, use with caution in the production environment.
allowCros = false
# The mode defines how executor nodes download the sample file during the task execution.
# The sample file download type also represents the task execution type, such as proxy-execution or self-execution.
[executor.mode]
# Supports 'Proxy' and 'Self', default 'Proxy'.
# 'Proxy' is used by the dataOwner node to authorize the sample file to the executor node for proxy execution.
# "Self" is suitable for the executor node and the dataOwner node are the same organization and execute by themselves.
type = 'Proxy'
[executor.mode.Self]
# The dataOwner node's host, used to download sample files.
host = "http://10.144.94.17:8121"
# privateKey = "14a54c188d0071bc1b161a50fe7eacb74dcd016993bb7ad0d5449f72a8780e21"
keyPath = "./ukeys"
# [mpc] defines the features of the mpc process.
[executor.mpc]
# trainTaskLimit limits the max number of executing training tasks concurrently
trainTaskLimit = 100
# predictTaskLimit limits the max number of executing predicting tasks concurrently
predictTaskLimit = 100
# Rpc request timeout
# unit: second
rpcTimeout = 3
# Maximum time that task can be executed.
# unit: second
taskLimitTime = 3600
# [storage] defines the storage used by the executor, include model storage and prediction result storage.
[executor.storage]
# Define the model storage path.
localModelStoragePath = "./models"
# Define the evaluation result storage path
localEvaluationStoragePath = "./evalus"
# Define the prediction result storage type, support XuperDB and Local, the default is local storage.
type = 'Local'
[executor.storage.XuperDB]
# The private key is the dataOwner node client private key generated by the executor.
# privateKey = "14a54c188d0071bc1b161a50fe7eacb74dcd016993bb7ad0d5449f72a8780e21"
keyPath = "./ukeys"
# The XuperDB's endpoint is dataOwner node host, used to upload and download file.
host = "http://10.144.94.17:8121"
# When storage a file, you must have a namespace in XuperDB.
# It defines which namespace in XuperDB prediction file will be stored,
# and must be created before storage.
namespace = "mpc"
# The expiration time of the files stored in XuperDB, from the moment it's stored.
# unit: hour
expiretime = 72
[executor.storage.Local]
localPredictStoragePath = "./predictions"
# Blockchain used by the executor.
# Blockchain records the computing and scheduling process of task, to enhance the credibility of the system.
[executor.blockchain]
# blockchain type, only 'xchain' supported currently
type = 'xchain'
[executor.blockchain.xchain]
mnemonic = "助 应 讨 乳 拔 夏 弃 从 干 歌 吊 像 目 那 革 摩 姜 扣 赵 秘 扬 杜 烷 法"
contractName = "mpc4"
contractAccount = "XC1111111111111111@xuper"
chainAddress = "10.144.94.17:37104"
chainName = "xuper"
#########################################################################
#
# [log] sets the log related options
#
#########################################################################
[log]
level = "debug"
path = "./logs"
配置说明
- 任务执行节点中配置了节点启动所需监听的端口、身份等信息,paddleFLAddress定义了运行神经网络算法所需的容器地址;
- executor.httpserver 定义了启动http server所需的配置,用户可以按需选择是否启动http服务,allowCros用于指定是否允许跨域请求,默认为false,正式业务环境慎用allowCros;
- executor.mode 用于指定节点的计算方式,支持代理和自主计算模式,代理模式用于数据持有节点将样本数据授权给任务执行节点进行代理计算,而自主计算模式则适用于计算节点是数据持有节点的客户端场景;
- executor.storage 定义了模型、评估结果、预测结果存储的路径,其中预测结果存储支持加密存储到去中心化存储网络;
- executor.blockchain 定义了任务执行节点操作的区块链网络配置,当前只支持Xchain网络,后续会支持Fabric;