lotus/documentation/en/api-methods-worker.md
2020-11-30 23:16:30 +01:00

6.3 KiB

Groups

Enabled

There are not yet any comments for this method.

Perms: admin

Inputs: null

Response: true

Fetch

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1,
  "sealing",
  "move"
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Info

There are not yet any comments for this method.

Perms: admin

Inputs: null

Response:

{
  "Hostname": "string value",
  "Resources": {
    "MemPhysical": 42,
    "MemSwap": 42,
    "MemReserved": 42,
    "CPUs": 42,
    "GPUs": null
  }
}

Paths

There are not yet any comments for this method.

Perms: admin

Inputs: null

Response: null

Remove

Storage / Other

Perms: admin

Inputs:

[
  {
    "Miner": 1000,
    "Number": 9
  }
]

Response: {}

Session

Like ProcessSession, but returns an error when worker is disabled

Perms: admin

Inputs: null

Response: "07070707-0707-0707-0707-070707070707"

Version

TODO: Info() (name, ...) ?

Perms: admin

Inputs: null

Response: 65536

Add

AddPiece

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  1024,
  {}
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Finalize

FinalizeSector

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Move

MoveStorage

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Process

ProcessSession

returns a random UUID of worker session, generated randomly when worker process starts

Perms: admin

Inputs: null

Response: "07070707-0707-0707-0707-070707070707"

Read

ReadPiece

Perms: admin

Inputs:

[
  {},
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1040384,
  1024
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Release

ReleaseUnsealed

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Seal

SealCommit1

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  null,
  null,
  {
    "Unsealed": {
      "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
    },
    "Sealed": {
      "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
    }
  }
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealCommit2

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealPreCommit1

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealPreCommit2

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Set

SetEnabled

SetEnabled marks the worker as enabled/disabled. Not that this setting may take a few seconds to propagate to task scheduler

Perms: admin

Inputs:

[
  true
]

Response: {}

Storage

StorageAddLocal

There are not yet any comments for this method.

Perms: admin

Inputs:

[
  "string value"
]

Response: {}

Task

TaskDisable

There are not yet any comments for this method.

Perms: admin

Inputs:

[
  "seal/v0/commit/2"
]

Response: {}

TaskEnable

There are not yet any comments for this method.

Perms: admin

Inputs:

[
  "seal/v0/commit/2"
]

Response: {}

TaskTypes

TaskType -> Weight

Perms: admin

Inputs: null

Response:

{
  "seal/v0/precommit/2": {}
}

Unseal

UnsealPiece

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1040384,
  1024,
  null,
  {
    "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
  }
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Wait

WaitQuiet

WaitQuiet blocks until there are no tasks running

Perms: admin

Inputs: null

Response: {}