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

Description
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:
- Add header:
Authorization: token {self.token}
- Append the command name to the URI (e.g.,
https://sandbox.iotatoken.com/api/v1/commands/attachToTangle).
- Return node response like normal.
For sandbox commands:
- Add header:
Authorization: token {self.token}
- Append the command name to the URI (e.g.,
https://sandbox.iotatoken.com/api/v1/commands/attachToTangle).
- Response will contain job info.
https://github.com/iotaledger/documentation/blob/sandbox/source/index.html.md#attachtotangle
- Poll every
{self.interval} to see if the job has completed.
https://github.com/iotaledger/documentation/blob/sandbox/source/index.html.md#jobs