onboarding

Last updated: 2024-09-27 10:47:21.552169 File source: link on GitLab

onboarding

Table of Contents

Specification

Description

This file explains the onboarding functionality of Device Management Service (DMS). This functionality is catered towards compute providers who wish provide their hardware resources to Nunet for running computational tasks as well as developers who are contributing to platform development.

Structure and Organisation

Here is quick overview of the contents of this directory:

  • README: Current file which is aimed towards developers who wish to modify the onboarding functionality and build on top of it.

  • handler: This is main file where the code for onboarding functionality exists.

  • addresses: This file houses functions to generate Ethereum and Cardano wallet addresses along with its private key.

  • addresses_test: This file houses functions to test the address generation functions defined in addresses.

  • available_resources: This file houses functions to get the total capacity of the machine being onboarded.

  • init: This files initializes the loggers associated with onboarding package.

Class Diagram

The class diagram for the onboarding package is shown below.

Source file

onboarding Class Diagram

Rendered from source file

!$rootUrlGitlab = "https://gitlab.com/nunet/device-management-service/-/raw/main"
!$packageRelativePath = "/dms/onboarding"
!$packageUrlGitlab = $rootUrlGitlab + $packageRelativePath
 
!include $packageUrlGitlab/specs/class_diagram.puml

Functionality

Onboard Compute Provider

  • signature: Onboard(ctx context.Context, capacity types.CapacityForNunet) (*types.Metadata, error)

  • input #1: Context object

  • input #2: types.CapacityForNunet

  • output: types.Metadata

  • output (error): Error message

Onboard function executes the onboarding process for a compute provider.

Get Metadata

  • signature: GetMetadata(ctx context.Context, capacity types.CapacityForNunet) (*types.Metadata, error)

  • input #1: Context object

  • input #2: types.CapacityForNunet

  • output: types.Metadata

  • output (error): Error message

GetMetadata function retrieves and returns the machine metadata stored by the DMS.

CreatePaymentAddress

  • signature: CreatePaymentAddress(wallet string) (*types.BlockchainAddressPrivKey, error)

  • input: Blockchain name

  • output: types.BlockchainAddressPrivKey

  • output (error): Error message

CreatePaymentAddress function creates a wallet for the user on the specified blockchain.

Onboarding status

  • signature: Status() (*types.OnboardingStatus, error)

  • input: None

  • output: types.OnboardingStatus

  • output (error): Error message

Status function returns the onboarding status of the machine along with some metadata.

Change Resource Configuration

  • signature: ResourceConfig(ctx context.Context, capacity types.CapacityForNunet) (*types.Metadata, error)

  • input #1: Context object

  • input #2: types.CapacityForNunet

  • output: types.Metadata

  • output (error): Error message

ResourceConfig changes the configuration of the resources onboarded to Nunet.

Offboard

  • signature: Offboard(ctx context.Context, force bool) error

  • input #1: Context object

  • input #2: force parameter

  • output: None

  • output (error): Error message

Offboard removes the resources onboarded to Nunet. If the force parameter is True, then offboarding process will continue even in the presence of errors.

Data Types

  • types.BlockchainAddressPrivKey: This contains public key, private key and mnenmoic associated with it. This is generated when user opts to create a payment address / wallet using the api functionality.

  • types.CapacityForNunet: This is the input provided by the compute provider user to start the onboarding process.

  • types.Metadata: This contains information about the machine stored by the DMS. It is generated as a result of the onboarding process.

  • types.Provisioned: This has total capacity of the machine onboarded by the user.

  • types.OnboardingStatus: This is returned while retrieving the onboarding status.

  • types.AvailableResources: This has the available capacity that has been onboarded to Nunet.

Testing

TBD

Proposed Functionality / Requirements

List of issues

All issues that are related to the implementation of dms package can be found below. These include any proposals for modifications to the package or new functionality needed to cover the requirements of other packages.

References

Last updated