Documentation ¶
Index ¶
- func AcceptFileTransferHandler(c *gin.Context)
- func ChangeDeviceStatusHandler(c *gin.Context)
- func CleanupPeerHandler(c *gin.Context)
- func ClearChatHandler(c *gin.Context)
- func ClearFileTransferRequestsHandler(c *gin.Context)
- func CreatePaymentAddressHandler(c *gin.Context)
- func DefaultConfig() cors.Config
- func DefaultDepReqPeerHandler(c *gin.Context)
- func DeploymentRequestHandler(c *gin.Context)
- func DeviceStatusHandler(c *gin.Context)
- func DumpDHTHandler(c *gin.Context)
- func DumpKademliaDHTHandler(c *gin.Context)
- func GetFreeResourcesHandler(c *gin.Context)
- func GetJobTxHashesHandler(c *gin.Context)
- func GetMetadataHandler(c *gin.Context)
- func JoinChatHandler(c *gin.Context)
- func ListChatHandler(c *gin.Context)
- func ListCheckpointHandler(c *gin.Context)
- func ListDHTPeersHandler(c *gin.Context)
- func ListFileTransferRequestsHandler(c *gin.Context)
- func ListKadDHTPeersHandler(c *gin.Context)
- func ListPeersHandler(c *gin.Context)
- func ManualDHTUpdateHandler(c *gin.Context)
- func OffboardHandler(c *gin.Context)
- func OldPingPeerHandler(c *gin.Context)
- func OnboardHandler(c *gin.Context)
- func OnboardStatusHandler(c *gin.Context)
- func PingPeerHandler(c *gin.Context)
- func ProvisionedCapacityHandler(c *gin.Context)
- func RequestRewardHandler(c *gin.Context)
- func RequestServiceHandler(c *gin.Context)
- func ResourceConfigHandler(c *gin.Context)
- func SelfPeerInfoHandler(c *gin.Context)
- func SendFileTransferHandler(c *gin.Context)
- func SendTxStatusHandler(c *gin.Context)
- func SetupRouter() *gin.Engine
- func StartChatHandler(c *gin.Context)
- func StartCustomHandler(c *gin.Context)
- func StartDefaultHandler(c *gin.Context)
- func UpdateTxStatusHandler(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptFileTransferHandler ¶
AcceptFileTransferHandler godoc @Summary Accept incoming file transfer @Description Accept an incoming file transfer. Incoming file transfer stream ID is a required parameter. @Tags file @Success 200 @Router /peers/file/accept [get]
func ChangeDeviceStatusHandler ¶
ChangeDeviceStatusHandler godoc
@Summary Change device status between online/offline @Description Change device status to online (able to receive jobs) or offline (unable to receive jobs). @Tags device @Produce json @Success 200 {string} string @Router /device/status [post]
func ClearChatHandler ¶
ClearChatHandler godoc
@Summary Clear chat requests @Description Clear chat request streams from peers @Tags chat @Produce json @Success 200 @Router /peers/chat/clear [get]
func ClearFileTransferRequestsHandler ¶
ClearFileTransferRequestsHandler godoc @Summary Clear file transfer requests @Description Clear file transfer request streams from peers @Tags file @Produce json @Success 200 @Router /peers/file/clear [get]
func CreatePaymentAddressHandler ¶
CreatePaymentAddressHandler godoc
@Summary Create a new payment address. @Description Create a payment address from public key. Return payment address and private key. @Tags onboarding @Produce json @Success 200 {object} models.BlockchainAddressPrivKey @Router /onboarding/address/new [get]
func DefaultConfig ¶
DefaultConfig returns a generic default configuration mapped to localhost.
func DefaultDepReqPeerHandler ¶
DefaultDepReqPeerHandler godoc
@Summary Manage default deplyment request receiver peer @Description Set peer as the default receipient of deployment requests by setting the peerID parameter on GET request. @Description Show peer set as default deployment request receiver by sending a GET request without any parameters. @Description Remove default deployment request receiver by sending a GET request with peerID parameter set to '0'. @Tags peers @Success 200 @Router /peers/depreq [get]
func DeploymentRequestHandler ¶
DeploymentRequestHandler godoc
@Summary Websocket endpoint responsible for sending deployment request and receiving deployment response. @Description Loads deployment request from the DB after a successful blockchain transaction has been made and passes it to compute provider. @Tags run @Success 200 {string} string @Router /run/deploy [get]
func DeviceStatusHandler ¶
DeviceStatusHandler godoc
@Summary Retrieve device status @Description Retrieve device status whether paused/offline (unable to receive job deployments) or online @Tags device @Produce json @Success 200 {string} string @Router /device/status [get]
func DumpDHTHandler ¶
DumpDHTHandler godoc
@Summary Return a dump of the dht @Description Returns entire DHT content @Tags p2p @Produce json @Success 200 {string} string @Router /dht [get]
func GetFreeResourcesHandler ¶
GetFreeResourcesHandler godoc
@Summary Returns the amount of free resources available @Description Checks and returns the amount of free resources available @Tags telemetry @Produce json @Success 200 @Router /telemetry/free [get]
func GetJobTxHashesHandler ¶
GetJobTxHashesHandler godoc
@Summary Get list of TxHashes for jobs done. @Description Get list of TxHashes along with the date and time of jobs done. @Tags run @Success 200 {object} []tokenomics.TxHashResp @Router /transactions [get]
func GetMetadataHandler ¶
GetMetadataHandler godoc
@Summary Get current device info. @Description Responds with metadata of current provideer @Tags onboarding @Produce json @Success 200 {object} models.Metadata @Router /onboarding/metadata [get]
func JoinChatHandler ¶
JoinChatHandler godoc
@Summary Join chat with a peer @Description Join a chat session started by a peer @Tags chat @Success 200 @Router /peers/chat/join [get]
func ListChatHandler ¶
ListChatHandler godoc
@Summary List chat requests @Description Get a list of chat requests from peers @Tags chat @Produce json @Success 200 @Router /peers/chat [get]
func ListCheckpointHandler ¶
ListCheckpointHandler godoc
@Summary Returns a list of absolute path to checkpoint files. @Description ListCheckpointHandler scans data_dir/received_checkpoints and lists all the tar.gz files which can be used to resume a job. Returns a list of objects with absolute path and last modified date. @Tags run @Success 200 {object} []libp2p.checkpoint @Router /run/checkpoints [get]
func ListDHTPeersHandler ¶
ListDHTPeersHandler godoc
@Summary Return list of peers which have sent a dht update @Description Gets a list of peers the libp2p node has received a dht update from @Tags p2p @Produce json @Success 200 {string} string @Router /peers/dht [get]
func ListFileTransferRequestsHandler ¶
ListFileTransferRequestsHandler godoc @Summary List file transfer requests @Description Get a list of file transfer requests from peers @Tags file @Produce json @Success 200 @Router /peers/file [get]
func ListKadDHTPeersHandler ¶
ListKadDHTPeersHandler godoc
@Summary Return list of peers which have sent a dht update @Description Gets a list of peers the libp2p node has received a dht update from @Tags p2p @Produce json @Success 200 {string} string @Router /peers/kad-dht [get]
func ListPeersHandler ¶
ListPeersHandler godoc
@Summary Return list of peers currently connected to @Description Gets a list of peers the libp2p node can see within the network and return a list of peers @Tags p2p @Produce json @Success 200 {string} string @Router /peers [get]
func OffboardHandler ¶
OffboardHandler godoc
@Summary Runs the offboarding process. @Description Offboard runs offboarding process to remove the machine from the NuNet network. @Tags onboarding @Produce json @Success 200 {string} string "device successfully offboarded" @Router /onboarding/offboard [post]
func OnboardHandler ¶
OnboardHandler godoc
@Summary Runs the onboarding process. @Description Onboard runs onboarding script given the amount of resources to onboard. @Tags onboarding @Produce json @Success 200 {object} models.Metadata @Router /onboarding/onboard [post]
func OnboardStatusHandler ¶
OnboardStatusHandler godoc
@Summary Onboarding status and other metadata. @Description Returns json with 5 parameters: onboarded, error, machine_uuid, metadata_path, database_path. @Description `onboarded` is true if the device is onboarded, false otherwise. @Description `error` is the error message if any related to onboarding status check @Description `machine_uuid` is the UUID of the machine @Description `metadata_path` is the path to metadataV2.json only if it exists @Description `database_path` is the path to nunet.db only if it exists @Tags onboarding @Produce json @Success 200 {object} models.OnboardingStatus @Router /onboarding/status [get]
func ProvisionedCapacityHandler ¶
ProvisionedCapacityHandler godoc
@Summary Returns provisioned capacity on host. @Description Get total memory capacity in MB and CPU capacity in MHz. @Tags onboarding @Produce json @Success 200 {object} models.Provisioned @Router /onboarding/provisioned [get]
func RequestRewardHandler ¶
RequestRewardHandler godoc
@Summary Get NTX tokens for work done. @Description HandleRequestReward takes request from the compute provider, talks with Oracle and releases tokens if conditions are met. @Tags run @Param body body tokenomics.ClaimCardanoTokenBody true "Claim Reward Body" @Success 200 {object} tokenomics.rewardRespToCPD @Router /transactions/request-reward [post]
func RequestServiceHandler ¶
RequestServiceHandler godoc
@Summary Informs parameters related to blockchain to request to run a service on NuNet @Description RequestServiceHandler searches the DHT for non-busy, available devices with appropriate metadata. Then informs parameters related to blockchain to request to run a service on NuNet. @Tags run @Param deployment_request body models.DeploymentRequest true "Deployment Request" @Success 200 {object} machines.fundingRespToSPD @Router /run/request-service [post]
func ResourceConfigHandler ¶
ResourceConfigHandler godoc
@Summary changes the amount of resources of onboarded device . @Tags onboarding @Produce json @Success 200 {object} models.Metadata @Router /onboarding/resource-config [post]
func SelfPeerInfoHandler ¶
SelfPeerInfoHandler godoc
@Summary Return self peer info @Description Gets self peer info of libp2p node @Tags p2p @Produce json @Success 200 {string} string @Router /peers/self [get]
func SendFileTransferHandler ¶
SendFileTransferHandler godoc @Summary Send a file to a peer @Description Initiate file transfer to a peer. filePath and peerID are required arguments. @Tags file @Success 200 @Router /peers/file/send [get]
func SendTxStatusHandler ¶
SendTxStatusHandler godoc
@Summary Sends blockchain status of contract creation. @Description HandleSendStatus is used by webapps to send status of blockchain activities. Such token withdrawl. @Tags run @Param body body models.BlockchainTxStatus true "Blockchain Transaction Status Body" @Success 200 {string} string @Router /transactions/send-status [post]
func SetupRouter ¶
func StartChatHandler ¶
StartChatHandler godoc
@Summary Start chat with a peer @Description Start chat session with a peer @Tags chat @Success 200 @Router /peers/chat/start [get]
func StartCustomHandler ¶
StartCustomHandler godoc @Summary Start a VM with custom configuration. @Description This endpoint is an abstraction of all primitive endpoints. When invokend, it calls all primitive endpoints in a sequence. @Tags vm @Produce json @Success 200 @Router /vm/start-custom [post]
func StartDefaultHandler ¶
StartDefaultHandler godoc
@Summary Start a VM with default configuration. @Description Everything except kernel files and filesystem file will be set by DMS itself. @Tags vm @Produce json @Success 200 @Router /vm/start-default [post]
func UpdateTxStatusHandler ¶
UpdateTxStatusHandler godoc
@Summary Updates blockchain transaction status of DB. @Description HandleUpdateStatus is used by webapps to update status of saved transactions with fetching info from blockchain using koios REST API. @Tags tx @Param body body tokenomics.UpdateTxStatusBody true "Transaction Status Update Body" @Success 200 {string} string @Router /transactions/update-status [post]
Types ¶
This section is empty.