nazmulidris / hello_ockam

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hello_ockam

Table of contents

This repo is just an experiment to see if I can improve on the examples using colored output, more helpful stdout messages, and more concise code.

  1. All the code examples have colorized output so that it is clear to see which node is outputting what to stdout. Lots of helpful text has been added to inform the developer about what the program is doing.
    • Here's an example of secure channels example: 05-secure-channel-ex
    • Here's another example of routing over multiple hops: 03-routing-over-multiple-hops-ex
  2. Instead of having multiple source files for certain examples (eg: secure channels), all the examples are self contained in a single source file using tokio::spawn to run multiple nodes concurrently, and shut down the entire example cleanly.
  3. The exception to using tokio:spawn is the credential exchange example which has 3 source files (didn't work w/ tokio:spawn for some reason). 06-credential-exchange Here's the command to run this:
    gnome-terminal -x sh -c "cargo run --example 06-credential-exchange-issuer"
    gnome-terminal -x sh -c "cargo run --example 06-credential-exchange-server"
    cargo run --example 06-credential-exchange-client
  4. All short variable names are replaced w/ longer more readable ones.

Following Rust API guides below

  1. Rust API
  2. Nodes and Workers
  3. Routing and transports
  4. Identities and Vaults
  5. Secure Channels
  6. Credentials and Authorities

Run the examples

OCKAM_LOG=none cargo run --example 01-node
OCKAM_LOG=none cargo run --example 02-worker
OCKAM_LOG=none cargo run --example 03-routing
OCKAM_LOG=none cargo run --example 03-routing-many-hops
OCKAM_LOG=none cargo run --example 04-routing-over-transport
OCKAM_LOG=none cargo run --example 04-routing-over-two-transport-hops
OCKAM_LOG=none cargo run --example 05-identity
OCKAM_LOG=none cargo run --example 05-secure-channel-over-two-transport-hops-responder
gnome-terminal -x sh -c "OCKAM_LOG=none cargo run --example 06-credential-exchange-issuer"
gnome-terminal -x sh -c "OCKAM_LOG=none cargo run --example 06-credential-exchange-server"
OCKAM_LOG=none cargo run --example 06-credential-exchange-client
  1. 01-node.rs: https://asciiflow.com/#/share/eJyrVspLzE1VssorzcnRUcpJrEwtUrJSqo5RqohRsrK0NNSJUaoEsozMLYGsktSKEiAnRunRlD1UQTExeUBSQcEvPyVVwVABBcClqWoTNoAkTZ7h6EYoOKakFKUWF1shLMBQop5YUKCO4gZMhzSQiFCNwOtV6gSqUq1SLQAC/z9O
  2. 02-worker.rs: https://asciiflow.com/#/share/eJyrVspLzE1VssorzcnRUcpJrEwtUrJSqo5RqohRsrK0NNSJUaoEsozMLYGsktSKEiAnRunRlJ5HUxooRhNiYvIeTWlSUPDLT0lVMFRAAUAJsPQcati0BGYTNgCzqQnEJMNjE9CMaFJwTEkpSi0utkJYgKFEPbGgQB3FDWhKpoDNXkOUE6ZtAjNmoBgBNRTNDmzenbaHOI9uocC7qckZ+alF6gS8SxJC9y7umCXDcCzWxSjVKtUCAO/Vn64=)
  3. 03-routing.rs: https://asciiflow.com/#/share/eJyrVspLzE1VslIyMFbSUcpJrEwtAnKqY5QqYpSsLC0NdWKUKoEsIwsDIKsktaIEyIlRejRlD1VQTEwekFRQ8MtPSVUwVEABj6Y0QaSpahM2gCT9aErPoykNJKIJaEY0KTimpBSlFhdbIbyCoUQ9saBAHcW3aEqmgM3eQ5QTpu0CM2agGAHmoPkTu3enEWfLlC0UeDcjv6AgtchQnSre3UQX7+6hwLupyRn5qUXqOJVMIT2ZoXsXb0LGK02dHKVUq1QLACw0OTI
  4. 03-routing-many-hops.rs: https://asciiflow.com/#/share/eJyrVspLzE1VslIyMNY1UtJRykmsTC0CcqtjlCpilKwsLQ11YpQqgSwjCwMgqyS1ogTIiVF6NGUPtVBMTB6QVFDwy09JVTBUQAVweWrbhhUgyT%2Ba0vNoSgOJaAK6GU0KjikpRanFxVZwG5ow1agnFhSoI7sCQ80UsPF7iHLFtF1gxgxUM8AcNL%2Fi8PM04uyZsoUiP2fkFxSkFhnq6RmrQ9RUGFPg50108vMeivycmpyRn1qkjlvNFNLTHIaf8adr%2FPJUy2VKtUq1AL84Qzs%3D)
  5. 04-routing-over-transport.rs: https://asciiflow.com/#/share/eJytVD1ugzAUvor1FpYMqI0UwVb1Ah06WqoQWC1SaiPjIVEUqUIZO2SwaIaOPUHVqeI0nKQG4iYmTksAywhb7%2Bd73%2FserIAGzwR8cKcwgXmwJFxdVhgWGHzPu55gWKrT1cxTJ0EWQl0wlPK1lC%2BD9xZjWsqMsog8xDQWcSAYR%2FulDLX5fQykjwYJWZdGytAAXlsjTXYTRZykqW%2Bg1M8QEEvzqpxOkCROm5IGa9qrikkYjchJeys%2FWScs6t0BOv%2FU550GGVskVUqbjn5dJGPejZH8MmTU%2FSt6b3MY7m%2FvkOABVRJwsa%2FVFpd%2FWz3NZCGjlIQCCYamrutWLm8ba755nApCY%2FqIGG1828lkX6l2A9pUjc9pm85JeiR%2BaySKY9F7MzFZHRhdND6%2FbpqRnc7hyyxs%2F4fOwQ4JnxjhTq%2FgoTP9N8A5wz%2BB48iHYQ3rHwrvgOs%3D)

About


Languages

Language:Rust 100.0%