Documentation ¶
Index ¶
- type Blockchain
- type Client
- func (c *Client) GetExecutorNodeByID(pubkeyStr string) (node blockchain.ExecutorNode, err error)
- func (c *Client) GetExecutorNodeByName(name string) (node blockchain.ExecutorNode, err error)
- func (c *Client) GetFileAuthByID(id string) (fileAuth xdbchain.FileAuthApplication, err error)
- func (c *Client) GetPredictResult(privateKey, taskID, output string) (err error)
- func (c *Client) GetTaskById(id string) (t blockchain.FLTask, err error)
- func (c *Client) ListExecutorNodes() (nodes blockchain.ExecutorNodes, err error)
- func (c *Client) ListFileAuthApplications(opt *xdbchain.ListFileAuthOptions) (fileAuths xdbchain.FileAuthApplications, err error)
- func (c *Client) ListTask(rPubkeyStr, ePubkeyStr, status string, start, end, limit int64) (tasks blockchain.FLTasks, err error)
- func (c *Client) Publish(opt PublishOptions) (taskId string, err error)
- func (c *Client) StartTask(privateKey, id string) (err error)
- type PublishOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain interface { // executor operation GetExecutorNodeByID(id string) (blockchain.ExecutorNode, error) GetExecutorNodeByName(name string) (blockchain.ExecutorNode, error) ListExecutorNodes() (blockchain.ExecutorNodes, error) // task operation ListTask(opt *blockchain.ListFLTaskOptions) (blockchain.FLTasks, error) PublishTask(opt *blockchain.PublishFLTaskOptions) error StartTask(opt *blockchain.StartFLTaskOptions) error GetTaskById(id string) (blockchain.FLTask, error) // file operation GetFileByID(id string) (xdbchain.File, error) ListFileAuthApplications(opt *xdbchain.ListFileAuthOptions) (xdbchain.FileAuthApplications, error) GetAuthApplicationByID(authID string) (xdbchain.FileAuthApplication, error) }
Blockchain defines some contract methods
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client requester client, used to publish task and retrieve task result
func GetRequestClient ¶
GetRequestClient returns client for Requester by blockchain configuration
func (*Client) GetExecutorNodeByID ¶
func (c *Client) GetExecutorNodeByID(pubkeyStr string) (node blockchain.ExecutorNode, err error)
GetExecutorNodeByID get the executor node by nodeID, which is the public key of the node
func (*Client) GetExecutorNodeByName ¶
func (c *Client) GetExecutorNodeByName(name string) (node blockchain.ExecutorNode, err error)
GetExecutorNodeByName get executor node by nodeName
func (*Client) GetFileAuthByID ¶
func (c *Client) GetFileAuthByID(id string) (fileAuth xdbchain.FileAuthApplication, err error)
GetFileAuthByID get file authorization application detail by authID
func (*Client) GetPredictResult ¶
GetPredictResult gets predict result by taskID output is the path to save predict result
func (*Client) GetTaskById ¶
func (c *Client) GetTaskById(id string) (t blockchain.FLTask, err error)
GetTaskById gets task by taskID
func (*Client) ListExecutorNodes ¶
func (c *Client) ListExecutorNodes() (nodes blockchain.ExecutorNodes, err error)
ListExecutorNodes list all executor nodes
func (*Client) ListFileAuthApplications ¶
func (c *Client) ListFileAuthApplications(opt *xdbchain.ListFileAuthOptions) (fileAuths xdbchain.FileAuthApplications, err error)
ListFileAuthApplications query the list of authorization applications
func (*Client) ListTask ¶
func (c *Client) ListTask(rPubkeyStr, ePubkeyStr, status string, start, end, limit int64) (tasks blockchain.FLTasks, err error)
ListTask lists tasks by requester or executor's public key hex string support listing tasks a requester published or tasks an executor involved status is task status to search only task published after "start" before "end" will be listed limit is the maximum number of tasks to response
type PublishOptions ¶
type PublishOptions struct { PrivateKey string // requester private key Files string // file list with "," as delimiter, used for training or prediction Executors string // executor nodes with "," as delimiter, used for executing a training or prediction task TaskName string // task name, not unique for one requester AlgoParam pbCom.TaskParams // parameters required for training or prediction PSILabels string // ID feature name list with "," as delimiter, used for PSI Description string // task description }
PublishOptions define parameters used to publishing a task