It's easy to develop new privacy operators via EigenCC Framework.
- Define the service. A service could be a collection of methods handling the private object on Blockchain. A built-on Echo service here is provided:
pub struct EchoWorker {
worker_id: u32,
func_name: String,
input: Option<EchoWorkerInput>,
}
worker_id
must be unique globally, an integer beginning at 0, increased by service.func_name
is the service name, and also the second argument of eigen_create_taskinput
: arguments of service;
-
Define the service input An input is a structure containing the arguments of each service call. the EchoWorkerInput recepts a
String
value. Usually, we need preprocessing for the input before being fed into service execution. -
Define service side logic All the handling logic should be defined in the
execute
function:
fn execute(&mut self, _context: WorkerContext) -> Result<String>
- Register the service
Expose the service to EigenCC framework by adding
mod service_source_file_name;
pub use service_source_file_name::service_struct_name;
to mod.rs
- Define client side logic
Call the service by c or rust SDK.