Documentation ¶
Index ¶
- type Actions
- type AvailableResources
- type BlockchainAddressPrivKey
- type BlockchainTxStatus
- type BootSource
- type CapacityForNunet
- type Connection
- type ContainerImages
- type DeploymentRequest
- type DeploymentRequestFlat
- type DeploymentResponse
- type DeploymentUpdate
- type DeviceResourceChange
- type DeviceResourceConfig
- type DeviceStatusChange
- type Drives
- type ElasticToken
- type FreeResources
- type Gpu
- type IP
- type KadDHTMachineUpdate
- type Libp2pInfo
- type LogBinAuth
- type MMDSConfig
- type MMDSMetadata
- type MMDSMsg
- type Machine
- type MachineConfig
- type MachineUUID
- type Machines
- type Metadatadeprecated
- type MetadataV2
- type NetworkInterfaces
- type NewDeviceOnboarded
- type NewService
- type NtxPayment
- type OnboardingStatus
- type PeerData
- type PeerInfo
- type PingResult
- type Provisioned
- type RequestTrackerdeprecated
- type ServiceCall
- type ServiceRemove
- type ServiceResourceRequirements
- type ServiceStatus
- type Services
- type VirtualMachine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableResources ¶
type AvailableResources struct { ID uint TotCpuHz int CpuNo int CpuHz float64 PriceCpu float64 Ram int PriceRam float64 Vcpu int Disk float64 PriceDisk float64 NTXPricePerMinute float64 }
AvailableResources are the amount of resources onboarded which can be used by NuNet
type BlockchainAddressPrivKey ¶
type BlockchainAddressPrivKey struct { Address string `json:"address,omitempty"` PrivateKey string `json:"private_key,omitempty"` Mnemonic string `json:"mnemonic,omitempty"` }
BlockchainAddressPrivKey holds Ethereum wallet address and private key from which the address is derived.
type BlockchainTxStatus ¶ added in v0.4.118
type BootSource ¶
type CapacityForNunet ¶
type CapacityForNunet struct { Memory int64 `json:"memory,omitempty"` CPU int64 `json:"cpu,omitempty"` NTXPricePerMinute float64 `json:"ntx_price,omitempty"` Channel string `json:"channel,omitempty"` PaymentAddress string `json:"payment_addr,omitempty"` Cardano bool `json:"cardano,omitempty"` ServerMode bool `json:"server_mode,omitempty,"` IsAvailable bool `json:"is_available"` }
CapacityForNunet is a struct required in request body for the onboarding
type Connection ¶
type ContainerImages ¶ added in v0.4.159
type DeploymentRequest ¶
type DeploymentRequest struct { RequesterWalletAddress string `json:"address_user"` // service provider wallet address MaxNtx int `json:"max_ntx"` Blockchain string `json:"blockchain"` TxHash string `json:"tx_hash"` ServiceType string `json:"service_type"` Timestamp time.Time `json:"timestamp"` MetadataHash string `json:"metadata_hash"` WithdrawHash string `json:"withdraw_hash"` RefundHash string `json:"refund_hash"` Distribute_50Hash string `json:"distribute_50_hash"` Distribute_75Hash string `json:"distribute_75_hash"` Params struct { ImageID string `json:"image_id"` ModelURL string `json:"model_url"` ResumeJob struct { Resume bool `json:"resume"` ProgressFile string `json:"progress_file"` // file path } `json:"resume_job"` Packages []string `json:"packages"` RemoteNodeID string `json:"node_id"` // NodeID of compute provider (machine to deploy the job on) RemotePublicKey string `json:"public_key"` // Public key of compute provider LocalNodeID string `json:"local_node_id"` // NodeID of service provider (machine triggering the job) LocalPublicKey string `json:"local_public_key"` // Public key of service provider MachineType string `json:"machine_type"` } `json:"params"` Constraints struct { Complexity string `json:"complexity"` CPU int `json:"cpu"` RAM int `json:"ram"` Vram int `json:"vram"` Power int `json:"power"` Time int `json:"time"` } `json:"constraints"` TraceInfo struct { TraceID string `json:"trace_id"` SpanID string `json:"span_id"` TraceFlags string `json:"trace_flags"` TraceStates string `json:"trace_state"` } `json:"traceinfo"` }
type DeploymentRequestFlat ¶
type DeploymentResponse ¶
type DeploymentUpdate ¶
type DeviceResourceChange ¶
type DeviceResourceChange struct { PeerID string ChangedAttributeAndValue struct { CPU float32 RAM float32 Network float32 DedicatedTime float32 } Timestamp float32 }
DeviceResourceChange defines the schema of the data to be sent to stats db when a device resource gets changed
type DeviceResourceConfig ¶
type DeviceResourceConfig struct { PeerID string ChangedAttributeAndValue struct { CPU float32 RAM float32 Network float32 DedicatedTime float32 } Timestamp float32 }
DeviceResourceConfig defines the schema of the data to be sent to stats db when a device resource config gets changed
type DeviceStatusChange ¶
DeviceStatusChange defines the schema of the data to be sent to stats db when a device status gets changed
type ElasticToken ¶ added in v0.4.118
type FreeResources ¶
type FreeResources struct { ID uint `json:"id"` TotCpuHz int `json:"tot_cpu_hz"` PriceCpu float64 `json:"price_cpu"` Ram int `json:"ram"` PriceRam float64 `json:"price_ram"` Vcpu int `json:"vcpu"` Disk float64 `json:"disk"` PriceDisk float64 `json:"price_disk"` NTXPricePerMinute float64 `json:"ntx_price"` }
FreeResources are the resources free to be used by new services, plugins and any other processes started by DMS. It's basically the subtraction between AvailableResources and the amount of resources already used by DMS and its processes (mostly services)
type KadDHTMachineUpdate ¶
machine info for KAD-DHT
type Libp2pInfo ¶
type LogBinAuth ¶ added in v0.4.118
type MMDSConfig ¶
type MMDSConfig struct {
NetworkInterface []string `json:"network_interfaces"`
}
type MMDSMetadata ¶
type MMDSMsg ¶
type MMDSMsg struct { Latest struct { Metadata struct { MMDSMetadata } `json:"meta-data"` } `json:"latest"` }
type MachineConfig ¶
type MachineUUID ¶
type MachineUUID struct {
UUID string `json:"uuid"`
}
type Metadata
deprecated
type Metadata struct { Name string `json:"name,omitempty"` Resource struct { UpdateTimestamp int `json:"update_timestamp,omitempty"` RAMMax int `json:"ram_max,omitempty"` TotalCore int `json:"total_core,omitempty"` CPUMax float32 `json:"cpu_max,omitempty"` CPUUsage float32 `json:"cpu_usage,omitempty"` } `json:"resource,omitempty"` Available struct { UpdateTimestamp int `json:"update_timestamp,omitempty"` RAM int `json:"ram,omitempty"` } `json:"available,omitempty"` Reserved struct { CPU int `json:"cpu,omitempty"` Memory int `json:"memory,omitempty"` } `json:"reserved,omitempty"` Network string `json:"network,omitempty"` PublicKey string `json:"public_key,omitempty"` }
Metadata has an older version of schema for metadata.json.
Deprecated: This Metadata was used in nunet-adapter time. Use MetadataV2 instead.
type MetadataV2 ¶
type MetadataV2 struct { Name string `json:"name,omitempty"` UpdateTimestamp int64 `json:"update_timestamp,omitempty"` Resource struct { MemoryMax int64 `json:"memory_max,omitempty"` TotalCore int64 `json:"total_core,omitempty"` CPUMax int64 `json:"cpu_max,omitempty"` } `json:"resource,omitempty"` Available struct { CPU int64 `json:"cpu,omitempty"` Memory int64 `json:"memory,omitempty"` } `json:"available,omitempty"` Reserved struct { CPU int64 `json:"cpu,omitempty"` Memory int64 `json:"memory,omitempty"` } `json:"reserved,omitempty"` Network string `json:"network,omitempty"` PublicKey string `json:"public_key,omitempty"` NodeID string `json:"node_id,omitempty"` AllowCardano bool `json:"allow_cardano,omitempty"` GpuInfo []Gpu `json:"gpu_info,omitempty"` Dashboard string `json:"dashboard,omitempty"` NTXPricePerMinute float64 `json:"ntx_price,omitempty"` }
MetadataV2 has a newer version of schema for metadata.json.
type NetworkInterfaces ¶
type NewDeviceOnboarded ¶
type NewDeviceOnboarded struct { PeerID string CPU float32 RAM float32 Network float32 DedicatedTime float32 Timestamp float32 }
NewDeviceOnboarded defines the schema of the data to be sent to stats db when a new device gets onboarded
type NewService ¶
type NewService struct { ServiceID string ServiceName string ServiceDescription string Timestamp float32 }
NewService defines the schema of the data to be sent to stats db when a new service gets registered in the platform
type NtxPayment ¶
type NtxPayment struct { CallID float32 ServiceID string AmountOfNtx int32 PeerID string SuccessFailStatus string Timestamp float32 }
NtxPayment defines the schema of the data to be sent to stats db when a payment is made to device for the completion of service.
type OnboardingStatus ¶ added in v0.4.118
type PeerData ¶
type PeerData struct { PeerID string `json:"peer_id"` IsAvailable bool `json:"is_available"` HasGpu bool `json:"has_gpu"` AllowCardano bool `json:"allow_cardano"` GpuInfo []Gpu `json:"gpu_info"` TokenomicsAddress string `json:"tokenomics_addrs"` TokenomicsBlockchain string `json:"tokenomics_blockchain"` AvailableResources FreeResources `json:"available_resources"` Services []Services `json:"services"` Timestamp int64 `json:"timestamp,omitempty"` }
type Provisioned ¶
type Provisioned struct { CPU float64 `json:"cpu,omitempty"` Memory uint64 `json:"memory,omitempty"` NumCores uint64 `json:"total_cores,omitempty"` }
Provisioned struct holds data about how much total resource host machine is equipped with
type RequestTracker
deprecated
type RequestTracker struct { ID uint ServiceType string NodeID string CallID int64 Status string RequestID string MaxTokens int }
RequestTracker defines the schema of the data to be saved in db for tracking the status of the deployement request
Deprecated: Should be removed soon since its use has run out when statsdb was deprecated.
type ServiceCall ¶
type ServiceCall struct { CallID float32 PeerIDOfServiceHost string ServiceID string CPUUsed float32 MaxRAM float32 MemoryUsed float32 NetworkBwUsed float32 TimeTaken float32 Status string AmountOfNtx int32 Timestamp float32 }
ServiceCall defines the schema of the data to be sent to stats db when a host machine accepts a deployement request
type ServiceRemove ¶
ServiceRemove defines the schema of the data to be sent to stats db when a new service gets removed from the platform
type ServiceStatus ¶
type ServiceStatus struct { CallID float32 PeerIDOfServiceHost string ServiceID string Status string Timestamp float32 }
ServiceStatus defines the schema of update the status of service to stats db of the job being executed on host machine
type Services ¶
type Services struct { gorm.Model TxHash string TransactionType string // transaction type can be running, done, withdraw, refund and distribute JobStatus string // whether job is running or exited; one of these 'running', 'finished without errors', 'finished with errors' JobDuration int64 // job duration in minutes EstimatedJobDuration int64 // job duration in minutes ServiceName string ContainerID string ResourceRequirements int ImageID string LogURL string LastLogFetch time.Time ServiceProviderAddr string ComputeProviderAddr string MetadataHash string WithdrawHash string RefundHash string // saving hashes for call the `/request-reward` endpoint by SPD Distribute_50Hash string Distribute_75Hash string SignatureDatum string MessageHashDatum string Datum string SignatureAction string // saving signatures for removing redundancy of calling Oracle MessageHashAction string Action string }
type VirtualMachine ¶
type VirtualMachine struct { ID uint `json:"id"` SocketFile string `json:"socket_file"` BootSource string `json:"boot_source"` Filesystem string `json:"filesystem"` VCPUCount int `json:"vcpu_count"` MemSizeMib int `json:"mem_size_mib"` TapDevice string `json:"tap_device"` State string `json:"state"` }