Skip to main content

fakecloud_managedblockchain/
lib.rs

1//! Amazon Managed Blockchain (`managedblockchain`) restJson1 control plane for
2//! fakecloud.
3//!
4//! The full 27-operation Amazon Managed Blockchain Smithy model. Managed
5//! Blockchain signs SigV4 with the `managedblockchain` scope and speaks
6//! restJson1; every operation is a RESTful `<METHOD> /...` route with path
7//! labels (e.g. `POST /networks`, `GET /networks/{NetworkId}/members/{MemberId}`),
8//! so requests are routed by their HTTP method + `@http` URI template.
9//!
10//! This is real, persisted, account-partitioned control-plane state, not a set
11//! of stubs:
12//!
13//! * **Networks.** `CreateNetwork` mints a `n-...` id + ARN and stores the
14//!   name, description, framework (`HYPERLEDGER_FABRIC` / `ETHEREUM`), framework
15//!   version, framework configuration and voting policy. For Hyperledger Fabric
16//!   it atomically creates the requested first member (`m-...`), returning both
17//!   `NetworkId` and `MemberId`; the network is `AVAILABLE`. `GetNetwork` /
18//!   `ListNetworks` (filtered by name/framework/status, paginated) round-trip.
19//! * **Members.** Full CRUD of `m-...` members, each with Fabric framework
20//!   attributes (CA endpoint + admin username) and a log-publishing config;
21//!   `CREATING` settles to `AVAILABLE` on read, `DeleteMember` flips to
22//!   `DELETED`.
23//! * **Nodes.** Full CRUD of `nd-...` nodes carrying instance type, availability
24//!   zone, state DB and deterministically-derived framework endpoints (Fabric
25//!   peer / Ethereum HTTP + WebSocket); `CREATING` settles to `AVAILABLE`.
26//! * **Proposals + voting.** `CreateProposal` mints `p-...`, stores the invite /
27//!   removal actions, sets `IN_PROGRESS` and an expiration derived from the
28//!   network's `ProposalDurationInHours`. `VoteOnProposal` records a `YES`/`NO`
29//!   vote per member; when the voting policy threshold is met the proposal
30//!   becomes `APPROVED` (materialising each invitation into a real `Invitation`
31//!   in the invited principal's account, and applying removals) or `REJECTED`.
32//!   `ListProposalVotes` returns the recorded votes.
33//! * **Invitations.** `ListInvitations` returns pending invitations for the
34//!   account; `RejectInvitation` flips one to `REJECTED`.
35//! * **Accessors.** `CreateAccessor` mints a UUID accessor id + billing token +
36//!   ARN (`BILLING_TOKEN`, `AVAILABLE`); full CRUD.
37//! * **Tagging.** ARN-keyed `TagResource` / `UntagResource` /
38//!   `ListTagsForResource`.
39//!
40//! Model-driven validation rejects contract violations with the codes each
41//! operation declares (`InvalidRequestException`, `ResourceNotFoundException`,
42//! `IllegalActionException`).
43//!
44//! **Honest gap (documented, not stubbed):** Managed Blockchain does not run a
45//! real Hyperledger Fabric or Ethereum network. fakecloud mirrors this: the
46//! ordering-service / CA / peer / JSON-RPC endpoints it returns are well-formed,
47//! deterministic URLs derived from the resource ids, but they point at no live
48//! chain -- there is no orderer, CA, peer, or Ethereum RPC listening behind
49//! them. The entire control plane (networks, members, nodes, proposals, votes,
50//! invitations, accessors, tags) is real, account-partitioned and persisted;
51//! only the blockchain data plane those endpoints would front is absent.
52
53pub mod persistence;
54pub mod service;
55pub mod shared;
56pub mod state;
57mod validate;
58
59pub use service::{ManagedBlockchainService, MANAGEDBLOCKCHAIN_ACTIONS};
60pub use state::{
61    ManagedBlockchainData, ManagedBlockchainSnapshot, SharedManagedBlockchainState,
62    MANAGEDBLOCKCHAIN_SNAPSHOT_SCHEMA_VERSION,
63};