Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Add Sandbox Support #19

@todofixthis

Description

@todofixthis

Create a SandboxAdapter that enables developers to connect to remote nodes safely.

class SandboxAdapter(HttpAdapter):
  def configure(uri, token):
    # type: (Text, Text) -> SandboxAdapter
    ...

  def __init__(token, host, port=DEFAULT_PORT, path='/commands', poll_interval=15, sandbox_commands={'attachToTangle'}):
    # type: (Text, int, Text, int, Iterable[Text]) -> None
    ...

For non-sandbox commands:

  1. Add header: Authorization: token {self.token}
  2. Append the command name to the URI (e.g., https://sandbox.iotatoken.com/api/v1/commands/attachToTangle).
  3. Return node response like normal.

For sandbox commands:

  1. Add header: Authorization: token {self.token}
  2. Append the command name to the URI (e.g., https://sandbox.iotatoken.com/api/v1/commands/attachToTangle).
  3. Response will contain job info.
    https://github.com/iotaledger/documentation/blob/sandbox/source/index.html.md#attachtotangle
  4. Poll every {self.interval} to see if the job has completed.
    https://github.com/iotaledger/documentation/blob/sandbox/source/index.html.md#jobs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions