Skip to content

Commit

Permalink
This too low-level.
Browse files Browse the repository at this point in the history
  • Loading branch information
John-LittleBearLabs committed Nov 13, 2023
1 parent 6458cfa commit 024b43a
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/charts/ship.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
```mermaid
%%{init: { "sequence": { "noteAlign": "left"} } }%%
sequenceDiagram
participant O as Operator
participant G as Ground IPFS
participant S as Space IPFS
Note over G,S: Both nodes begin listening for messages on boot
Note over O,S: Satellite comes into LOS
O->>G: IsConnected(true)
S->>S: IsConnected(true)
Note over O,G: Operator commands IPFS <br/> node to transmit a file
O->>G: TransmitFile(path)
Note over G,S: Transfer of blocks <br/> 1. File is chunked into blocks, each with a CID <br/> 2. Root block contains links to child CIDs <br/> 3. Blocks are transmitted over UDP-radio
loop Until DAG is Complete
Note over G,S: Operator asks space IPFS node to verify that all <br/> CIDs are received.
G->>S: GetMissingDagBlocks(CID): [Block] <br/>
Note over G,S: If empty response, all blocks are received
S->>G: MissingDagBlocks(): [CID]
Note over G,S: If blocks are missing, ground retransmits
G->>S: While blocks remain missing, <br/>TransmitBlock(CID)
end
Note over O,S: Operator asks space IPFS to write DAG to the file system
O->>S: ExportDag(CID, path)
Note over G,S: Satellite goes out of range
O->>G: IsConnected(false)
S->>S: IsConnected(false)
```
26 changes: 26 additions & 0 deletions docs/charts/sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```mermaid
sequenceDiagram
participant G as Ground
participant V as Vehicle
Note over G: Import File
Note left of G: Available CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i (file.name) <br /> bafkreietrw4mt6bmrs2y2pz66t6skabwusgsnjysou6s7xs2xub2qxfl6q <br/> bafkreictl6rq27rf3wfet4ktm54xgtwifbqqruiv3jielv37hnaylwhxsa <br/> bafkreiebc6dk2gxhjlp52ig5anzkxkxlyysg4nb25pib3if7ytacx4aqnq <br /> bafkreicj2gaoz5lbgkazk4n7hhm3pm2ckivcvrwshqkbruztqji37zdjza <br /> bafkreignoc7kai7xkkqfmsv3n3ii2qwbiqhs4m7ctekokxql4fmv4jhuli
G ->> V: "Push" Send CIDs to Expect (& File Name)
Note right of V: Available CIDs: <br /><br/> Missing CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i (file.name) <br /> bafkreietrw4mt6bmrs2y2pz66t6skabwusgsnjysou6s7xs2xub2qxfl6q <br/> bafkreictl6rq27rf3wfet4ktm54xgtwifbqqruiv3jielv37hnaylwhxsa <br/> bafkreiebc6dk2gxhjlp52ig5anzkxkxlyysg4nb25pib3if7ytacx4aqnq <br /> bafkreicj2gaoz5lbgkazk4n7hhm3pm2ckivcvrwshqkbruztqji37zdjza <br /> bafkreignoc7kai7xkkqfmsv3n3ii2qwbiqhs4m7ctekokxql4fmv4jhuli
G ->> V: Send Block
Note over V: Hash, store.
Note over V: Parse as stem (fails - it's a leaf).
Note right of V: Available CIDs: <br /> bafkreignoc7kai7xkkqfmsv3n3ii2qwbiqhs4m7ctekokxql4fmv4jhuli <br /> Missing CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i <br /> bafkreietrw4mt6bmrs2y2pz66t6skabwusgsnjysou6s7xs2xub2qxfl6q <br/> bafkreictl6rq27rf3wfet4ktm54xgtwifbqqruiv3jielv37hnaylwhxsa <br/> bafkreiebc6dk2gxhjlp52ig5anzkxkxlyysg4nb25pib3if7ytacx4aqnq <br /> bafkreicj2gaoz5lbgkazk4n7hhm3pm2ckivcvrwshqkbruztqji37zdjza
G --X V: Attempt to send blocks, packets dropped
V ->> G: "Pull" Send CIDs for blocks to send/re-send
G ->> V: Send Block (bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i)
Note over V: Hash, store.
Note over V: Parse as stem, passes - has 5 children.
loop For each child CID
Note over V: If already available, ignore.
Note over V: Otherwise add to 'missing' & "Pull"
end
Note right of V: Available CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i (file.name) <br /> bafkreignoc7kai7xkkqfmsv3n3ii2qwbiqhs4m7ctekokxql4fmv4jhuli <br /><br /> Missing CIDs: <br /> bafkreietrw4mt6bmrs2y2pz66t6skabwusgsnjysou6s7xs2xub2qxfl6q <br/> bafkreictl6rq27rf3wfet4ktm54xgtwifbqqruiv3jielv37hnaylwhxsa <br/> bafkreiebc6dk2gxhjlp52ig5anzkxkxlyysg4nb25pib3if7ytacx4aqnq <br /> bafkreicj2gaoz5lbgkazk4n7hhm3pm2ckivcvrwshqkbruztqji37zdjza
loop Other CIDs in pull
G ->> V: Send Blocks
End
```
20 changes: 20 additions & 0 deletions docs/charts/sync_specialfailure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```mermaid
sequenceDiagram
participant G as Ground
participant V as Vehicle
Note over G: Import File
Note left of G: Available CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i (file.name) <br /> bafkreietrw4mt6bmrs2y2pz66t6skabwusgsnjysou6s7xs2xub2qxfl6q <br/> ... 4 more (5 leaves in total)
G --X V: "Push" Send CIDs to Expect (& File Name)
Note right of V: Available CIDs: <br />(none)<br/> Missing CIDs: <br /> (none - the push never got here)
G ->> V: Send Block (bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i)
Note over V: Hash, store.
Note over V: Parse as stem, passes - has 5 children.
loop For each child CID
Note over V: Neither available nor marked as missing, mark as missing.
end
Note right of V: Available CIDs: <br /> bafybeicbshh2atg556w77jzb5yl4e63fefisnutf32l7byzrteosqjhb6i (file.name) <br /> bafkreignoc7kai7xkkqfmsv3n3ii2qwbiqhs4m7ctekokxql4fmv4jhuli <br /><br /> Missing CIDs: <br /> ... 4 CIDs remain ...
V ->> G: Pull (5 CIDs mentioned in stem)
loop Other CIDs in pull
G ->> V: Send Blocks
End
```
Loading

0 comments on commit 024b43a

Please sign in to comment.