From ac0ab849e3978e065e9b81bf0db4ab90407e58d7 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Thu, 20 Mar 2025 17:17:50 -0400 Subject: [PATCH 1/2] chore: remove contexts intro --- .../developers/blueprint-contexts/_meta.json | 1 - .../blueprint-contexts/introduction.mdx | 34 ------------------- 2 files changed, 35 deletions(-) delete mode 100644 pages/developers/blueprint-contexts/introduction.mdx diff --git a/pages/developers/blueprint-contexts/_meta.json b/pages/developers/blueprint-contexts/_meta.json index a75fa10..d99c5e0 100644 --- a/pages/developers/blueprint-contexts/_meta.json +++ b/pages/developers/blueprint-contexts/_meta.json @@ -1,5 +1,4 @@ { - "introduction": "Introduction to Contexts", "keystore-context": "Keystore Context", "evm-provider-context": "EVM Provider Context", "tangle-client-context": "Tangle Client Context", diff --git a/pages/developers/blueprint-contexts/introduction.mdx b/pages/developers/blueprint-contexts/introduction.mdx deleted file mode 100644 index 7fcc33a..0000000 --- a/pages/developers/blueprint-contexts/introduction.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Introduction to Contexts ---- - -## What is a Context? - -In the Gadget SDK, a Context holds utilities and dependencies that a job may need that aren't direct inputs. Think of it as a container for all the external resources and services your job requires to function. - -A Context can include various elements such as: - -- HTTP clients for making network requests -- Access to a keystore -- Smart contract bindings and wrappers -- Database connections for data persistence -- Loggers for recording application events -- Configuration objects for environment-specific settings -- Authentication tokens or credentials -- Caches or in-memory data stores - -The Context pattern is closely related to the Dependency Injection (DI) design pattern, which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies. - -## Why do we need Contexts? - -The Context pattern offers several significant benefits in software design and development: - -1. **Decoupling**: By passing dependencies through a Context, we decouple the job implementation from the specific implementations of its dependencies. This makes the code more modular and easier to maintain. - -2. **Testability**: With a Context, it's easier to mock or stub dependencies during unit testing, allowing for more comprehensive and isolated tests. - -3. **Flexibility**: Contexts allow for easy swapping of implementations, which is particularly useful when adapting to different environments (e.g., development, staging, production). - -4. **Separation of Concerns**: The Context pattern helps separate the configuration and setup of dependencies from their usage, leading to cleaner, more focused code. - -5. **Reusability**: Jobs that rely on a Context can be more easily reused in different scenarios by simply providing a different Context. From 68ef7b1cb9f6baad9296ae9685444e4914b6451e Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:56:08 -0400 Subject: [PATCH 2/2] feat: partial round-based compat page --- .../p2p-networking/extensions/round-based.mdx | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pages/developers/p2p-networking/extensions/round-based.mdx b/pages/developers/p2p-networking/extensions/round-based.mdx index e69de29..f618e49 100644 --- a/pages/developers/p2p-networking/extensions/round-based.mdx +++ b/pages/developers/p2p-networking/extensions/round-based.mdx @@ -0,0 +1,25 @@ +--- +title: P2P Networking round-based Extension +description: An overview of the round-based extension for the P2P networking utilities provided by the blueprint SDK. +--- + +# `round-based` extension for P2P Networking + +[round-based] is an MPC framework that unifies and simplifies the way of developing and working with multiparty +protocols (e.g. threshold signing, random beacons, etc.). + +To enable the extension, add the following to your `Cargo.toml`: + +```toml +[dependencies] +blueprint-sdk = { version = "0.1.0", features = ["round-based-compat", ...]} +``` + +The extension provides multiple wrappers, with the primary one being the [`RoundBasedNetworkAdapter`]. + +# Example + + + +[round-based]: https://crates.io/crates/round-based +[`RoundBasedNetworkAdapter`]: https://docs.rs/blueprint_networking_round_based_extension/latest/blueprint_networking_round_based_extension/struct.RoundBasedNetworkAdapter.html \ No newline at end of file