Skip to main content

Nosana Nodes

About 6 min

Nosana Nodes

The Nosana Nodes program allows users to register machine in the Nosana Network.

Program Information

InfoDescription
TypeSolana Programopen in new window
Source CodeGitHubopen in new window
Build StatusAnchor Verifiedopen in new window
Accounts2
Instructions3
Types2
Errors7
Domainnosana-nodes.sol
AddressnosNeZR64wiEhQc5j251bsP4WqDabT6hmz4PHyoHLGDopen in new window

Instructions

A number of 3 instruction are defined in the Nosana Nodes program.

To load the program with Anchoropen in new window.

const programId = new PublicKey('nosNeZR64wiEhQc5j251bsP4WqDabT6hmz4PHyoHLGD');
const idl = await Program.fetchIdl(programId.toString());
const program = new Program(idl, programId);
Register

Register

Register a node to the Nosana Network

Account Info

The following 4 account addresses should be provided when invoking this instruction.

NameTypeDescription
nodeThe node that runs this job.
payerThe paying identy for the rent.
authorityThe signing authority of the program invocation.
systemProgramThe official Solana system program address. Responsible for system CPIs.

Arguments

The following 10 arguments should also be provided when invoking this instruction.

NameTypeSizeOffsetDescription
architectureTypeu810The ArchitectureType of the node.
countryCodeu1621The CountryCode of the node.
cpuu1623The number of vCPU cores a node has.
gpuu1625The number of GPU cores a node has.
memoryu1627Memory capacity of a node in GB.
iopsu1629Input/output operations per second of a node.
storageu16211Storage capacity of a node in GB.
endpointstringundefined13HTTP endpoint for log streaming and results.
iconstringundefinedNaNn/a
versionstringundefinedNaNThe version of the nosana node software they are running.
Solana Dispatch ID

The Solana dispatch ID for the Register Instruction
is d37c430fd3c2b2f0,
which can also be expressed as an 8 byte discriminator:

[211,124,67,15,211,194,178,240]
Example with Anchor

To invoke the Register Instruction
with Anchor TSopen in new window.

let tx = await program.methods
  .register(
    architectureType,  // type: u8
    countryCode,       // type: u16
    cpu,               // type: u16
    gpu,               // type: u16
    memory,            // type: u16
    iops,              // type: u16
    storage,           // type: u16
    endpoint,          // type: string
    icon,              // type: string
    version,           // type: string
  )
  .accounts({
    node,              // βœ“ writable, 𐄂 signer
    payer,             // βœ“ writable, βœ“ signer
    authority,         // 𐄂 writable, βœ“ signer
    systemProgram,     // 𐄂 writable, 𐄂 signer
  })
  .signers([payerKey, authorityKey])
  .rpc();

Accounts

A number of 2 accounts make up for the Nosana Nodes Program's state.

Node Account

Node Account

The NodeAccount struct holds all the information for any given node.
The total size of this account is NaN bytes.

NameTypeSizeOffsetDescription
authoritypublicKey328The signing authority of the program invocation.
auditedbool140n/a
architectureu8141n/a
countryu16242n/a
cpuu16244The number of vCPU cores a node has.
gpuu16246The number of GPU cores a node has.
memoryu16248Memory capacity of a node in GB.
iopsu16250Input/output operations per second of a node.
storageu16252Storage capacity of a node in GB.
endpointstringundefined54HTTP endpoint for log streaming and results.
iconstringundefinedNaNn/a
versionstringundefinedNaNThe version of the nosana node software they are running.
Anchor Account Discriminator

The first 8 bytes, also known as Anchor's 8 byte discriminator, for the Node Account
are 7da61292c37f56dc, which can also be expressed in byte array:

[125,166,18,146,195,127,86,220]

Types

A number of 2 type variants are defined in the Nosana Nodes Program's state.

Architecture Type

Architecture Type

The ArchitectureType describes the type of chip architecture the node has

A number of 11 variants are defined in this enum:

NameNumber
Amd640
Arm32v61
Arm32v72
Arm64v83
WindowsAmd644
Ppc64le5
S390x6
Mips64le7
Riscv648
I3869
Unknown255

Errors

A number of 7 errors are defined in the Nosana Nodes Program.

6000

Nosana Error

6000 - Architecture Unknown

This architecture does not exist.

Diagram

Last update: