API Reference Diode Client v#1.4.8

Copy Markdown View Source

Modules

DiodeClient secure end-to-end encrypted connections between any two machines. Connections are established either through direct peer-to-peer TCP connections or bridged via the Diode network. To learn more about the decentralized Diode network visit https://diode.io/

A listener for incoming connections.

Helper to download and deploy diode_contract (https://github.com/diodechain/diode_contract) on a local Anvil chain for testing.

BitMessage implementation used for Diode P2P cold messages.

Block related helper functions

Wrapper for BNS smart contract to register and resolve names.

Zone (drive) contract methods

Imported contract to read group memberships. Useful to recursively resolve BNS names to individual devices.

This module is used to create and manage the factory contract. The factory is creating Proxy contracts for deployed implementations. Only the original transaction submitter can upgrade the implementation.

This module is used to create and manage the node registry contract. The node registry is used to register and manage nodes.

EIP-712 implementation

Meta transaction to submit pre-signed transactions to the blockchain.

Tracks per-node connection outcomes and drives backoff for reconnect attempts.

Helper module for Saphhire CBOR encoding to enforce canonical order of elements when CBOR encoding maps.

Transport Cipher for Oasis Sapphire

All objects are made of tuples {:type, value1, value2, ..., valueN, signature} The number of values are different but the last signature is a signature is always is the signature of BertExt.encode!([value1, value2, ..., valueN])) Also the signatures public key is always equal to the key

A relay is a reserved ip:port combination on a node server that can be used relay traffic between two clients.

Encoding and Decoding of Recursive Length Prefix (RLP) https://eth.wiki/fundamentals/rlp

DiodeClient.Shell is the interface to the blockchain state. It allows fetching accounts and block header information. Data fetched is by default checked against a merkle proof.

Shell for testing against a local Anvil chain (Foundry). Uses HTTP JSON-RPC; RPC URL and chain ID are configurable via ANVIL_RPC_URL and ANVIL_CHAIN_ID.

Common functions for the shell implementations.

DiodeClient.Shell is the interface to the blockchain state. It allows fetching accounts and block header information. Data fetched is by default checked against a merkle proof.

DiodeClient.Shell is the interface to the blockchain state. It allows fetching accounts and block header information. Data fetched is by default checked against a merkle proof.

Specialized shell for Oasis Sapphire.

DiodeClient Transport interface for use with Cowboy2 Adapter and :hackeny. Potentially more depending on interface compatibility

Representation of an Ethereum Wallet. This struct can hold keys in three levels of completeness

Mix Tasks

BNS CLI

Runs cast call --trace from an eth_call JSON-RPC request file (Oasis Sapphire).

Builds and submits a test Oasis Sapphire transaction via cast.

Fetch and print a Diode network object (ticket) for an address.

List or fetch Diode network nodes (mix diode.nodes list, mix diode.nodes get <address>).

Diode Publish CLI

Resolves an Ethereum address or BNS name (drive ownership, members, aliases).

Diode UDP port publish and consume CLI