Skip to content

Commit

Permalink
Merge branch 'development_fixTodo_explainFormats' of github.com:three…
Browse files Browse the repository at this point in the history
…foldtech/3bot into development_integration
  • Loading branch information
0oM4R committed Sep 12, 2023
2 parents e4a690b + a2a780c commit ac7ad9c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion v2go2tgrid/tfgrid/deploy_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn test_deploy_deployment() {
}
node_id := u32(14)
twin_id := u32(49)
node_twin_id := u32(22) // TODO: need to get this from chain
node_twin_id := u32(22)

mut network := Znet{
ip_range: '10.1.0.0/16'
Expand Down
8 changes: 4 additions & 4 deletions v2go2tgrid/tfgrid/zlogs.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ module tfgrid
import json

pub struct ZLogs {
zmachine string //TODO: format of string
output string //TODO: format of string
zmachine string // zmachine name to stream logs of
output string // the `target` location to stream the logs to, it must be a redis or web-socket url
}

pub fn (z ZLogs) challenge() string {
mut output := ''
output += z.zmachine
output += z.output
output += z.zmachine
output += z.output

return output
}
Expand Down
8 changes: 4 additions & 4 deletions v2go2tgrid/tfgrid/zmachine.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Zmachine {
pub mut:
flist string // if full url means custom flist meant for containers, if just name should be an official vm
network ZmachineNetwork
size u8 //TODO: what does it mean, u8?
size u64 // size of the rootfs disk in bytes
compute_capacity ComputeCapacity
mounts []Mount
entrypoint string // how to invoke that in a vm?
Expand All @@ -24,8 +24,8 @@ pub mut:

pub struct ZNetworkInterface {
pub mut:
network string //TODO: what is format
ip string //TODO: what is format
network string // Network name (znet name) to join
ip string // IP of the zmachine on this network must be a valid Ip in the selected network
}

pub fn (mut n ZmachineNetwork) challenge() string {
Expand All @@ -43,7 +43,7 @@ pub fn (mut n ZmachineNetwork) challenge() string {
pub struct Mount {
pub mut:
name string
mountpoint string //TODO: what is format
mountpoint string // the path to mount the disk into e.g. '/disk1'
}

pub fn (mut m Mount) challenge() string {
Expand Down
37 changes: 20 additions & 17 deletions v2go2tgrid/tfgrid/znet.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ pub mut:
// unique nr for each network chosen, this identified private networks as connected to a container or vm or ...
// corresponds to the 2nd number of a class B ipv4 address
// is a class C of a chosen class B
// form: e.g. 192.168.16.0/24
// needs to be a private subnet
subnet string //TODO: what is format
ip_range string //TODO: what is format, what is difference with subnet
// IPV4 subnet for this network resource
// this must be a valid subnet of the entire network ip range.
// for example 10.1.1.0/24
subnet string
// IP range of the network, must be an IPv4 /16
// for example a 10.1.0.0/16
ip_range string
// wireguard private key, curve25519
// TODO: is this in libsodium
wireguard_private_key string //TODO: what is format
// TODO: is this in libsodium
wireguard_private_key string // TODO: what is format
//>1024?
wireguard_listen_port u16
peers []Peer
Expand All @@ -37,20 +40,20 @@ pub fn (mut n Znet) challenge() string {
// is a remote wireguard client which can connect to this node
pub struct Peer {
pub mut:
// is another class C in same class B as above
subnet string //TODO: what is format
// wireguard public key, curve25519
wireguard_public_key string //TODO: what is format
//TODO: give example ipv4 and ipv6 for allowed_ips
allowed_ips []string //is ipv4 or ipv6 address from a wireguard client who connects, with netmark
// ipv4 or ipv6
subnet string // IPV4 subnet of the network resource of the peer

wireguard_public_key string // WGPublicKey of the peer (driven from its private key)
// is ipv4 or ipv6 address from a wireguard client who connects
// this should be the node's subnet and the wireguard routing ip that should start with `100.64`
// then the 2nd and 3rd part of the node's subnet
// e.g. ["10.20.2.0/24", "100.64.20.2/32"]
allowed_ips []string
// Entrypoint of the peer; ipv4 or ipv6,
// can be empty, one of the 2 need to be filled in though
endpoint string //TODO: what is format
// e.g. [2a10:b600:0:9:225:90ff:fe82:7130]:7777
endpoint string
}

// TODO: need API endpoint on ZOS to find open ports
// TODO: reservation for 1 h, after will be released again, ??? what does this mean?

pub fn (mut p Peer) challenge() string {
mut out := ''
out += p.wireguard_public_key
Expand Down

0 comments on commit ac7ad9c

Please sign in to comment.