diff --git a/.gitignore b/.gitignore index 3551c0ba1..269b09ae5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ public/ .DS_Store yarn.lock node_modules -resources \ No newline at end of file +resources +static/_gen \ No newline at end of file diff --git a/README.md b/README.md index a837218ed..4bad69b7b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ brew install go bzr ### Serve with Live Reload ```sh -yarn serve +yarn start # open http://localhost:1313/ in the browser ``` @@ -84,56 +84,8 @@ or to a specific version with hugo mod get github.com/filecoin-project/specs-actors@v0.7.2 ``` -## Shortcodes -### `Mermaid` -Inline mermaid syntax rendering -```html -{{< mermaid >}} -graph TD - A[Christmas] -->|Get money| B(Go shopping) - B --> C{Let me think} - C -->|One| D[Laptop] - C -->|Two| E[iPhone] - C -->|Three| F[fa:fa-car Car] - -{{}} -``` - -### `svg` -This shortcode includes zoom and pad features. -```html - -{{< svg src="pull-flow.mmd.svg" title="Data Transfer - Pull Flow" >}} - - -{{< svg src="/systems/pull-flow.mmd.svg" title="Data Transfer - Pull Flow" >}} -``` - -### `hint` -```md - -{{< hint info >}} -**Markdown content** -Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat -stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa -{{< /hint >}} -``` -### `figure` -```md -{{< figure src="diagrams/pieces.png" title="Pieces, Proving Trees, and Piece Data Structures" zoom="true">}} -``` - -### `embed` -```md -# src relative to the page -{{}} - -# src relative to content folder -{{}} -``` - ## Page Header -The first heading should be # Head with `---` like below and should refer to the overall title of the document. +The first heading should be `# Page Title` with `---` like below and should refer to the overall title of the document. ```md --- @@ -192,6 +144,21 @@ Random plain text context ... ``` +## Images, diagrams - Markdown images +To add an image or diagram you just need to use normal markdown syntax. +For diagrams you can use the source files and the pipelines will handle converting that to `svg`, we support mermaid and dot source files. + +```md +# relative to the markdown file +![Alt text](picture.jpg) + +# relative to the content folder +![Alt text](/content/intro/diagram1.mmd) + +![Alt text](graph.dot "Graph title") +``` +> When there's no title we use the alt text as title + ## References - Markdown links These links use "portable links" just like `relref` so you can just give it the name of the file and it will fetch the correct relative link and title for the `` automatically. @@ -199,8 +166,8 @@ You can override the `` title by passing a second `string` in the link defini > **Note**: When using anchors the title can't be fetched automatically. ```md -[Storage Power](storage_power_consensus) -# Storage Power +[](storage_power_consensus) +# Storage Power Consensus [Storage Power](storage_power_consensus "Title to override the page original title") # Storage Power @@ -210,6 +177,40 @@ You can override the `` title by passing a second `string` in the link defini ``` + +## Shortcodes +### `Mermaid` +Inline mermaid syntax rendering +```html +{{< mermaid >}} +graph TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] + +{{}} +``` + +### `hint` +```md + +{{< hint info >}} +**Markdown content** +Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat +stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa +{{< /hint >}} +``` +### `embed` +```md +# src relative to the page +{{}} + +# src relative to content folder +{{}} +``` + ## Math mode For short snippets of math text you can just use the `{{}}` shortcode, but if you need to write lots of math in a page you can just use `math-mode` and avoid writting the katex shortcode everywhere. diff --git a/assets/_custom.scss b/assets/_custom.scss index 0d3effb45..183f5cd3b 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -12,6 +12,8 @@ @import "katex"; @import "icons"; @import "code"; +@import "plugins/lightbox"; + .markdown { overflow-x: hidden; @@ -48,21 +50,25 @@ border-radius: $border-radius; } .diagrams { - width: auto; - overflow: hidden; - cursor: grab; height: 400px; + overflow: hidden; + outline: none; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; +} +.diagrams img { + max-height: 100%; + max-width: 100%; display: flex; justify-content: center; align-items: center; - will-change: transform; - outline: none; } .diagrams:active { cursor: grabbing; } .diagrams-caption { - // background-color: #e9ecef; border-top: 1px solid #e9ecef; padding: 0.5rem; font-size: 12px; @@ -74,43 +80,6 @@ } } -.diagrams svg { - transform-origin: top left; - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; -} -.diagrams.svg svg { - background-color: white; -} - -// Figure zoom -.figure { - width: auto; - overflow: hidden; - cursor: grab; - justify-content: center; - align-items: center; - will-change: transform; - outline: none; -} -.figure:active { - cursor: grabbing; -} -.figure + figcaption { - text-align: center; -} - -.figure img { - transform-origin: top left; - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: auto; -} // search #book-search-results { width: 100%; diff --git a/assets/js/katex.js b/assets/js/katex.js index d2cd77b66..a7f520062 100644 --- a/assets/js/katex.js +++ b/assets/js/katex.js @@ -1,7 +1,6 @@ import renderMathInElement from 'katex/dist/contrib/auto-render.mjs' function renderKatex (target) { - console.log('init katex for ', target) renderMathInElement(target, { ignoredTags: ["script", "noscript", "style", "textarea"], throwOnError: false, diff --git a/assets/js/lightbox.js b/assets/js/lightbox.js new file mode 100644 index 000000000..2842357c1 --- /dev/null +++ b/assets/js/lightbox.js @@ -0,0 +1,71 @@ +import zoomable from 'd3-zoomable'; + +function lightbox () { + const transitionSpeedInMilliseconds = 250; + + // template + const fragment = new DocumentFragment() + const container = document.createElement('div') + container.classList.add('lightbox-container') + + const zoom = document.createElement('div') + zoom.classList.add('lightbox-zoom') + + const img = document.createElement('img') + img.src = '' + img.classList.add('lightbox-image') + + container.appendChild(zoom) + zoom.appendChild(img) + fragment.appendChild(container) + document.body.appendChild(fragment) + + // init zoomable in the template + const myZoom = zoomable() + myZoom(container).htmlEl(zoom) + + // hook events + const elements = document.querySelectorAll('.zoomable img') + elements.forEach((element) => { + element.addEventListener('click', () => { + handleElementClick(element); + }); + }); + container.addEventListener('click', hideLightbox); + window.addEventListener('keyup', (event) => { + if (event.key === 'Escape') { + hideLightbox(); + } + }); + + function handleElementClick(htmlElement) { + img.attributes['src'].value = htmlElement.attributes['src'].value; + if (!isVisible()) { + container.classList.remove('hidden'); + container.classList.add('visible'); + document.body.classList.add('lightbox-body-scroll-stop') + } + } + + function hideLightbox() { + if (isVisible()) { + container.classList.add('hidden'); + + setTimeout(() => { + container.classList.remove('visible'); + container.classList.remove('hidden'); + document.body.classList.remove('lightbox-body-scroll-stop') + img.attributes['src'].value = ''; + myZoom.zoomReset() + }, transitionSpeedInMilliseconds); + } + } + + function isVisible() { + return container.classList.contains('visible'); + } + } + + export { + lightbox + } \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index d72da5938..c0feaf4a9 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,25 +1,15 @@ import '@pwabuilder/pwaupdate' import { initToc } from './toc.js' -import panzoom from 'panzoom' import tablesort from 'tablesort' import Gumshoe from 'gumshoejs' import { buildTocModel } from './content-model' import { buildDashboard } from './dashboard-spec' -import { renderKatex } from "./katex"; +import { renderKatex } from './katex'; +import { lightbox } from './lightbox' // Note: the tablesort lib is not ESM friendly, and the sorts expect `Tablesort` to be available on the global window.Tablesort = tablesort require('tablesort/dist/sorts/tablesort.number.min.js') -function initPanZoom () { - var elements = document.querySelectorAll(".zoomable") - elements.forEach(function (el) { - panzoom(el.querySelector('*:first-child'), { - maxZoom: 10, - minZoom: 0.5 - }) - }) -} - function initTableSort () { var elements = document.querySelectorAll(".tablesort") elements.forEach(function (el) { @@ -63,9 +53,8 @@ window.addEventListener('DOMContentLoaded', () => { buildDashboard('#dashboard-container', model) initTocDepthSlider() initTocScrollSpy() - initPanZoom() initTableSort() - + lightbox() // load katex when math-mode page intersect with the viewport let observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { diff --git a/assets/plugins/_lightbox.scss b/assets/plugins/_lightbox.scss new file mode 100644 index 000000000..34a7c924d --- /dev/null +++ b/assets/plugins/_lightbox.scss @@ -0,0 +1,80 @@ +.lightbox-container { + transition: all 250ms ease-in-out; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #fff; + z-index: 1000; + justify-content: center; + align-items: center; + display: flex; + transform: scale(0); + opacity: 1; + cursor: zoom-out; + overflow: hidden; + will-change: transform; +} + +.lightbox-body-scroll-stop { + overflow: hidden; + // position:fixed; + width: 100%; +} + +.lightbox-container.visible { + animation-name: animate-in; + animation-duration: 250ms; + animation-fill-mode: forwards; +} +.lightbox-container.hidden { + animation: animate-out; + animation-duration: 250ms; + animation-fill-mode: forwards; +} + +.lightbox-zoom { + transform-origin: top left; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.lightbox-image { + max-width: 100%; + max-height: 100%; + width: auto; + height: 100%; + object-fit: contain; +} +@media (min-width: 768px) { + .lightbox-image { + max-width: 95%; + max-height: 95%; + } +} + +@keyframes animate-in { + 0% { + transform: scale(0); + opacity: 0; } + 1% { + transform: scale(0.9); + opacity: 0; } + 100% { + transform: scale(1); + opacity: 1; } } + + @keyframes animate-out { + 0% { + transform: scale(1); + opacity: 1; } + 99% { + transform: scale(0.9); + opacity: 0; } + 100% { + transform: scale(0); + opacity: 0; } } \ No newline at end of file diff --git a/config.toml b/config.toml index bb8723cbd..89f557745 100644 --- a/config.toml +++ b/config.toml @@ -1,9 +1,9 @@ # baseURL = '/' title = 'Filecoin Spec' -ignoreFiles= ["externals"] +ignoreFiles= ["externals", "\\.dot$", "\\.mmd$"] # theme = 'book' canonifyurls = false -relativeURLs = true +# relativeURLs = true # Book configuration disablePathToLower = true diff --git a/content/algorithms/expected_consensus/_index.md b/content/algorithms/expected_consensus/_index.md index 75c02dbaf..c45a2803b 100644 --- a/content/algorithms/expected_consensus/_index.md +++ b/content/algorithms/expected_consensus/_index.md @@ -167,16 +167,17 @@ This is detectable when a given miner submits two blocks that satisfy any of the 1. **Double-Fork Mining Fault**: two blocks mined at the same epoch (even if they have the same tipset). - `B4.Epoch == B5.Epoch` -{{< svg src="diagrams/double_fork.dot.svg" title="Double-Fork Mining Fault" >}} +![Double-Fork Mining Fault](diagrams/double_fork.dot) + 2. **Time-Offset Mining Fault**: two blocks mined off of the same Tipset at different epochs. - `B3.Parents == B4.Parents && B3.Epoch != B4.Epoch` -{{< svg src="diagrams/time_offset.dot.svg" title="Time-Offset Mining Fault" >}} +![Time-Offset Mining Fault](diagrams/time_offset.dot) 3. **Parent-Grinding Fault**: one block's parent is a Tipset that provably should have included a given block but does not. While it cannot be proven that a missing block was willfully omitted in general (i.e. network latency could simply mean the miner did not receive a particular block), it can when a miner has successfully mined a block two epochs in a row and omitted one. That is, this condition should be evoked when a miner omits their own prior block. Specifically, this can be proven with a "witness" block, that is by submitting blocks B2, B3, B4 where B2 is B4's parent and B3's sibling but B3 is not B4's parent. - `!B4.Parents.Include(B3) && B4.Parents.Include(B2) && B3.Parents == B2.Parents && B3.Epoch == B2.Epoch` -{{< svg src="diagrams/parent_grinding.dot.svg" title="Parent-Grinding fault" >}} +![Parent-Grinding fault](diagrams/parent_grinding.dot) ### Penalization for faults A single consensus fault results into: diff --git a/content/algorithms/expected_consensus/diagrams/double_fork.dot.svg b/content/algorithms/expected_consensus/diagrams/double_fork.dot.svg deleted file mode 100644 index 534549bda..000000000 --- a/content/algorithms/expected_consensus/diagrams/double_fork.dot.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - -G - - - -B1 - -B1 -MinerAny - - - -B2 - -B2 -MinerAny - - - -B2->B1 - - - - - -B3 - -B3 -MinerAny - - - -B3->B1 - - - - - -B4 - -B4 -MinerE - - - -B4->B2 - - - - - -B5 - -B5 -MinerE - - - -B5->B3 - - - - - diff --git a/content/algorithms/expected_consensus/diagrams/parent_grinding.dot.svg b/content/algorithms/expected_consensus/diagrams/parent_grinding.dot.svg deleted file mode 100644 index 74ad7f2a0..000000000 --- a/content/algorithms/expected_consensus/diagrams/parent_grinding.dot.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -G - - - -B1 - -B1 -MinerAny - - - -B2 - -B2 -MinerAny - - - -B2->B1 - - - - - -B3 - -B3 -MinerE - - - -B3->B1 - - - - - -B4 - -B4 -MinerE - - - -B4Null - - - - -B4->B4Null - - - - - -B5 - -B5 -MinerAny - - - -B5->B2 - - - - - -B5->B3 - - - - - -B4Null->B2 - - - - - diff --git a/content/algorithms/expected_consensus/diagrams/time_offset.dot.svg b/content/algorithms/expected_consensus/diagrams/time_offset.dot.svg deleted file mode 100644 index 7c53e5aa3..000000000 --- a/content/algorithms/expected_consensus/diagrams/time_offset.dot.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - -G - - - -B1 - -B1 -MinerAny - - - -B2 - -B2 -MinerAny - - - -B2->B1 - - - - - -B3 - -B3 -MinerE - - - -B3->B2 - - - - - -B4 - -B4 -MinerE - - - -B4->B2 - - - - - - diff --git a/content/examples.md b/content/examples.md new file mode 100644 index 000000000..cbe375793 --- /dev/null +++ b/content/examples.md @@ -0,0 +1,9 @@ +--- +title: Math Mode +bookhidden: true +math-mode: true +--- + +# testing + +{{}} \ No newline at end of file diff --git a/content/intro/_index.md b/content/intro/_index.md index 0a5d5422c..59dca12dd 100644 --- a/content/intro/_index.md +++ b/content/intro/_index.md @@ -9,7 +9,6 @@ dashboardAudit: n/a # Introduction --- - Filecoin is a distributed storage network based on a blockchain mechanism. Filecoin *miners* can elect to provide storage capacity for the network, and thereby earn units of the Filecoin cryptocurrency (FIL) by periodically producing diff --git a/content/intro/arch.md b/content/intro/arch.md index 6cc173327..251400c1a 100644 --- a/content/intro/arch.md +++ b/content/intro/arch.md @@ -19,14 +19,14 @@ dashboardAudit: n/a {{< /details >}} -{{< svg src="diagrams/overview1/overview.dot.svg" title="Protocol Overview Diagram" >}} +![Protocol Overview Diagram](diagrams/overview1/overview.dot) ## Protocol Flow Diagram -{{< svg src="diagrams/sequence/full-deals-on-chain.mmd.svg" title="Deals on Chain" >}} +![Deals on Chain](diagrams/sequence/full-deals-on-chain.mmd) ## Parameter Calculation Dependency Graph This is a diagram of the model for parameter calculation. This is made with [orient](https://github.com/filecoin-project/orient), our tool for modeling and solving for constraints. -{{< svg src="diagrams/orient/filecoin.dot.svg" title="Protocol Overview Diagram" >}} +![Protocol Overview Diagram](diagrams/orient/filecoin.dot) \ No newline at end of file diff --git a/content/intro/diagrams/buildsys/buildsys.dot.svg b/content/intro/diagrams/buildsys/buildsys.dot.svg deleted file mode 100644 index 303107920..000000000 --- a/content/intro/diagrams/buildsys/buildsys.dot.svg +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - -G - - - -.md - -.md - - - -make pdf -make pdf - - - -.md->make pdf - - - - - -hugo build - -hugo build - - - -.md->hugo build - - - - - -.ipld - -.ipld - - - -bin/codeGen -bin/codeGen - - - -.ipld->bin/codeGen - - - - - -.go - -.go - - - -go test -go test - - - -.go->go test - - - - - -.go->hugo build - - - - - -.orient - -.orient - - - -orient -orient - - - -.orient->orient - - - - - -.org - -.org - - - -<emacs> - -<emacs> - - - -.org-><emacs> - - - - - -.dot - -.dot - - - -dot -dot - - - -.dot->dot - - - - - -[website] - -[website] - - - -spec.pdf - -spec.pdf - - - -emacs -emacs - - - -.svg - -.svg - - - -dot->.svg - - - - - -orient->.dot - - - - - -orient-><emacs> - - - - - -.html - -.html - - - -orient->.html - - - - - -bin/codeGen->.go - - - - - -hugo -hugo - - - -[ok] - -[ok] - - - -go test->[ok] - - - - - -make website -make website - - - -make website->[website] - - - - - -make pdf->spec.pdf - - - - - -<emacs>->.md - - - - - -hugo build->.html - - - - - -.html->make website - - - - - -.svg->make website - - - - - -.svg->make pdf - - - - - diff --git a/content/intro/diagrams/orient/filecoin.dot.svg b/content/intro/diagrams/orient/filecoin.dot.svg deleted file mode 100644 index 8241d5de3..000000000 --- a/content/intro/diagrams/orient/filecoin.dot.svg +++ /dev/null @@ -1,907 +0,0 @@ - - - - - - -%3 - - - -69 - -ACTORS-MESSAGES-FRACTION - - - -68 - -ACTORS-MESSAGES-PER-BLOCK - - - -68->69 - - - - - -62 - -MESSAGES - - - -62->69 - - - - - -62->68 - - - - - -66 - -TX-MESSAGES-PER-BLOCK - - - -62->66 - - - - - -64 - -RECEIPTS - - - -62->64 - - - - - -63 - -MESSAGES-SIZE - - - -62->63 - - - - - -67 - -TX-MESSAGES-FRACTION - - - -67->66 - - - - - -66->62 - - - - - -65 - -RECEIPTS-SIZE - - - -64->65 - - - - - -61 - -PROOF-MESSAGES-FRACTION - - - -61->62 - - - - - -60 - -AVG-PROOFS-MESSAGES-PER-BLOCK - - - -60->62 - - - - - -59 - -AVG-POSTS-MESSAGES-PER-BLOCK - - - -59->60 - - - - - -58 - -AVG-SEALS-MESSAGES-PER-BLOCK - - - -58->60 - - - - - -56 - -ALL-POST-MESSAGES-PER-YEAR - - - -56->59 - - - - - -57 - -MINERS - - - -57->56 - - - - - -55 - -ALL-SEAL-SIZE-PER-YEAR - - - -54 - -ALL-SEAL-MESSAGES-PER-YEAR - - - -54->58 - - - - - -54->55 - - - - - -53 - -SECTORS-COUNT - - - -53->56 - - - - - -53->54 - - - - - -52 - -STORAGE-NETWORK-CAPACITY - - - -52->53 - - - - - -48 - -PROVING-PERIOD-SECONDS - - - -51 - -POSTS-PER-SECTOR-PER-YEAR - - - -48->51 - - - - - -51->56 - - - - - -50 - -SEALS-PER-SECTOR-PER-YEAR - - - -50->54 - - - - - -49 - -RESEAL - - - -49->50 - - - - - -47 - -PROVING-PERIOD-HOURS - - - -47->48 - - - - - -46 - -MAX-TICKETS - - - -45 - -ONE-BLOCK-IN-TEN-YEARS - - - -45->46 - - - - - -44 - -BLOCKS-IN-TEN-YEARS - - - -44->45 - - - - - -41 - -BLOCKS-IN-A-YEAR - - - -41->59 - - - - - -41->58 - - - - - -41->44 - - - - - -43 - -EXPECTED-WINNING-MINERS - - - -43->41 - - - - - -42 - -YEAR-IN-SECONDS - - - -42->51 - - - - - -42->41 - - - - - -40 - -TICKETS - - - -39 - -AVG-TICKETS - - - -39->40 - - - - - -36 - -POST-CHALLENGE-TIME - - - -38 - -POST-CHALLENGE-BLOCKS - - - -36->38 - - - - - -37 - -BLOCK-TIME - - - -37->41 - - - - - -37->38 - - - - - -35 - -POST-CHALLENGE-HOURS - - - -35->36 - - - - - -33 - -ENCODING-TIME - - - -34 - -KDF-HASH-SIZE - - - -34->33 - - - - - -32 - -KDF-CONTENT - - - -32->33 - - - - - -31 - -NODES - - - -30 - -NODE-SIZE - - - -30->33 - - - - - -30->31 - - - - - -29 - -SECTOR-SIZE-GIB - - - -28 - -SECTOR-SIZE - - - -29->28 - - - - - -28->53 - - - - - -28->31 - - - - - -27 - -DEGREE-EXPANDER - - - -26 - -DEGREE - - - -27->26 - - - - - -26->32 - - - - - -25 - -DEGREE-BASE - - - -25->26 - - - - - -23 - -MESSAGE-RECEIPT - - - -23->65 - - - - - -24 - -GAS-USED - - - -24->23 - - - - - -22 - -RETURN - - - -22->23 - - - - - -21 - -EXIT-CODE - - - -21->23 - - - - - -20 - -MESSAGE-RECEIPTS-CID - - - -12 - -MESSAGE-SIZE - - - -12->63 - - - - - -19 - -ACTOR-METHOD - - - -19->12 - - - - - -18 - -GAS-LIMIT - - - -18->12 - - - - - -17 - -GAS-PRICE - - - -17->12 - - - - - -16 - -VALUE - - - -16->12 - - - - - -15 - -U64 - - - -15->24 - - - - - -15->19 - - - - - -15->18 - - - - - -15->17 - - - - - -15->16 - - - - - -14 - -MESSAGE-NONCE - - - -14->12 - - - - - -13 - -VARINT - - - -13->22 - - - - - -13->21 - - - - - -13->14 - - - - - -11 - -FROM-ADDRESS - - - -11->12 - - - - - -10 - -TO-ADDRESS - - - -10->12 - - - - - -9 - -MESSAGES-ROOT-CID - - - -8 - -ADDRESS-SIZE - - - -8->11 - - - - - -8->10 - - - - - -7 - -CID-SIZE - - - -7->20 - - - - - -7->9 - - - - - -7->8 - - - - - -6 - -EIX - - - -6->52 - - - - - -5 - -PIB - - - -5->6 - - - - - -4 - -TIB - - - -4->5 - - - - - -3 - -GIB - - - -3->28 - - - - - -3->4 - - - - - -2 - -MIB - - - -2->3 - - - - - -1 - -KIB - - - -1->2 - - - - - diff --git a/content/intro/diagrams/overview1/overview.dot.svg b/content/intro/diagrams/overview1/overview.dot.svg deleted file mode 100644 index ecbb292ea..000000000 --- a/content/intro/diagrams/overview1/overview.dot.svg +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - -Filecoin - - -cluster_blockchain_subgroup - - - -cluster_blockchain - -Blockchain - - -cluster_vm - -Filecoin VM - - -cluster_messagepool - -Message Pool - - -cluster_storagepowerconsensus - -Storage Power Consensus - - -cluster_markets - - - -cluster_storagemarket - -Storage Market - - -cluster_retrievalmarket - -Retrieval Market - - -cluster_filesdata - - - -cluster_pieces - -Data Transfers - - -cluster_files - -Local File Storage - - -cluster_storageminerprocess - - - -cluster_storagemining - -Storage Mining - - -cluster_sectorindexer - -Sector Indexer - - -cluster_filproofs_subsystem - -Storage Proving - - -cluster_systems - - - -cluster_repository - -Repository - - -cluster_filproofs_lib - -Filecoin Proofs - - -cluster_payments - -Payments - - -cluster_net - - - -cluster_clock - -Clock - - -cluster_network - -Network Interface - - -cluster_ipfs - -IPFS - - -cluster_libp2p - -libp2p - - - -Chain - -Chain - - - -Block Producer - -Block Producer - - - - -VM Interpreter - -VM Interpreter - - - -Chain->VM Interpreter - - - - - -IPLD DagStore - -IPLD DagStore - - - -Chain->IPLD DagStore - - - - - -Message Storage - -Message Storage - - - -Block Producer->Message Storage - - - - - -Block Syncer - -Block Syncer - - - -Gossipsub - - - - - -Gossipsub - - - -Block Syncer->Gossipsub - - - - - -Messages - -Messages - - - - -Init Actor - - -Init -Actor - - - -Account Actor - - -Account -Actor - - - - -Cron Actor - - -Cron -Actor - - - -Message Syncer - -Message Syncer - - - - -Filecoin Network Node - -Filecoin Network Node - - - - -Message Syncer->Gossipsub - - - - - -Expected Consensus - -Expected Consensus - - - -Storage Power Actor - - -Storage -Power -Actor - - - - -Storage Provider - -Storage -Provider - - - -Storage Provider->Chain - - - - - -Data Transfers - -Data Transfers - - - -Storage Provider->Data Transfers - - - - - -Storage Client - -Storage -Client - - - -Storage Deal Protocol - - - - - -Storage -Deal -Protocol - - - -Storage Market Actor - - -Storage -Market -Actor - - - - - - -Retrieval Provider - -Retrieval -Provider - - - -Retrieval Provider->Chain - - - - - -Retrieval Provider->Data Transfers - - - - - -Retrieval Client - -Retrieval -Client - - - -Retrieval Deal Protocol - - - - - -Retrieval -Deal -Protocol - - - -PieceStore - -PieceStore - - - -Data Transfers->PieceStore - - - - - -Data Transfers Scheduler - -Data Transfers Scheduler - - - -AuthSwap - - - - - -data -transfer -protocol -(unnamed) - - - -Graphsync - - - - - -Graphsync - - - -AuthSwap->Graphsync - - - - - -FileStore - -FileStore - - - -Disk2 - - -Data Storage System -(Disks, etc) - - - -FileStore->Disk2 - - - - - -PieceStore->FileStore - - - - - -Mining Scheduler - -Mining Scheduler - - - -Sector Builder - -Sector Builder - - - -Mining Scheduler->Sector Builder - - - - - -Pledge Prover - -Pledge Prover - - - -Mining Scheduler->Pledge Prover - - - - - -Storage Miner Actor - - -Storage -Miner -Actor - - - -Sector Store - -Sector Store - - - -Sector Store->PieceStore - - - - - -Seal Prover - -Seal Prover - - - -PoSt Generator - -PoSt Generator - - - -PoSt Generator->Chain - - - - - -Pledge Prover->Storage Power Actor - - - - - -Stacked-DRG-Porep - -Stacked-DRG-Porep - - - -Pledge Prover->Stacked-DRG-Porep - - - - - -Config - -Config - - - -Local Storage - - -Local Storage -(Disk) - - - -Config->Local Storage - - - - - -KeyStore - -KeyStore - - - -KeyStore->Local Storage - - - - - -IPLD DagStore->Local Storage - - - - - -Rational PoSt - -Rational PoSt - - - - -Piece Inclusion Proofs - -Piece -Inclusion -Proofs - - - -VRFs - -VRFs - - - -VDFs - -VDFs - - - - - -Wallet - -Wallet - - - -Wallet->KeyStore - - - - - -Payment Channel Actor - - -Payment -Channel -Actor - - - -Wall Clock - -Wall Clock - - - -NTP - -NTP - - - -Wall Clock->NTP - - - - - -Switch - -Switch - - - -NTP->Switch - - - - - - -p2p.Node - -p2p.Node - - - -Graphsync->p2p.Node - - - - - -Bitswap - - - - - -Bitswap - - - -Bitswap->p2p.Node - - - - - -p2p.Node->Switch - - - - - -Switch->KeyStore - - - - - -Conn - -Conn - - - -Switch->Conn - - - - - -Identify - - - - - -Identify - - - -Identify->p2p.Node - - - - - -Gossipsub->p2p.Node - - - - - -Bootstrap List - - - - - -Bootstrap -List - - - -Bootstrap List->p2p.Node - - - - - diff --git a/content/intro/diagrams/overview2/overview2.mmd.css b/content/intro/diagrams/overview2/overview2.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/intro/diagrams/overview2/overview2.mmd.svg b/content/intro/diagrams/overview2/overview2.mmd.svg deleted file mode 100644 index df3f10c3a..000000000 --- a/content/intro/diagrams/overview2/overview2.mmd.svg +++ /dev/null @@ -1,7 +0,0 @@ -
libraries
multiformats
libp2p
ipld
ipfs
libp2pCore
libp2pProtocols
FilecoinNode
Repository
FilesAndData
Pos0
p2p.Node
Bitswap
Graphsync
ipld.Selector
Gossipsub
BootstrapList
multihash
p2p.PeerID
multiaddr
p2p.PeerInfo
ipld.CID
UnixFS
DagImports
ipld.GraphStore
Pos1
P2PNode
Clock
FileStore
Config
IpldStore
KeyStore
Pos2
File
Piece
DataTransfer
\ No newline at end of file diff --git a/content/intro/diagrams/sequence/full-deals-on-chain.mmd b/content/intro/diagrams/sequence/full-deals-on-chain.mmd index d0c4d2fab..7ca9ad453 100644 --- a/content/intro/diagrams/sequence/full-deals-on-chain.mmd +++ b/content/intro/diagrams/sequence/full-deals-on-chain.mmd @@ -72,9 +72,9 @@ sequenceDiagram opt ClientQuery StorageMarketParticipant1 ->>+ StorageMarketParticipant2: QueryStorageDealProposalStatus(StorageDealProposalQuery) - StorageMarketParticipant1 -->>- StorageMarketParticipant2: StorageDealProposalQueryResponse + StorageMarketParticipant2 -->>- StorageMarketParticipant1: StorageDealProposalQueryResponse StorageMarketParticipant1 ->>+ StorageMarketParticipant2: QueryStorageDealStatus(StorageDealQuery) - StorageMarketParticipant1 -->>- StorageMarketParticipant2: StorageDealQueryResponse + StorageMarketParticipant2 -->>- StorageMarketParticipant1: StorageDealQueryResponse end opt SealingSector diff --git a/content/intro/diagrams/sequence/full-deals-on-chain.mmd.css b/content/intro/diagrams/sequence/full-deals-on-chain.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/intro/diagrams/sequence/full-deals-on-chain.mmd.svg b/content/intro/diagrams/sequence/full-deals-on-chain.mmd.svg deleted file mode 100644 index 93169392d..000000000 --- a/content/intro/diagrams/sequence/full-deals-on-chain.mmd.svg +++ /dev/null @@ -1,7 +0,0 @@ -RetrievalClientRetrievalProviderStorageMarketParticipant1StorageMarketParticipant2StorageMarketActorPaymentChannelActorPaymentSubsystemBlockchainSubsystemBlockSyncerBlockProducerStoragePowerConsensusSubsystemStoragePowerActorStorageMiningSubsystemStorageMinerActorSectorIndexerSubsystemStorageProvingSubsystemFilecoinProofsSubsystemClockSubsystemlibp2pStorageMarketParticipantSectorSealerWallClockBlockchainMessagePoolMiningSchedulerStorageMinerSubsystemRetrievalMarketSubsystemStorageMarketSubsystemBlockchainGroupMiningGroupNewRetrievalQuery(RetreivalQuery)RetrievalQueryResponseNewRetrievalDealProposal(RetrievalDealProposal)AcceptRetrievalDealProposal(RetrievalDealPropsal)NewPaymentChannelopt[ RetrievalMarket ]CreateMiner(ownerPubKey PubKey, workerPubKey PubKey, pledgeAmt TokenAmount)CreateStorageMiner(OwnerAddr, WorkerPubKey)StorageMinerActoropt[ RegisterStorageMiner ]RegisterParticipant(TokenAmount)AddBalance(TokenAmount)WithdrawBalance(TokenAmount)CheckLockedBalance(Address)TokenAmountNewStorageDealProposal(StorageDealProposal)VerifyBalance(StorageMarketParticipant1)SignStorageDealProposal(StorageDealProposal)NewStorageDeal(StorageDeal)PublishStorageDeal(StorageDeal)PublishStorageDeal(StorageDeal)opt[ StorageDealMake ]HandleStorageDeal(Deal)AddDealToSector(Deal, SectorID)IndexSectorByDealExpiration(SectorID, Deal)(SectorID, Deal)NotifyStorageDealStaged(Deal,SectorID)opt[ AddingDealToSector ]QueryStorageDealProposalStatus(StorageDealProposalQuery)StorageDealProposalQueryResponseQueryStorageDealStatus(StorageDealQuery)StorageDealQueryResponseopt[ ClientQuery ]GetSealSeed(Chain, Epoch)SeedSealSector(Seed, SectorID, ReplicaCfg)Seal(Seed, SectorID, ReplicaCfg)SealOutputsSealOutputsCommitSector(Seed, SectorID, SealCommitment, SealProof, [&Deal], [Deal])VerifySeal(SectorID, OnSectorInfo){1,0}AddDeal(SectorID, [&Deal], DealStatusOnChain)AddDeal(SectorID, [Deal], DealStatusPending)IncrementPower(StorageMiner.WorkerPubKey)CommitSectorErroralt[ 1 - success ][ 0 - failure ]opt[ CommitSector ]opt[ SealingSector ]Subscribe(OnNewBlock)Event(OnNewBlock, block)ValidateBlockSyntax(block)HandleBlock(block)ValidateBlock(block)ValidateBlock(block)ValidateBlock(block)StateTree ← TryGenerateStateTree(block)AssembleTipsets()[Tipset] ← AssembleTipsets()Tipset ← ChooseTipset([Tipset])ApplyStateTree(StateTree)opt[ Round Cutoff ]loop[ BlockReception ]OnNewTipset(Chain, Epoch)OnNewRound()epoch is incremented by 1alt[ New Tipset ][ Null block last round ]GetElectionArtifacts(Chain, Epoch)TK ← TicketAtEpoch(Chain, Epoch-k)T1 ← TicketAtEpoch(Chain, Epoch-1)TK, T1EP ← DrawElectionProof(TK.randomness(), StorageMiner.WorkerKey)T0 ← GenerateNextTicket(T1.randomness(), StorageMiner.WorkerKey)T1 ← GenerateNextTicket(T0.randomness(), StorageMiner.WorkerKey)Using tickets derived in failed election proof in last epochalt[ New Tipset ][ Null block last round ]TryLeaderElection(EP){1, 0}GetPoStChallenge(Chain, Epoch)challengeGeneratePoSt(challenge, [SectorID])PoStProofSubmitPoSt(PoStProof, DoneSet)VerifyPoSt(PoStProof){1,0}UpdateDoneSet()HandleStorageDealPayment()CloseExpiredStorageDeal()PoStErrorSlashStorageCollateral()alt[ 1 - success ][ 0 - failure ]opt[ SubmitPoSt ]GenerateBlock(EP, T0, Tipset, StorageMiner.Address)GetMostProfitableMessages(StorageMiner.Address)[Message]block ← AssembleBlock([Message], Tipset, EP, T0, StorageMiner.Address)PropagateBlock(block)opt[ 1- success ]loop[ forEach StorageMiningSubsystem.StorageMiner ]loop[ BlockProduction ]OnNewTipset(Chain, Epoch)[SectorID] ← LookupSectorByDealExpiry(Epoch)PurgeSectorsWithNoLiveDeals([SectorID])HandleExpiredDeals([SectorID])CloseExpiredStorageDeal(StorageDeal)opt[ Expired deals ]Schedule and resume PoStsSchedule and resume SEALsMaintain FaultSetMaintain DoneSetopt[ MiningScheduler ]PoSt challenge if a node has not mined a block in a ProvingPeriodGetPoStChallenge(Chain, Epoch)challengeGeneratePoSt(challenge, [SectorID])PoStProofSubmitPoSt(PoStProof, DoneSet)VerifyPoSt(PoStProof){1,0}UpdateDoneSet()HandleStorageDealPayment()CloseExpiredStorageDeal()PoStErrorSlashStorageCollateral()alt[ 1 - success ][ 0 - failure ]opt[ SubmitPoSt ]opt[ ClockSubsystem ]UpdateSectorStatus([FaultSet], SectorStateSets)RecomputeMinerPower()SlashStorageCollateral()SectorStateSets := (FaultSet, RecoverSet, ExpireSet)opt[ Declaration before receiving a challenge ]ProvingPeriodUpdate()computeProvingPeriodEndSectorState()FaultSet is all sectors if no post submittedsectors Faulted longer than threshold proving periods are destroyedUpdateSectorStatus(newSectorState)RecomputeMinerPower()HandleFailedDeals([newSectorState.DestroyedSet])opt[ if miner ProvingPeriod ends ]loop[ forEach StorageMinerActor in StoragePowerActor.Miners ]loop[ EveryBlock ]opt[ Storage Fault ]DeclareConsensusFault(ConsensusFaultProof)ValidateFault(ConsensusFaultProof)TerminateMiner(Address)SlashPledgeCollateral(Address)UpdateBalance(Reward)opt[ Valid Fault ]opt[ Consensus Fault ]RetrievalClientRetrievalProviderStorageMarketParticipant1StorageMarketParticipant2StorageMarketActorPaymentChannelActorPaymentSubsystemBlockchainSubsystemBlockSyncerBlockProducerStoragePowerConsensusSubsystemStoragePowerActorStorageMiningSubsystemStorageMinerActorSectorIndexerSubsystemStorageProvingSubsystemFilecoinProofsSubsystemClockSubsystemlibp2pStorageMarketParticipantSectorSealerWallClockBlockchainMessagePoolMiningSchedulerStorageMinerSubsystem \ No newline at end of file diff --git a/content/systems/filecoin_blockchain/chainsync/_index.md b/content/systems/filecoin_blockchain/chainsync/_index.md index a43a755a8..5d5d40c18 100644 --- a/content/systems/filecoin_blockchain/chainsync/_index.md +++ b/content/systems/filecoin_blockchain/chainsync/_index.md @@ -176,8 +176,7 @@ implementations MAY deviate from implementing precisely these states, or dividin Implementations MAY blur the lines between the states. If so, implementations MUST ensure security of the altered protocol. -{{< svg src="chainsync_fsm.dot.svg" title="ChainSync State Machine" >}} - +![ChainSync State Machine](chainsync_fsm.dot) ### ChainSync FSM: `INIT` diff --git a/content/systems/filecoin_blockchain/chainsync/chainsync_fsm.dot.svg b/content/systems/filecoin_blockchain/chainsync/chainsync_fsm.dot.svg deleted file mode 100644 index be256c7d9..000000000 --- a/content/systems/filecoin_blockchain/chainsync/chainsync_fsm.dot.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - -sector - - - -INIT - -INIT - - - -init2boot - -prepare and verify -all internal state - - - - -INIT->init2boot - - - - -follow2init - -on shut down node - - - - -INIT->follow2init - - - - - -BOOTSTRAP - -BOOTSTRAP - - - -boot2check - -done bootstrapping. -DO NOT -   have state for -LastTrustedCheckpoint - - - - -BOOTSTRAP->boot2check - - - - -boot2catch - -done bootstrapping. -DO -   have state for -LastTrustedCheckpoint - - - - -BOOTSTRAP->boot2catch - - - - -SYNC_CHECKPOINT - -SYNC_CHECKPOINT - - - -check2catch - -done getting state for -LastTrustedCheckpoint - - - - -SYNC_CHECKPOINT->check2catch - - - - -CHAIN_CATCHUP - -CHAIN_CATCHUP - - - -catch2follow - -done validating -up to -BestTargetHead - - - - -CHAIN_CATCHUP->catch2follow - - - - -follow2catch - -new unvalidated gap between -ValidG -   and -BestTargetHead - - - - -CHAIN_CATCHUP->follow2catch - - - - - -CHAIN_FOLLOW - -CHAIN_FOLLOW - - - -init2boot->BOOTSTRAP - - - - - -boot2check->SYNC_CHECKPOINT - - - - - -boot2catch->CHAIN_CATCHUP - - - - - -check2catch->CHAIN_CATCHUP - - - - - -catch2follow->CHAIN_FOLLOW - - - - - -follow2catch->CHAIN_FOLLOW - - - - diff --git a/content/systems/filecoin_files/data_transfer/_index.md b/content/systems/filecoin_files/data_transfer/_index.md index 55c76bca2..0305f594f 100644 --- a/content/systems/filecoin_files/data_transfer/_index.md +++ b/content/systems/filecoin_files/data_transfer/_index.md @@ -22,8 +22,7 @@ This diagram shows how Data Transfer and its modules fit into the picture with t In particular, note how the Data Transfer Request Validators from the markets are plugged into the Data Transfer module, but their code belongs in the Markets system. -{{
}} - +![Data Transfer](data-transfer-modules.png) ## Terminology @@ -55,7 +54,7 @@ It is worth noting that in the case of retrieval the provider can accept the dea ### Push Flow -{{}} +![Data Transfer - Push Flow](push-flow.mmd) 1. A requestor initiates a Push transfer when it wants to send data to another party. 2. The requestors' data transfer module will send a push request to the responder along with the data transfer voucher. @@ -71,7 +70,7 @@ once the provider indicates their intent to accept and publish the client's deal ## Pull Flow - Single Round Trip -{{< svg src="alternate-pull-flow.mmd.svg" title="Data Transfer - Single Round Trip Pull Flow" >}} +![Data Transfer - Single Round Trip Pull Flow](alternate-pull-flow.mmd) 1. A requestor initiates a Pull transfer when it wants to receive data from another party. 2. The requestor’s data transfer module initiates the transfer by making a pull request embedded in the GraphSync request to the responder. The request includes the data transfer voucher. diff --git a/content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd.css b/content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd.svg b/content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd.svg deleted file mode 100644 index 998815267..000000000 --- a/content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd.svg +++ /dev/null @@ -1,7 +0,0 @@ -RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)ResponderOne System. Likely A ClientOne System. Likely A MinerInitiate PullSchedule TransferMake Graphsync Request w/ Data Transfer Request Piggy BackedSend Graphsync Request (w/ Data Transfer Request)Verify Request (validate & schedule)Validate Pull RequestPull Request validatedSchedule TransferSend response w/ DTR Accepted Piggy BackedSend response w/ DTR Accepted Piggy BackedResponse Progress (to end) (include DT Accepted)Request CompleteRequest Completed (if listening)RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)Responder \ No newline at end of file diff --git a/content/systems/filecoin_files/data_transfer/pull-flow.mmd.css b/content/systems/filecoin_files/data_transfer/pull-flow.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_files/data_transfer/pull-flow.mmd.svg b/content/systems/filecoin_files/data_transfer/pull-flow.mmd.svg deleted file mode 100644 index ab23a0a44..000000000 --- a/content/systems/filecoin_files/data_transfer/pull-flow.mmd.svg +++ /dev/null @@ -1,7 +0,0 @@ -RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)ResponderOne System. Likely A ClientOne System. Likely A MinerInitiate PullSend Data Transfer RequestValidate Pull RequestPull Request validatedSchedule TransferSend Data Transfer Request AcceptedSchedule TransferMake Graphsync RequestSend Graphsync RequestVerify Transfer ScheduledRequest is scheduledSend ResponseResponse Progress (to end)Request CompleteRequest Completed (if listening)RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)Responder \ No newline at end of file diff --git a/content/systems/filecoin_files/data_transfer/push-flow.mmd.css b/content/systems/filecoin_files/data_transfer/push-flow.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_files/data_transfer/push-flow.mmd.svg b/content/systems/filecoin_files/data_transfer/push-flow.mmd.svg deleted file mode 100644 index dd403630a..000000000 --- a/content/systems/filecoin_files/data_transfer/push-flow.mmd.svg +++ /dev/null @@ -1,7 +0,0 @@ -RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)ResponderOne system. Likely A ClientOne system. Likely A MinerInitiate PushSchedule TransferSend Data Transfer RequestValidate Push RequestPush Request validatedSchedule TransferMake Graphsync RequestSend Graphsync RequestVerify Transfer ScheduledRequest is scheduledSend ResponseResponse Progress (to end)Request CompleteRequest Completed (if listening)RequestorData Transfer Module (Requestor)Scheduler (Requestor)Graphsync (Requestor)Graphsync (Responder)Scheduler (Responder)Data Transfer Module (Responder)Responder \ No newline at end of file diff --git a/content/systems/filecoin_files/piece/_index.md b/content/systems/filecoin_files/piece/_index.md index 6c4dc8cc7..63227d339 100644 --- a/content/systems/filecoin_files/piece/_index.md +++ b/content/systems/filecoin_files/piece/_index.md @@ -21,7 +21,7 @@ of a piece and its proving tree, including both full and bandwidth-optimized piece data structures. -{{< figure src="pieces.png" title="Pieces, Proving Trees, and Piece Data Structures" zoom="true">}} +![Pieces, Proving Trees, and Piece Data Structures](pieces.png) {{< embed src="piece.id" lang="go" >}} diff --git a/content/systems/filecoin_markets/retrieval_market/_index.md b/content/systems/filecoin_markets/retrieval_market/_index.md index ea72a92c4..428b8794a 100644 --- a/content/systems/filecoin_markets/retrieval_market/_index.md +++ b/content/systems/filecoin_markets/retrieval_market/_index.md @@ -31,7 +31,7 @@ The Data Transfer System is augmented accordingly to support pausing/resuming an ## Deal Flow in the Retrieval Market -{{}} +![Retrieval Flow](retrieval_flow_v1.mmd) The Filecoin Retrieval Market protocol for proposing and accepting a deal works as follows: diff --git a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v0.mmd.css b/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v0.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v0.mmd.svg b/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v0.mmd.svg deleted file mode 100644 index 9675ed78b..000000000 --- a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v0.mmd.svg +++ /dev/null @@ -1,4 +0,0 @@ -RetrievalClientNodeRetrievalProviderBlockStore (Client)BlockStore (Provider)Storage Miner SubsystemQuery Chain For Providers w/ PieceIDProviders With PieceIDopt[ Discovery ]Send Query for PieceSend information about Piece (price, size, etc)Send RetrievalDealProposalSend RetrievalDealResponse, acceptingCreate Payment ChannelMessage For Channel Gets On Chainopt[ Create Payment Channel ]Unseal SectorUnsealed Piece DataWrite Piece Blocks to BlockStoreBlocks writtenopt[ Unsealing ]Read Blocks from BlockStoreBlocksSend BlocksVerify BlocksWrite BlocksBlocks writtenloop[ Sending Data until Payment Required ]Request PaymentCreate Voucher On Payment ChannelMessage For Voucher Gets On ChainSend Reference To Payment VoucherRedeem Voucher On Payment ChannelMessage For Voucher Redeemed On Chainloop[ Retrieve In Pieces ]RetrievalClientNodeRetrievalProviderBlockStore (Client)BlockStore (Provider)Storage Miner Subsystem \ No newline at end of file diff --git a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v1.mmd.css b/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v1.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v1.mmd.svg b/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v1.mmd.svg deleted file mode 100644 index aed2b908f..000000000 --- a/content/systems/filecoin_markets/retrieval_market/retrieval_flow_v1.mmd.svg +++ /dev/null @@ -1,4 +0,0 @@ -RetrievalClientData Transfer SubsystemRetrievalProviderNodeBlockStore (Client)BlockStore (Provider)Storage Miner SubsystemQuery Chain For Providers w/ PieceIDProviders With PieceIDopt[ Discovery ]Send Query for PieceSend information about Piece (price, size, etc)Open Pull Data Transfer w/ RetrievalDealProposal voucherValidate RetrievalDealProposalData Transfer AcceptedUpdate Transfer In ProgressPauseCreate Payment ChannelMessage For Channel Gets On ChainUnpauseopt[ Create Payment Channel ]PauseUnseal SectorUnsealed Piece DataWrite Piece Blocks to BlockStoreBlocks writtenUnpauseopt[ Unsealing ]Read Blocks from BlockStoreBlocksHandle Send+Verify Of BlocksWrite BlocksBlocks writtenloop[ Sending Data until Payment Required ]PauseSend Request Payment Intermediate VoucherValidate Request Payment VoucherCreate Voucher On Payment ChannelMessage For Voucher Gets On ChainSend Reference To Payment VoucherValidate Reference To Payment VoucherRedeem Voucher On Payment ChannelMessage For Voucher Redeemed On ChainUnpauseloop[ Retrieve In Pieces ]Update Transfer CompleteRetrievalClientData Transfer SubsystemRetrievalProviderNodeBlockStore (Client)BlockStore (Provider)Storage Miner Subsystem \ No newline at end of file diff --git a/content/systems/filecoin_markets/storage_market/_index.md b/content/systems/filecoin_markets/storage_market/_index.md index 5ac9fa9ab..df61b96d7 100644 --- a/content/systems/filecoin_markets/storage_market/_index.md +++ b/content/systems/filecoin_markets/storage_market/_index.md @@ -36,7 +36,7 @@ The remaining parts of the deal lifecycle are handled by the Storage Mining Subs The following diagram outlines the phases of deal flow within the storage market in detail: -{{}} +![Storage Market Deal Flow](storage_market_flow.mmd) ## Discovery diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.css b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd index 84a977ba4..316099159 100644 --- a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd +++ b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd @@ -12,7 +12,7 @@ StorageClient -->+ DataTransfer: OpenPushTransferRequest(provider, voucher, payl DataTransfer -->+ StorageProvider: ValidatePush(client, voucher, payload, selector) StorageProvider -->- DataTransfer: accept DataTransfer -->- StorageProvider: OnDataTransferEvent(DataTransferComplete, state) -activeate StorageProvider +activate StorageProvider StorageProvider -->> StorageProvider: verifyStorageDealProposal(proposal) StorageProvider -->> StorageProvider: verifyPieceCID(proposal, payloadCID) StorageProvider -->> StorageProvider: signStorageDealProposal(proposal) diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd.svg b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd.svg deleted file mode 100644 index dcd081b7b..000000000 --- a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-flow.mmd.svg +++ /dev/null @@ -1,494 +0,0 @@ -StorageClientStorageProviderStorageMiningSubsystemStorageMarketActorStorageMinerActorCronActorAddBalance()AddBalance()OnNewStorageDealProposal(proposal, payloadCID)NotifyOfStorageDealProposalStatus(ProposalRejected)OnNewStorageDealProposal(proposal, payloadCID)NotifyOfStorageDealProposalStatus(ProposalAccepted)graphsync.Pull(payloadCID)graphsync.Push(payload IPLD)OnReceivingPayload(payloadCID)verifyStorageDealProposal(proposal)verifyPieceCID(proposal, payloadCID)signStorageDealProposal(proposal)NotifyOfStorageDealProposalStatus(ProposalSigned)publishStorageDealMessage(message)PublishStorageDeal(message)generateStorageDealID()lockFund()dealIDNotifyOfStorageDealStatus(DealPublished)HandleStorageDeal(deal)CommitSector()NotifyOfStorageDealStatus(DealCommitted)NotifyOfPoStChallenge()SubmitPoSt()activateSectorNotifyOfOnChainDealStatus(DealActive)NotifyOfStorageDealStatus(DealActive)NotifyOfPoStChallenge()/CheckPoStSubmissionHappened()NotifyOfOnChainDealStatus(DealExpired/DealFailing)NotifyOfStorageDealStatus(DealExpired/DealFailing)StorageClientStorageProviderStorageMiningSubsystemStorageMarketActorStorageMinerActorCronActor \ No newline at end of file diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-payment.css b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-payment.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-payment.mmd.svg b/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-payment.mmd.svg deleted file mode 100644 index 595dfd476..000000000 --- a/content/systems/filecoin_markets/storage_market/storage_deal/diagrams/deal-payment.mmd.svg +++ /dev/null @@ -1,494 +0,0 @@ -StorageMiningSubsystemStorageMinerActorStorageMarketActorPublishStorageDeals_validateNewStorageDeal_assertValidClienSignature_assertValidDealTimingAtPublish_assertValidDealMinimum_assertSufficientBalanceAvailableForDeal_lockFundsForStorageDeal_generateStorageDealIDDealIDsPreCommitSectorVerifyPublishedDealIDs(dealIDs)_assertPublishedDealState_assertDealStartAfterCurrEpoch_assertDealExpireAfterMaxProveCommitWindowSuccessProveCommitSectorActivateDeals(dealIDs)_assertPublishedDealState_assertDealNotYetExpired_activateDeal(publishedDeal)Deals_initializeUtilizationInfo_onSuccessfulPoStProcessDealPayment_assertActiveDealState_getStorageFeeSinceLastPayment_transferBalance_submitPowerReport (if any deal expires)ProcessDealExpiration_assertActiveDealState_getStorageFeeSinceLastPayment_transferBalance_unlockCollateral_submitFaultReport(if TerminatedFault)ProcessDealSlash_slashTerminatedFaults_assertActiveDealState_terminateDealWithdrawBalancefundStorageMiningSubsystemStorageMinerActorStorageMarketActor \ No newline at end of file diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_flow.md b/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_flow.md index 613e6efd5..52be08103 100644 --- a/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_flow.md +++ b/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_flow.md @@ -10,7 +10,7 @@ dashboardTests: 0 # Storage Deal Flow --- -{{}} +![Deal Flow Sequence Diagram](diagrams/deal-flow.mmd) ## Add Storage Deal and Power diff --git a/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_states.md b/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_states.md index 5b1d87bde..e5e2c3865 100644 --- a/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_states.md +++ b/content/systems/filecoin_markets/storage_market/storage_deal/storage_deal_states.md @@ -37,4 +37,4 @@ Given deal states and their transitions, the following are the relationships bet - `Deal Payment`: happens on `_onSuccessfulPoSt` and at deal/sector expiration through `_submitPowerReport`, paying out `StoragePricePerEpoch` for each epoch since the last PoSt. - `Deal Collateral`: no storage deal collateral will be slashed for `NewDeclaredFaults` and `NewDetectedFaults` but instead some pledge collateral will be slashed given these faults' impact on consensus power. In the event of `NewTerminatedFaults`, all storage deal collateral and some pledge collateral will be slashed. Provider and client storage deal collaterals will be returned when a deal or a sector has expired. If a sector recovers from `Failing` within the `MAX_CONSECUTIVE_FAULTS` threshold, deals in that sector are still considered active. However, miners may need to top up pledge collateral when they try to `RecoverFaults` given the earlier slashing. -{{}} \ No newline at end of file +![Deal States Sequence Diagram](diagrams/deal-payment.mmd) \ No newline at end of file diff --git a/content/systems/filecoin_markets/storage_market/storage_market_flow.mmd.css b/content/systems/filecoin_markets/storage_market/storage_market_flow.mmd.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/systems/filecoin_markets/storage_market/storage_market_flow.mmd.svg b/content/systems/filecoin_markets/storage_market/storage_market_flow.mmd.svg deleted file mode 100644 index 380ce291f..000000000 --- a/content/systems/filecoin_markets/storage_market/storage_market_flow.mmd.svg +++ /dev/null @@ -1,6 +0,0 @@ -StorageClientData TransferStorageProviderNodeStorageMarketActorStorage Mining SubsystemDiscoveryDiscovering MinersList Miner Actors from chain stateList of Miner ActorsQuery actor properties from chain stateMiner actor properties from chain stateloop[ Each Miner Actor ]Querying For AsksSend Query For Current AskCurrent Storage Askloop[ each StorageProvider ]NegotiationProposing a dealAdd funds for a deal as neccesaryFunds addedCalculate piece commitmentPropose a dealVerifying a dealVerify deal parameters (price, size, etc)Check StorageClient balanceClient balanceVerify balance greater that total storage priceIndicate Intent To Accept DealTransferring DataOpen push request to clientSend push request to providerAccept and request dataSend request for dataSend DataFinished Sending DataNotify data transfer completeVerify data matches piece commitmentEnsuring CollateralAdd collateral for deal as neededCollateral addedPublishingPutting Deal On ChainSign Deal ProposalPublish Deal On ChainDeal Accepted (w/ Publish Message CID)Deal PublishedVerify Deal PublishedVerify Publish Message Appears On ChainDeal PublishedHandoffStorageMiner Handoff And SealingAdd PieceStorage Miner adds piece to sector precommits, seals sector, activates deal See Storage Mining Subsystem for more detailStorageClientData TransferStorageProviderNodeStorageMarketActorStorage Mining Subsystem \ No newline at end of file diff --git a/content/systems/filecoin_mining/sector/_index.md b/content/systems/filecoin_mining/sector/_index.md index 4948c89c8..1f0d8f33c 100644 --- a/content/systems/filecoin_mining/sector/_index.md +++ b/content/systems/filecoin_mining/sector/_index.md @@ -20,7 +20,7 @@ Once a sector is full, the unsealed sector is combined by a proving tree into a This diagram shows the composition of an unsealed sector and a sealed sector. -{{
}} +![Unsealed Sectors and Sealed Sectors](sectors.png) {{
}} diff --git a/content/systems/filecoin_mining/storage_mining/_index.md b/content/systems/filecoin_mining/storage_mining/_index.md index 2f26aec37..f61000fbc 100644 --- a/content/systems/filecoin_mining/storage_mining/_index.md +++ b/content/systems/filecoin_mining/storage_mining/_index.md @@ -42,9 +42,9 @@ Sectors enter `Active` from `PreCommit` through a ProveCommit message that serve A particular sector enters `TemporaryFault` from `Active` through `DeclareTemporaryFault` with a specified period. Power associated with the sector will be lost immediately and miner needs to pay a `TemporaryFaultFee` determined by the power suspended and the duration of suspension. At the end of the declared duration, faulted sectors automatically regain power and enter `Active`. Miners are expected to prove over this recovered sector. Failure to do so may result in failing ElectionPoSt or `DetectedFault` from failing SurprisePoSt. -{{}} +![Sector State Machine](diagrams/sector_state_machine.dot) -{{}} +![Sector State Machine Legend](diagrams/sector_state_machine_legend.dot) #### Miner PoSt State @@ -60,7 +60,7 @@ A particular sector enters `TemporaryFault` from `Active` through `DeclareTempor Miners can call ProveCommit to commit a sector and add to their Claimed Power. However, a miner's Nominal Power and Consensus Power will be zero when it is in either Challenged or DetectedFault state. Note also that miners can call DeclareTemporaryFault when they are in Challenged or DetectedFault state. This does not change the list of sectors that are currently challenged which is a snapshot of all active sectors (ProvingSet) at the time of challenge. -{{}} +![Miner PoSt State Machine](diagrams/miner_post_state_machine.dot) -{{}} +![Miner PoSt State Machine Legend](diagrams/miner_post_state_machine_legend.dot) diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine.dot.svg deleted file mode 100644 index 3ef6b79de..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine.dot.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - -miner_post - - -cluster_0 - -Lose power on all sectors - - - -OK - - -OK - - - -Challenged - -Challenged - - - -OK->Challenged - - - - - -Challenged->OK - - - - - -DetectedFault - -DetectedFault - - - -Challenged->DetectedFault - - - - - - -DetectedFault->OK - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.dot.svg deleted file mode 100644 index 188482306..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.dot.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -%3 - - -cluster_01 - -Legend - - - -key -OnSurprisePoStChallenge: OK - Challenged -OnMinerSurprisePoStSuccess: Challenged - OK -OnMinerSurprisePoStSuccess: DetectedFault - OK -OnMinerSurprisePoStFailure: Challenged - DetectedFault - - - -key2 -  -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.svg b/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.svg deleted file mode 100644 index 659e4cba2..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.svg +++ /dev/null @@ -1,52 +0,0 @@ - - -%0 - - -cluster_01 - -Legend - - - -key -OnSurprisePoStChallenge: OK - Challenged -OnMinerSurprisePoStSuccess: Challenged - OK -OnMinerSurprisePoStSuccess: DetectedFault - OK -OnMinerSurprisePoStFailure: Challenged - DetectedFault - - - -key2 -  -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - \ No newline at end of file diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/mining_cycle.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/mining_cycle.dot.svg deleted file mode 100644 index 0beab99d8..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/mining_cycle.dot.svg +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -mining_cycle - - -cluster_local - -Storage Miner -(off chain) - - -cluster_local_mining - -Mining - - -cluster_chain - -Storage Miner Actor -(on chain) - - - -ActiveL - -ActiveL - - - -ChallengedL - -ChallengedL - - - - -ActiveL->ChallengedL - - -Chain issues challenge -(implicit) - - - -ActiveC - -ActiveC - - - -ActiveL->ActiveC - - -Add Sectors -(sm.CommitSector) - - - -ProducePost -Produce & submit PoSt -(sm.SubmitPost) - - - -ChallengedL->ProducePost - - - - -OwnerAccountC - -OwnerAccountC - - - - -OwnerAccountC->ActiveC - - -Create Miner -(spa.CreateMiner) - - - -ActiveC->ActiveL - - -Miner Created - - - -OwnerAccL -OwnerAccL - - - -OwnerAccL->ActiveC - - -Create Miner -(spa.CreateMiner) - - - -ProducePost->ActiveL - - - - - -ProducePost->ActiveC - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_chain_fsm.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_chain_fsm.dot.svg deleted file mode 100644 index d38ba6299..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_chain_fsm.dot.svg +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - -sector - - -cluster_chain - -Sector States in StorageMinerActor -(on chain) - - -cluster_postproving - -Proving Set - - -cluster_nopowerC1 - -Does not count for power - - -cluster_nopowerC2 - -Does not count for power - - -cluster_activate - - - -cluster_powerC - -Counts for power - - -cluster_nopowerC2 - -Does not count for power - - -cluster_expire_by_post - - - - -CommittedC - -Committed - - - -FirstPoSt - -1st PoSt -(sm.SubmitPost) -ActivateSectors - - - -CommittedC->FirstPoSt - - - - -ActiveC - -Active - - - - - -ExpireByPost - -Expiration Reached -(sma.CronTick --> sm.ExpireSectors) - - - -CommittedC->ExpireByPost - - - - -FaultsDeclared - -Fault Declared -(sm.DeclareFaults) - - - -CommittedC->FaultsDeclared - - - - -FaultSpotted - -Fault Spotted -(ca.CronTick --> sm.PostFailed) - - - -CommittedC->FaultSpotted - - - - -RecoveringC - -Recovering - - - -RecoveringC->FirstPoSt - - - - -RecoveringC->ExpireByPost - - - - -RecoveringC->FaultsDeclared - - - - -RecoveringC->FaultSpotted - - - - -FirstPoSt->ActiveC - - - - - -ActiveC->ExpireByPost - - - - -ActiveC->FaultsDeclared - - - - - -ActiveC->FaultSpotted - - - - - -FaultedC - -Faulted - - - -FaultedC->RecoveringC - - -sm.RecoverFaults - - - -ExpiredC - -Cleared - - - -FaultedC->ExpiredC - - -Expiry epoch reached -(sma.CronTick --> sm.ExpireSectors) - - - -FaultedC->ExpiredC - - -Faulted 3+ times -(sma.CronTick --> sm.SectorCleanup) - - - - - -ExpireByPost->ExpiredC - - - - - -FaultsDeclared->FaultedC - - - - - - -FaultSpotted->FaultedC - - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm.dot.svg deleted file mode 100644 index 1a8419454..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm.dot.svg +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - -sector - - -cluster_local - -Sector States in Storage Miner -(off chain) - - -cluster_power - - - -cluster_chain - -Sector States in StorageMinerActor -(on chain) - - -cluster_postproving - -must be proved in post - - -cluster_nopowerC1 - -Does not count for power - - -cluster_powerC - -Counts for power - - -cluster_nopowerC2 - -Does not count for power - - - -Empty - -Empty - - - -Packing - -Packing - - - - -Empty->Packing - - -Add Deal - - - -Packing->Packing - - - - - -Unsealed - -Unsealed - - - - -Packing->Unsealed - - -Sector is full - - - -Sealed - -Sealed - - - - -Unsealed->Sealed - - -Seal - - - -NotProving - -Not Proving - - - - -Proving - -Proving - - - -Sealed->Proving - - -Commit -(sm.CommitSector) - - - -CommittedC - -Unproven - - - -Sealed->CommittedC - - -Commit Sector -(sm.CommitSector) - - - -Deleted - -Deleted - - - - -NotProving->Deleted - - -Give up on recovery -or -Expiry - - - -NotProving->Proving - - -Recover -(sm.SubmitPost) - - - -FaultsDeclared - -Fault Declared -(sm.DeclareFaults) - - - -NotProving->FaultsDeclared - - - - -FaultSpotted - -Fault Spotted -(sma.CronTick --> sm.PostFailed) - - - -NotProving->FaultSpotted - - - - - - -Proving->NotProving - - -Lost data -or -Stopped Proving - - - -Proving->Proving - - - - - -FirstPost -1st PoSt -(sm.SubmitPost -->sm.ActivateSector) - - - -Proving->FirstPost - - - - - - -CommittedC->Proving - - -Commit Sector -(wait for commit) - - - - - -CommittedC->FirstPost - - - - -CommittedC->FaultsDeclared - - - - -CommittedC->FaultSpotted - - - - -ActiveC - -Active - - - -ExpiredC - -Deleted - - - -ActiveC->ExpiredC - - -Expiry epoch reached -(sm.SubmitPost --> sm.ExpireSectors) - - - - -ActiveC->FaultsDeclared - - - - -ActiveC->FaultSpotted - - - - - -FirstPost->ActiveC - - - - - - - -FaultedC - -Faulted - - - -FaultedC->CommittedC - - -Recover -(sm.SubmitPost) - - - -FaultedC->ExpiredC - - -Expiry epoch reached -(sma.CronTick --> sm.ExpireSectors) - - - -FaultedC->ExpiredC - - -Faulted 3+ times -(sma.CronTick --> sm.SectorCleanup) - - - - - - - - -FaultsDeclared->FaultedC - - - - - -FaultSpotted->FaultedC - - - - - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm_chain.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm_chain.dot.svg deleted file mode 100644 index de227c50c..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_fsm_chain.dot.svg +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -sector - - -cluster_chain - -Sector States in StorageMinerActor -(on chain) - - -cluster_postproving - -must be proved in post - - -cluster_nopowerC1 - -Does not count for power - - -cluster_powerC - -Counts for power - - -cluster_nopowerC2 - -Does not count for power - - - -CommittedC - -Unproven - - - -ActiveC - -Active - - - -CommittedC->ActiveC - - -1st PoSt -(sm.SubmitPost -->sm.ActivateSector) - - - - - -FaultsDeclared - -Fault Declared -(sm.DeclareFaults) - - - -CommittedC->FaultsDeclared - - - - -FaultSpotted - -Fault Spotted -(sma.CronTick --> sm.PostFailed) - - - -CommittedC->FaultSpotted - - - - -ExpiredC - -Deleted - - - -ActiveC->ExpiredC - - -Expiry epoch reached -(sm.SubmitPost --> sm.ExpireSectors) - - - -ActiveC->FaultsDeclared - - - - - -ActiveC->FaultSpotted - - - - - -FaultedC - -Faulted - - - -FaultedC->CommittedC - - -Recover -(sm.SubmitPost) - - - -FaultedC->ExpiredC - - -Expiry epoch reached -(sma.CronTick --> sm.ExpireSectors) - - - -FaultedC->ExpiredC - - -Faulted 3+ times -(sma.CronTick --> sm.SectorCleanup) - - - - - -FaultsDeclared->FaultedC - - - - - - -FaultSpotted->FaultedC - - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_offchain_fsm.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_offchain_fsm.dot.svg deleted file mode 100644 index 1d537d2c4..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_offchain_fsm.dot.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -sector - - -cluster_local - -Sector States in Storage Miner -(off chain) - - -cluster_power - - - - -Empty - -Empty - - - -Packing - -Packing - - - - -Empty->Packing - - -Add Deal - - - -Packing->Packing - - -Add Deal - - - -Unsealed - -Unsealed - - - - -Packing->Unsealed - - -Sector is full - - - -Sealed - -Sealed - - - - -Unsealed->Sealed - - -Seal - - - -NotProving - -Not Proving - - - - -Proving - -Proving - - - -Sealed->Proving - - -Commit Sector -(sm.CommitSector) - - - -NotProving->NotProving - - -Fault Declared -(sm.DeclareFaults) - - - -NotProving->NotProving - - -Fault Spotted -(sma.CronTick --> sm.PostFailed) - - - -Deleted - -Deleted - - - - -NotProving->Deleted - - -Give up on recovery -or -Expiry - - - -NotProving->Proving - - -Recover -(sm.SubmitPost) - - - -Proving->NotProving - - -Lost data -or -Stopped Proving - - - -Proving->Proving - - -Produce Post -(sm.SubmitPost) - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_fsm.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_fsm.dot.svg deleted file mode 100644 index 78bf8a6e3..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_fsm.dot.svg +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - -sectoRecovering - - -cluster_0 - -Proving Set - - -cluster_1 - -Not Counted for Power - - - -Cleared - - -Cleared - - - -Precommitted - -Precommitted - - - -Cleared->Precommitted - - - - - -Precommitted->Cleared - - - - - - - -Committed - -Committed - - - -Precommitted->Committed - - - - - -Active - -Active -(Counted -for Power) - - - -Committed->Active - - - - - -Failing - -Failing - - - -Committed->Failing - - - - - - - -Active->Cleared - - - - - -Active->Failing - - - - - - - -Recovering - -Recovering - - - -Recovering->Active - - - - - -Recovering->Failing - - - - - - - -Failing->Cleared - - - - - - - - - -Failing->Recovering - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_legend.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_legend.dot.svg deleted file mode 100644 index 4a48daa0f..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_legend.dot.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - -%3 - - -cluster_01 - -Legend - - - -key -sm.PrecommitSector -sm.CommitSector -sm.SubmitPoSt - ActivateSector -sm.DeclareFaults - sm.FailSector -sm.CronAction - sm.FailSector -sm.RecoverFaults -sm.SubmitPoSt - Expiration - ClearSector -sm.SubmitPoSt - MaxFCount - ClearSector -sm.CronAction - MaxFCount - ClearSector - - - -key2 -  -  -  -  -  -  -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine.dot.svg deleted file mode 100644 index 31970547c..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine.dot.svg +++ /dev/null @@ -1,76 +0,0 @@ - - -sector_state - - -cluster_0 - -Proving Set (Counted for Power) - - - -Cleared - - -Cleared - - - -PreCommit - -PreCommit - - - -Cleared->PreCommit - - - - - -PreCommit->Cleared - - - - - -Active - -Active - - - -PreCommit->Active - - - - - - -Active->Cleared - - - - - - - -TempFault - -TempFault - - - -Active->TempFault - - - - - -TempFault->Active - - - - - \ No newline at end of file diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.dot.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.dot.svg deleted file mode 100644 index 894ca71de..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.dot.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -%3 - - -cluster_01 - -Legend - - - -key -SectorPreCommit: Cleared - PreCommit -PreCommitExpiration: PreCommit - Cleared -SectorProveCommit: PreCommit - Active -TemporaryFaultEffectiveBegin: Active - TempFault -TemporaryFaultEffectiveEnd: TempFault - Active -SectorExpiration: Active - Cleared -UserTerminateion: Active - Cleared - - - -key2 -  -  -  -  -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - diff --git a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.svg b/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.svg deleted file mode 100644 index e8e61cd8f..000000000 --- a/content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.svg +++ /dev/null @@ -1,76 +0,0 @@ - - -%0 - - -cluster_01 - -Legend - - - -key -SectorPreCommit: Cleared - PreCommit -PreCommitExpiration: PreCommit - Cleared -SectorProveCommit: PreCommit - Active -TemporaryFaultEffectiveBegin: Active - TempFault -TemporaryFaultEffectiveEnd: TempFault - Active -SectorExpiration: Active - Cleared -UserTerminateion: Active - Cleared - - - -key2 -  -  -  -  -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - \ No newline at end of file diff --git a/content/systems/filecoin_mining/storage_mining/mining_cycle/index.md b/content/systems/filecoin_mining/storage_mining/mining_cycle/index.md index a2c1d535a..1680721e9 100644 --- a/content/systems/filecoin_mining/storage_mining/mining_cycle/index.md +++ b/content/systems/filecoin_mining/storage_mining/mining_cycle/index.md @@ -45,7 +45,7 @@ Anytime a miner receives new valid blocks, it should evaluate what is the heavie ### Epoch Timing -{{
}} +![Mining Cycle Timing](timing.png) The timing diagram above describes the sequence of block creation "mining", propagation and reception. diff --git a/go.mod b/go.mod index 2825f0ebf..e8536a29c 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,6 @@ go 1.15 require ( github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20 // indirect github.com/filecoin-project/go-fil-markets v0.5.7 // indirect - github.com/filecoin-project/lotus v0.5.0 // indirect + github.com/filecoin-project/lotus v0.5.3 // indirect github.com/filecoin-project/specs-actors v0.9.3 // indirect ) diff --git a/go.sum b/go.sum index 611c7a6f2..2f3c953d2 100644 --- a/go.sum +++ b/go.sum @@ -171,7 +171,6 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.8.0/go.mod h1:3l45GVGkyrnYNl9HoIjnp2NnNWvh6hLAqD8yTfGjnw8= github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E= github.com/filecoin-project/chain-validation v0.0.6-0.20200813000554-40c22fe26eef/go.mod h1:SMj5VK1pYgqC8FXVEtOBRTc+9AIrYu+C+K3tAXi2Rk8= -github.com/filecoin-project/filecoin-ffi v0.0.0-20200326153646-e899cc1dd072/go.mod h1:PtH9YP0rURHUKHrKeEBeWg/BqIBMQOz8wtlXlVGREBE= github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200716204036-cddc56607e1d/go.mod h1:XE4rWG1P7zWPaC11Pkn1CVR20stqN52MnMkIrF4q6ZU= github.com/filecoin-project/go-address v0.0.0-20200107215422-da8eea2842b5/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0= github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0= @@ -182,38 +181,30 @@ github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoC github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20200731171407-e559a0579161/go.mod h1:vgmwKBkx+ca5OIeEvstiQgzAZnb7R6QaqE1oEDSqa6g= github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw= github.com/filecoin-project/go-bitfield v0.0.1/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= -github.com/filecoin-project/go-bitfield v0.0.3/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= -github.com/filecoin-project/go-bitfield v0.0.4-0.20200703174658-f4a5758051a1/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= github.com/filecoin-project/go-bitfield v0.1.2/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-data-transfer v0.6.2/go.mod h1:uRYBRKVBVM12CSusBtVrzDHkVw/3DKZpkxKJVP1Ydas= -github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5/go.mod h1:JbkIgFF/Z9BDlvrJO1FuKkaWsH673/UdFaiVS6uIHlA= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-markets v0.5.7 h1:kzyMHqez8ssxchj5s9M1hkC3CTwRGh2MeglJGfUksQU= github.com/filecoin-project/go-fil-markets v0.5.7/go.mod h1:KnvFG3kSQ77vKYSY/QdrXET81wVCBByHXjG7AyxnbUw= github.com/filecoin-project/go-jsonrpc v0.1.2-0.20200817153016-2ea5cbaf5ec0/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4= github.com/filecoin-project/go-multistore v0.0.3/go.mod h1:kaNqCC4IhU4B1uyr7YWFHd23TL4KM32aChS0jNkyUvQ= github.com/filecoin-project/go-padreader v0.0.0-20200210211231-548257017ca6/go.mod h1:0HgYnrkeSU4lu1p+LEOeDpFsNBssa0OGGriWdA4hvaE= -github.com/filecoin-project/go-paramfetch v0.0.1/go.mod h1:fZzmf4tftbwf9S37XRifoJlz7nCjRdIrMGLR07dKLCc= github.com/filecoin-project/go-paramfetch v0.0.2-0.20200218225740-47c639bab663/go.mod h1:fZzmf4tftbwf9S37XRifoJlz7nCjRdIrMGLR07dKLCc= github.com/filecoin-project/go-paramfetch v0.0.2-0.20200701152213-3e0f0afdc261/go.mod h1:fZzmf4tftbwf9S37XRifoJlz7nCjRdIrMGLR07dKLCc= -github.com/filecoin-project/go-statemachine v0.0.0-20200226041606-2074af6d51d9/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v0.0.0-20200714194326-a77c3ae20989/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v0.0.0-20200813232949-df9b130df370/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= -github.com/filecoin-project/lotus v0.5.0 h1:ioT4V/xZkJGcSHJurYFj1Jpc7qQXAzCRtMro8NI+5bU= -github.com/filecoin-project/lotus v0.5.0/go.mod h1:ZIXtoveBvWarGLmNbTKJUQKTB1MLkubnTU6dfLCFdqM= -github.com/filecoin-project/sector-storage v0.0.0-20200712023225-1d67dcfa3c15/go.mod h1:salgVdX7qeXFo/xaiEQE29J4pPkjn71T0kt0n+VDBzo= +github.com/filecoin-project/lotus v0.5.3 h1:AntknU9xDCdzK9QPwdTO97IbP5Uf7oZS/9+qdCwb0ic= +github.com/filecoin-project/lotus v0.5.3/go.mod h1:yle1pUZzcv7CPUdUalBYngEl52v58ywlWsu0MY3pq44= github.com/filecoin-project/sector-storage v0.0.0-20200730050024-3ee28c3b6d9a/go.mod h1:oOawOl9Yk+qeytLzzIryjI8iRbqo+qzS6EEeElP4PWA= github.com/filecoin-project/sector-storage v0.0.0-20200810171746-eac70842d8e0/go.mod h1:oOawOl9Yk+qeytLzzIryjI8iRbqo+qzS6EEeElP4PWA= github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA= -github.com/filecoin-project/specs-actors v0.0.0-20200226200336-94c9b92b2775/go.mod h1:0HAWYrvajFHDgRaKbF0rl+IybVLZL5z4gQ8koCMPhoU= github.com/filecoin-project/specs-actors v0.3.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVlCPR+U3z5Q3wMOQ+2aiV+Y= github.com/filecoin-project/specs-actors v0.6.1/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= -github.com/filecoin-project/specs-actors v0.7.3-0.20200716231407-60a2ae96d2e6/go.mod h1:JOMUa7EijvpOO4ofD1yeHNmqohkmmnhTvz/IpB6so4c= github.com/filecoin-project/specs-actors v0.8.2/go.mod h1:Q3ACV5kBLvqPaYbthc/J1lGMJ5OwogmD9pzdtPRMdCw= github.com/filecoin-project/specs-actors v0.8.7-0.20200811203034-272d022c1923/go.mod h1:hukRu6vKQrrS7Nt+fC/ql4PqWLSfmAWNshD/VDtARZU= github.com/filecoin-project/specs-actors v0.9.2/go.mod h1:YasnVUOUha0DN5wB+twl+V8LlDKVNknRG00kTJpsfFA= @@ -221,13 +212,13 @@ github.com/filecoin-project/specs-actors v0.9.3 h1:Fi75G/UQ7R4eiIwnN+S6bBQ9LqKiv github.com/filecoin-project/specs-actors v0.9.3/go.mod h1:YasnVUOUha0DN5wB+twl+V8LlDKVNknRG00kTJpsfFA= github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= github.com/filecoin-project/specs-storage v0.1.1-0.20200730063404-f7db367e9401/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= -github.com/filecoin-project/storage-fsm v0.0.0-20200805013058-9d9ea4e6331f/go.mod h1:1CGbd11KkHuyWPT+xwwCol1zl/jnlpiKD2L4fzKxaiI= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1/go.mod h1:0eHX/BVySxPc6SE2mZRoppGq7qcEagxdmQnA3dzork8= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -261,6 +252,7 @@ github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= @@ -269,6 +261,7 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -423,7 +416,6 @@ github.com/ipfs/go-fs-lock v0.0.1/go.mod h1:DNBekbboPKcxs1aukPSaOtFA3QfSdi5C855v github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-graphsync v0.1.1/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-hamt-ipld v0.0.15-0.20200131012125-dd88a59d3f2e/go.mod h1:9aQJu/i/TaRDW6jqB5U217dLIDopn50wxLdHXM2CTfE= -github.com/ipfs/go-hamt-ipld v0.0.15-0.20200204200533-99b8553ef242/go.mod h1:kq3Pi+UP3oHhAdKexE+kHHYRKMoFNuGero0R7q3hWGg= github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= @@ -698,7 +690,7 @@ github.com/libp2p/go-libp2p-pubsub v0.3.2-0.20200527132641-c0712c6e92cf/go.mod h github.com/libp2p/go-libp2p-pubsub v0.3.5-0.20200821075113-efd56962bced/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= -github.com/libp2p/go-libp2p-quic-transport v0.7.1/go.mod h1:TD31to4E5exogR/GWHClXCfkktigjAl5rXSt7HoxNvY= +github.com/libp2p/go-libp2p-quic-transport v0.8.0/go.mod h1:F2FG/6Bzz0U6essUVxDzE0s9CrY4XGLbl7QEmDNvU7A= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -808,7 +800,7 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= -github.com/lucas-clemente/quic-go v0.17.3/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= +github.com/lucas-clemente/quic-go v0.18.0/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -816,8 +808,11 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= +github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= +github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= +github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -934,11 +929,13 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= @@ -1207,7 +1204,6 @@ golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1216,6 +1212,7 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200427165652-729f1e841bcc/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1286,7 +1283,9 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1344,6 +1343,7 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025090151-53bf42e6b339/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1352,7 +1352,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1411,7 +1410,6 @@ golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108195415-316d2f248479/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1526,6 +1524,7 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 000000000..be67246e7 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,44 @@ +{{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }} +{{ $src := .Destination }} +{{ $path := "" }} +{{ $genPath := "" }} +{{ $title := default .Text .Title }} +{{ $ext := path.Ext .Destination }} +{{ $supported := in ".mmd,.dot" $ext }} + +
+
+ +{{- if $isRemote -}} + {{ $genPath = .Destination }} + {{ .Text }} +{{- else if eq $supported false -}} + {{ $src := .Page.Resources.GetMatch .Destination }} + {{ with $src }} + {{ $genPath = .RelPermalink }} + {{ $title }} + {{ end }} +{{- else -}} + {{ if eq ( $src | printf "%.1s") "/" }} + {{ $path = $src}} + {{ $genPath = (printf "/_gen/diagrams%s?%d" (replace $path $ext ".svg") now.Unix)}} + {{ else }} + {{ $path = printf "%s%s" .Page.File.Dir $src }} + {{ $genPath = (printf "/_gen/diagrams/%s?%d" (replace $path $ext ".svg") now.Unix)}} + {{- end -}} + {{ if fileExists $path }} + {{ .Text }} + {{ else }} +
+ {{- printf "File '%s' not found from Page '%s'" $src .Page.File }} +
+ {{- warnf "File '%s' not found from Page '%s'" $src .Page.File }} + {{ end }} +{{- end -}} + +
+
+ Figure: {{ $title }} + Open in tab +
+
\ No newline at end of file diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 34a5f5fa7..dad37725a 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -48,5 +48,5 @@ {{- warnf "Page '%s' not found in '%s' for lang '%s'" .Destination .Page.File .Page.File.Lang }} {{- end }} {{- end }} - {{ .Text | safeHTML }} + {{ (default $title .Text) | safeHTML }} {{- end -}} diff --git a/layouts/partials/single/html-head.html b/layouts/partials/single/html-head.html index 3fb4557c6..fdb08f0fa 100644 --- a/layouts/partials/single/html-head.html +++ b/layouts/partials/single/html-head.html @@ -22,11 +22,6 @@ {{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} -{{- if .Site.Params.BookServiceWorker }} -{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} - -{{ end -}} - {{- template "_internal/google_analytics_async.html" . -}} diff --git a/layouts/partials/single/inject/body.html b/layouts/partials/single/inject/body.html index 17d2d5b8a..3b1e00586 100644 --- a/layouts/partials/single/inject/body.html +++ b/layouts/partials/single/inject/body.html @@ -1,5 +1,6 @@ {{ $opts := dict "targetPath" "main.js" "minify" "true" }} {{ $js := resources.Get "js/main.js" | js.Build $opts}} - - \ No newline at end of file +{{ if ne .Site.IsServer true }} + +{{end}} \ No newline at end of file diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html deleted file mode 100644 index 2f3766878..000000000 --- a/layouts/shortcodes/figure.html +++ /dev/null @@ -1,33 +0,0 @@ -{{ if (.Get "src") }} - {{ if eq (.Get "src" | printf "%.4s") "http" }} -
- -
- {{(.Get "title")}} -
-
- {{ else }} - {{ $.Scratch.Set "filepath" .Page.File.Dir }} - {{ $.Scratch.Add "filepath" ( .Get "src" ) }} - {{ if fileExists ($.Scratch.Get "filepath") }} - {{ $uuid := delimit (shuffle (seq 1 9)) "" }} - {{ $id := (print "figure-" $uuid) }} -
- {{ $src := .Page.Resources.GetMatch ( .Get "src" ) }} - {{ with $src }} -
- {{ $.Get -
- {{ end }} -
- {{ .Get "title" }} -
-
- {{ else }} -
- {{- printf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} -
- {{- warnf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} - {{ end }} - {{ end }} -{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/h.html b/layouts/shortcodes/h.html deleted file mode 100644 index c2cb14655..000000000 --- a/layouts/shortcodes/h.html +++ /dev/null @@ -1,19 +0,0 @@ -{{- $level := default 1 (int (.Get "level")) -}} -{{- $originalLevel := default 1 (int (.Get "level")) -}} -{{- $title := (.Get "title") | safeHTML -}} -{{/* get rid of unwanted filename noise */}} -{{- $path := strings.TrimSuffix "/_index.md" .Page.File.Path }} -{{- $path = strings.TrimSuffix ".md" $path }} -{{- $pathParts := split $path "/" -}} -{{- $pathSize := len $pathParts -}} - -{{/* - .Level is the heading number from the original markdown, e.g 1 for an h1. - $level is the corrected heading number given the depth of the file in the tree. -*/}} -{{- $level := add $pathSize (sub $level 1) -}} -{{- $anchor := printf "%s__%s" (delimit $pathParts "__") (anchorize $title) -}} - - - {{$title}} - \ No newline at end of file diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index fc164d96b..0e4bf3499 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -51,7 +51,6 @@