Zion Node API

Fred Hampton b683da3140 Update 'README.md' 1 week ago
README.md Update 'README.md' 1 week ago



The API is to be used by ZION CLI, ZION Wallet and other external applications to manage ZION nodes and to invoke ZION functions.

Zion Market API

GetPrices(SlotSpec) []Orders Searches for BID and ASK orders in Marketplace for Virtual Order Book GetAvailable(SlotSpec) Integer Counts local resources at Hub, that fit Virtual Order Book

ExecuteOrder(Order, auto Bool) OrderInfo Place and execute order. Auto flags if node should cancel or reexecute order automatically. CancelOrder(OrderId) OrderInfo Cancel order GetOrders() []OrderInfo List my active orders GetOrderInfo(OrderId) OrderInfo Get order details

Zion Deal API

GetDeals() []DealInfo List node's deals GetDealInfo(DealId) DealInfo Get deal details FinishDeal(DealId, DealResult) DealInfo Finish deal event

DealToStart(DealInfo) Emitted when the deal is approved event DealToStop(DealInfo) Emitted when it's time to finish deal

Zion Task API

StartTask(TaskSpec) TaskInfo Execute task StopTask(TaskId) TaskInfo Stop the task GetTasks(Task) []TaskInfo List local tasks GetTaskInfo(TaskId)

TaskInfo Get task detail GetTaskLogs(TaskId) TaskLogs Get task logs event TaskStopped(TaskInfo) Emitted when the task is stopped

Zion Hub management API

GetWorkers() []Worker List Hub's available workers RegisterWorker(Hash) Worker Register new worker UnregisterWorker(Hash) Unregister worker UpdateWorkerProps(WorkerId, ResProps) Worker Set worker resource properties GetWorks() []WorkInfo List Hub's works (allocated tasks) GetWorkInfo(WorkId) WorkInfo Get Work detail

Zion Internal ZION API

Marketplace API AAA: The calling node must prove Blockchain Id. GetOrders(VobSpec) []Order Get current orders in VOB PlaceOrder(Order) Place new order CancelOrder(OrderId) Cancel order CheckOrder(OrderId) Check if order was published

Zion Locator API

Resolve(hubId Hash) []ipaddr Resolves Hub Blockchain Id to Ip addresses Publish(hubId Hash, []ipaddr) Publish Hub ip addresses

Zion Hub API

AAA: The calling node must prove Blockchain Id. ProposeDeal(Deal) bool Propose a deal to Hub. Result is true if accepted StartWork(DealId, TaskSpec) WorkInfo Start work for selected deal StopWork(WorkInfoId) WorkInfo Stop work GetWorkInfo(WorkInfo) WorkInfo Get work status GetLogs(WorkInfoId) []LogEntries Get log entries Register(Worker) Worker registers at Hub Unregister(WorkerId) Worker disconnects SetWorkerProps(WorkerId, ResProps) Set worker resource properties

Zion Worker API

AAA: The calling node must prove Blockchain Id. StartWork(TaskSpec) ContainerId Start work for selected deal StopWork(ContainerId) Stop work GetWorkInfo(ContainerId) String Get work status GetLogs(ContainerId) []LogEntries Get log entries

Zion API Diagram