Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct { DID did.DID `json:"did"` // DID ResourceConfiguration types.Resources `json:"resource_configuration"` PerformanceMetrics []PerformanceMetric `json:"performance_metrics"` ContractValue float64 `json:"contract_value"` Payment PaymentDetails `json:"payment"` Duration *DurationDetails `json:"duration,omitempty"` TerminationOption *TerminationOption `json:"termination_option,omitempty"` Penalties []PenaltyClause `json:"penalties"` SettlementProvider string `json:"settlement_provider"` AcceptedProofOfWork ProofOfWork `json:"accepted_proof_of_work"` DisputeResolution string `json:"dispute_resolution"` ContractHost string `json:"contract_host"` ContractLogic []byte `json:"contract_logic"` ExtraData []byte `json:"extra_data"` // arbitrary data that we can add to the contract }
Contract represents the structure for P2P agreements.
type DurationDetails ¶
type DurationDetails struct { StartDate time.Time `json:"start_date"` EndDate time.Time `json:"end_date"` }
DurationDetails defines the duration for hire.
type PaymentDetails ¶
type PaymentDetails struct { Type string `json:"type"` Amount float64 `json:"amount"` Frequency *time.Duration `json:"frequency,omitempty"` // e.g., 30 days for recurring NumberOfPayments *int `json:"number_of_payments,omitempty"` // Optional, for recurring payments }
PaymentDetails contains payment type and schedule details.
type PenaltyClause ¶
type PenaltyClause struct { Condition string `json:"condition"` // e.g., "Uptime < 99.9%" Penalty float64 `json:"penalty"` }
PenaltyClause defines the penalty for non-performance.
type PerformanceMetric ¶
type PerformanceMetric struct { Name string `json:"name"` TargetValue float64 `json:"targetValue"` Unit string `json:"unit"` }
PerformanceMetric represents a single performance metric and target value.
type ProofOfWork ¶
ProofOfWork represents the acceptable proof of work for settlement.
type TerminationOption ¶
type TerminationOption struct { Allowed bool `json:"allowed"` NoticePeriod string `json:"notice_period"` // e.g., "30 days" }
TerminationOption specifies termination rules for long-running jobs.
Click to show internal directories.
Click to hide internal directories.