Skip to content

Commit

Permalink
move docs from node.go to readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Dec 16, 2024
1 parent 06a9716 commit 545a44d
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions client/node.go
Original file line number Diff line number Diff line change
@@ -1,75 +1,3 @@
// Package client provides a simple RMB interface to work with the node.
//
// # Requirements
//
// 1. A msgbusd instance must be running on the node. this client uses RMB (message bus)
// to send messages to nodes, and get the repspons.
// 2. A valid ed25519 key pair. this key is used to sign deployments and MUST be the same
// key used to configure the local twin on substrate.
//
// # Simple deployment
//
// create an instance from the default rmb client.
// ```
// cl, err := rmb.Default()
//
// if err != nil {
// panic(err)
// }
//
// ```
// then create an instance of the node client
// ```
// node := client.NewNodeClient(NodeTwinID, cl)
// ```
// define your deployment object
// ```
//
// dl := gridtypes.Deployment{
// Version: Version,
// TwinID: Twin, //LocalTwin,
// // this contract id must match the one on substrate
// Workloads: []gridtypes.Workload{
// network(), // network workload definition
// zmount(), // zmount workload definition
// publicip(), // public ip definition
// zmachine(), // zmachine definition
// },
// SignatureRequirement: gridtypes.SignatureRequirement{
// WeightRequired: 1,
// Requests: []gridtypes.SignatureRequest{
// {
// TwinID: Twin,
// Weight: 1,
// },
// },
// },
// }
//
// ```
// compute hash
// ```
// hash, err := dl.ChallengeHash()
//
// if err != nil {
// panic("failed to create hash")
// }
//
// fmt.Printf("Hash: %x\n", hash)
// ```
// create the contract and ge the contract id
// then
// “
// dl.ContractID = 11 // from substrate
// ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
// defer cancel()
// err = node.DeploymentDeploy(ctx, dl)
//
// if err != nil {
// panic(err)
// }
//
// ```
package client

import (
Expand Down

0 comments on commit 545a44d

Please sign in to comment.