├── .editorconfig ├── .fleek.json ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .nvmrc ├── .prettierignore ├── .remarkrc.yaml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── api ├── README.md ├── index.js ├── package.json ├── src │ ├── get.js │ └── router.js ├── webpack.config.js └── wrangler.toml ├── assets ├── _code.scss ├── _colors.scss ├── _custom.scss ├── _dashboard.scss ├── _fonts.scss ├── _icons.scss ├── _katex.scss ├── _utils-custom.scss ├── _variables.scss ├── js │ ├── katex.js │ ├── lightbox.js │ └── main.js ├── plugins │ ├── _bagdes.scss │ ├── _dark.scss │ ├── _diagrams.scss │ ├── _lightbox.scss │ ├── _meter.scss │ ├── _numbered.scss │ ├── _scrollbars.scss │ ├── _table-sort.scss │ └── _toc.scss └── site.webmanifest ├── config.toml ├── content ├── _index.md ├── algorithms │ ├── _index.md │ ├── block_reception.md │ ├── block_sync.md │ ├── crypto │ │ ├── _index.md │ │ ├── bls.go │ │ ├── bls.id │ │ ├── ecdsa.id │ │ ├── poseidon.md │ │ ├── randomness.md │ │ ├── signatures.go │ │ ├── signatures.id │ │ ├── signatures.md │ │ ├── vrf.go │ │ ├── vrf.id │ │ └── vrf.md │ ├── cryptoecon │ │ └── _index.md │ ├── expected_consensus │ │ ├── _index.md │ │ └── diagrams │ │ │ ├── double_fork.dot │ │ │ ├── parent_grinding.dot │ │ │ └── time_offset.dot │ ├── gossip_sub.md │ ├── porep-old │ │ ├── _index.md │ │ ├── porep_commitments │ │ │ ├── _index.md │ │ │ └── sdr_commitments │ │ │ │ ├── data-layer.png │ │ │ │ ├── layer-0.png │ │ │ │ ├── layer-1.png │ │ │ │ ├── layer-2.png │ │ │ │ ├── layer-3.png │ │ │ │ ├── layer-4.png │ │ │ │ ├── layer-5.png │ │ │ │ ├── legend-even.png │ │ │ │ ├── legend-odd.png │ │ │ │ ├── legend.png │ │ │ │ └── replica-layer.png │ │ ├── stacked_drg.md │ │ └── stacked_drg_circuit.md │ ├── pos │ │ ├── _index.md │ │ ├── porep.md │ │ └── post.md │ ├── sdr │ │ ├── _index.md │ │ └── notation.md │ └── verified_clients │ │ └── _index.md ├── appendix │ ├── _index.md │ ├── address.md │ ├── audit_reports.md │ ├── data_structures.md │ └── network_params.md ├── glossary │ └── _index.md ├── implementations │ ├── _index.md │ ├── forest.md │ ├── fuhon.md │ ├── lotus.md │ └── venus.md ├── intro │ ├── _index.md │ ├── arch.md │ ├── concepts.md │ ├── diagrams │ │ ├── buildsys │ │ │ └── buildsys.dot │ │ ├── orient │ │ │ └── filecoin.dot │ │ ├── overview1 │ │ │ ├── overview.dot │ │ │ └── overview1.godot │ │ ├── overview2 │ │ │ └── overview2.mmd │ │ └── sequence │ │ │ └── full-deals-on-chain.mmd │ ├── filecoin_vm.md │ ├── new-state-diagram.mmd │ └── systems │ │ ├── _index.md │ │ ├── impl_systems.md │ │ ├── system.id │ │ └── why_systems.md ├── libraries │ ├── _index.md │ ├── drand │ │ └── _index.md │ ├── ipfs │ │ └── _index.md │ ├── ipld │ │ └── _index.md │ ├── libp2p │ │ └── _index.md │ └── multiformats │ │ └── _index.md ├── math-mode.md ├── releases │ └── _index.md ├── systems │ ├── _index.md │ ├── filecoin_blockchain │ │ ├── _index.md │ │ ├── blockchain.id │ │ ├── bootstrap │ │ │ └── index.md │ │ ├── chainsync │ │ │ ├── _index.md │ │ │ └── chainsync_fsm.dot │ │ ├── message_pool │ │ │ ├── _index.md │ │ │ ├── message_pool_subsystem.id │ │ │ ├── message_storage.md │ │ │ ├── message_syncer.id │ │ │ └── message_syncer.md │ │ ├── storage_power_consensus │ │ │ ├── _index.md │ │ │ ├── expected_consensus.go │ │ │ ├── expected_consensus.id │ │ │ ├── storage_power_actor.md │ │ │ ├── storage_power_consensus_subsystem.go │ │ │ └── storage_power_consensus_subsystem.id │ │ └── struct │ │ │ ├── _index.md │ │ │ ├── block │ │ │ ├── _index.md │ │ │ ├── block.go │ │ │ ├── block.id │ │ │ ├── election.go │ │ │ └── election.id │ │ │ ├── block_producer │ │ │ ├── _index.md │ │ │ └── block_producer.id │ │ │ ├── chain_manager │ │ │ └── _index.md │ │ │ └── tipset │ │ │ └── _index.md │ ├── filecoin_files │ │ ├── _index.md │ │ ├── data_transfer │ │ │ ├── _index.md │ │ │ ├── alternate-pull-flow.mmd │ │ │ ├── data-transfer-modules.png │ │ │ ├── data_transfer_subsystem.id │ │ │ ├── pull-flow.mmd │ │ │ └── push-flow.mmd │ │ ├── error_correction │ │ │ ├── _index.md │ │ │ ├── erasure_coding │ │ │ │ ├── _index.md │ │ │ │ └── coding.id │ │ │ └── error_correcting_codes │ │ │ │ ├── _index.md │ │ │ │ └── coding.id │ │ ├── file │ │ │ ├── _index.md │ │ │ ├── file.go │ │ │ ├── file.id │ │ │ ├── filestore.id │ │ │ └── filestore.md │ │ ├── piece │ │ │ ├── _index.md │ │ │ └── pieces.png │ │ └── serialization │ │ │ └── _index.md │ ├── filecoin_markets │ │ ├── _index.md │ │ ├── onchain_storage_market │ │ │ ├── _index.md │ │ │ ├── diagrams │ │ │ │ ├── deal-flow.mmd │ │ │ │ └── deal-payment.mmd │ │ │ ├── faults.md │ │ │ ├── storage_deal_flow.md │ │ │ ├── storage_deal_states.md │ │ │ └── storage_market_actor.md │ │ ├── retrieval_market │ │ │ ├── _index.md │ │ │ ├── deal_status.md │ │ │ ├── retrieval_client.id │ │ │ ├── retrieval_client.md │ │ │ ├── retrieval_flow_v0.mmd │ │ │ ├── retrieval_flow_v1.mmd │ │ │ ├── retrieval_peer_resolver.id │ │ │ ├── retrieval_peer_resolver.md │ │ │ ├── retrieval_protocols.md │ │ │ ├── retrieval_provider.id │ │ │ ├── retrieval_provider.md │ │ │ └── types.id │ │ └── storage_market │ │ │ ├── _index.md │ │ │ └── storage_market_flow.mmd │ ├── filecoin_mining │ │ ├── _index.md │ │ ├── base_mining.id │ │ ├── miner_collaterals.md │ │ ├── sector │ │ │ ├── _index.md │ │ │ ├── adding_storage.md │ │ │ ├── lifecycle.md │ │ │ ├── sealing.md │ │ │ ├── sector-faults.md │ │ │ ├── sector-quality │ │ │ │ ├── _index.md │ │ │ │ └── sector-quality.jpg │ │ │ ├── sector-recovery.md │ │ │ └── sectors.png │ │ ├── storage_mining │ │ │ ├── _index.md │ │ │ ├── diagrams │ │ │ │ ├── miner_post_state_machine.dot │ │ │ │ ├── miner_post_state_machine_legend.dot │ │ │ │ ├── mining_cycle.dot │ │ │ │ ├── sector_chain_fsm.dot │ │ │ │ ├── sector_fsm.dot │ │ │ │ ├── sector_offchain_fsm.dot │ │ │ │ ├── sector_state_fsm.dot │ │ │ │ ├── sector_state_legend.dot │ │ │ │ ├── sector_state_machine.dot │ │ │ │ └── sector_state_machine_legend.dot │ │ │ ├── mining_cycle │ │ │ │ ├── _index.md │ │ │ │ └── timing.png │ │ │ ├── storage_miner_actor.md │ │ │ ├── storage_mining_subsystem.go │ │ │ └── storage_mining_subsystem.id │ │ └── storage_proving │ │ │ ├── _index.md │ │ │ ├── poster │ │ │ ├── _index.md │ │ │ ├── post_generator.go │ │ │ └── post_generator.id │ │ │ ├── sealer │ │ │ ├── _index.md │ │ │ ├── sealer.go │ │ │ └── sealer.id │ │ │ ├── storage_proving_subsystem.go │ │ │ └── storage_proving_subsystem.id │ ├── filecoin_nodes │ │ ├── _index.md │ │ ├── clock │ │ │ └── _index.md │ │ ├── network │ │ │ └── _index.md │ │ ├── node_types │ │ │ └── _index.md │ │ └── repository │ │ │ ├── _index.md │ │ │ ├── ipldstore │ │ │ └── _index.md │ │ │ └── key_store │ │ │ └── _index.md │ ├── filecoin_token │ │ ├── _index.md │ │ ├── block_reward_minting.md │ │ ├── minting_model │ │ │ ├── _index.md │ │ │ └── final-stages-of-economy.jpg │ │ ├── multisig.md │ │ ├── payment_channels.md │ │ └── token_allocation │ │ │ ├── _index.md │ │ │ └── filtokenallocation.png │ └── filecoin_vm │ │ ├── _index.md │ │ ├── actor │ │ └── _index.md │ │ ├── gas_fee.md │ │ ├── interpreter │ │ ├── _index.md │ │ └── vm_interpreter_old.md │ │ ├── message │ │ └── _index.md │ │ ├── runtime │ │ └── _index.md │ │ ├── state_tree │ │ └── _index.md │ │ └── sysactors │ │ └── _index.md ├── test-embed.js └── test.md ├── data ├── .gitkeep └── iconmoon-project.json ├── layouts ├── _default │ ├── _markup │ │ ├── render-heading.html │ │ ├── render-image.html │ │ └── render-link.html │ └── baseof.html ├── partials │ ├── body.html │ ├── docs │ │ ├── menu-filetree.html │ │ ├── search.html │ │ └── toc.html │ ├── html-head.html │ ├── single │ │ ├── brand.html │ │ ├── header.html │ │ ├── menu-single.html │ │ └── menu.html │ ├── state-badge.html │ └── toc.html ├── shortcodes │ ├── changelog.html │ ├── dashboard-impl.html │ ├── dashboard-progress.html │ ├── dashboard-spec.html │ ├── embed.html │ ├── katex.html │ ├── listing.html │ ├── mermaid.html │ └── plain.html └── single │ └── baseof.html ├── package.json ├── static ├── _gen │ └── diagrams │ │ ├── algorithms │ │ └── expected_consensus │ │ │ └── diagrams │ │ │ ├── double_fork.svg │ │ │ ├── parent_grinding.svg │ │ │ └── time_offset.svg │ │ ├── intro │ │ ├── diagrams │ │ │ ├── buildsys │ │ │ │ └── buildsys.svg │ │ │ ├── orient │ │ │ │ └── filecoin.svg │ │ │ ├── overview1 │ │ │ │ └── overview.svg │ │ │ ├── overview2 │ │ │ │ └── overview2.svg │ │ │ └── sequence │ │ │ │ └── full-deals-on-chain.svg │ │ └── new-state-diagram.svg │ │ └── systems │ │ ├── filecoin_blockchain │ │ └── chainsync │ │ │ └── chainsync_fsm.svg │ │ ├── filecoin_files │ │ └── data_transfer │ │ │ ├── alternate-pull-flow.svg │ │ │ ├── pull-flow.svg │ │ │ └── push-flow.svg │ │ ├── filecoin_markets │ │ ├── onchain_storage_market │ │ │ └── diagrams │ │ │ │ ├── deal-flow.svg │ │ │ │ └── deal-payment.svg │ │ ├── retrieval_market │ │ │ ├── retrieval_flow_v0.svg │ │ │ └── retrieval_flow_v1.svg │ │ └── storage_market │ │ │ └── storage_market_flow.svg │ │ └── filecoin_mining │ │ └── storage_mining │ │ └── diagrams │ │ ├── miner_post_state_machine.svg │ │ ├── miner_post_state_machine_legend.svg │ │ ├── mining_cycle.svg │ │ ├── sector_chain_fsm.svg │ │ ├── sector_fsm.svg │ │ ├── sector_offchain_fsm.svg │ │ ├── sector_state_fsm.svg │ │ ├── sector_state_legend.svg │ │ ├── sector_state_machine.svg │ │ └── sector_state_machine_legend.svg ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── browserconfig.xml ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── filecoin-logo.svg ├── fonts │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_Caligraphic-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-Bold.woff │ ├── KaTeX_Main-Bold.woff2 │ ├── KaTeX_Main-BoldItalic.ttf │ ├── KaTeX_Main-BoldItalic.woff │ ├── KaTeX_Main-BoldItalic.woff2 │ ├── KaTeX_Main-Italic.ttf │ ├── KaTeX_Main-Italic.woff │ ├── KaTeX_Main-Italic.woff2 │ ├── KaTeX_Main-Regular.ttf │ ├── KaTeX_Main-Regular.woff │ ├── KaTeX_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── KaTeX_Math-Italic.ttf │ ├── KaTeX_Math-Italic.woff │ ├── KaTeX_Math-Italic.woff2 │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── KaTeX_SansSerif-Bold.woff2 │ ├── KaTeX_SansSerif-Italic.ttf │ ├── KaTeX_SansSerif-Italic.woff │ ├── KaTeX_SansSerif-Italic.woff2 │ ├── KaTeX_SansSerif-Regular.ttf │ ├── KaTeX_SansSerif-Regular.woff │ ├── KaTeX_SansSerif-Regular.woff2 │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Typewriter-Regular.woff │ └── KaTeX_Typewriter-Regular.woff2 ├── mstile-144x144.png ├── mstile-150x150.png ├── mstile-310x150.png ├── mstile-310x310.png ├── mstile-70x70.png ├── safari-pinned-tab.svg ├── sw.js └── symbol-defs.svg ├── themes └── book │ ├── .github │ └── workflows │ │ └── main.yml │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── archetypes │ ├── docs.md │ └── posts.md │ ├── assets │ ├── _custom.scss │ ├── _defaults.scss │ ├── _fonts.scss │ ├── _main.scss │ ├── _markdown.scss │ ├── _print.scss │ ├── _shortcodes.scss │ ├── _utils.scss │ ├── _variables.scss │ ├── book.scss │ ├── manifest.json │ ├── menu-reset.js │ ├── mermaid.json │ ├── normalize.css │ ├── plugins │ │ ├── _numbered.scss │ │ └── _scrollbars.scss │ ├── search-data.js │ ├── search.js │ ├── sw-register.js │ ├── sw.js │ └── themes │ │ ├── _auto.scss │ │ ├── _dark.scss │ │ └── _light.scss │ ├── exampleSite │ ├── assets │ │ ├── _custom.scss │ │ └── _variables.scss │ ├── config.toml │ ├── config.yaml │ ├── content.ru │ │ └── _index.md │ ├── content.zh │ │ └── _index.md │ └── content │ │ ├── _index.md │ │ ├── docs │ │ ├── example │ │ │ ├── _index.md │ │ │ ├── collapsed │ │ │ │ ├── 3rd-level │ │ │ │ │ ├── 4th-level.md │ │ │ │ │ └── _index.md │ │ │ │ └── _index.md │ │ │ ├── hidden.md │ │ │ └── table-of-contents │ │ │ │ ├── _index.md │ │ │ │ ├── with-toc.md │ │ │ │ └── without-toc.md │ │ └── shortcodes │ │ │ ├── _index.md │ │ │ ├── buttons.md │ │ │ ├── columns.md │ │ │ ├── details.md │ │ │ ├── expand.md │ │ │ ├── hints.md │ │ │ ├── katex.md │ │ │ ├── mermaid.md │ │ │ ├── section │ │ │ ├── _index.md │ │ │ ├── page1.md │ │ │ └── page2.md │ │ │ └── tabs.md │ │ ├── menu │ │ └── index.md │ │ └── posts │ │ ├── _index.md │ │ ├── creating-a-new-theme.md │ │ ├── goisforlovers.md │ │ ├── hugoisforlovers.md │ │ └── migrate-from-jekyll.md │ ├── i18n │ ├── cn.yaml │ ├── cs.yaml │ ├── de.yaml │ ├── en.yaml │ ├── es.yaml │ ├── fr.yaml │ ├── ja.yaml │ ├── jp.yaml │ ├── ko.yaml │ ├── nb.yaml │ ├── pt.yaml │ ├── ru.yaml │ ├── sv.yaml │ ├── uk.yaml │ └── zh.yaml │ ├── images │ ├── screenshot.png │ └── tn.png │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── _markup │ │ │ ├── render-heading.html │ │ │ ├── render-image.html │ │ │ └── render-link.html │ │ ├── baseof.html │ │ ├── list.html │ │ └── single.html │ ├── partials │ │ └── docs │ │ │ ├── brand.html │ │ │ ├── comments.html │ │ │ ├── date.html │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── html-head.html │ │ │ ├── inject │ │ │ ├── body.html │ │ │ ├── content-after.html │ │ │ ├── content-before.html │ │ │ ├── footer.html │ │ │ ├── head.html │ │ │ ├── menu-after.html │ │ │ └── menu-before.html │ │ │ ├── languages.html │ │ │ ├── menu-bundle.html │ │ │ ├── menu-filetree.html │ │ │ ├── menu-hugo.html │ │ │ ├── menu.html │ │ │ ├── post-meta.html │ │ │ ├── search.html │ │ │ ├── taxonomy.html │ │ │ ├── title.html │ │ │ └── toc.html │ ├── posts │ │ ├── list.html │ │ └── single.html │ ├── shortcodes │ │ ├── button.html │ │ ├── columns.html │ │ ├── details.html │ │ ├── expand.html │ │ ├── hint.html │ │ ├── katex.html │ │ ├── mermaid.html │ │ ├── section.html │ │ ├── tab.html │ │ └── tabs.html │ └── taxonomy │ │ ├── list.html │ │ └── taxonomy.html │ ├── static │ ├── favicon.png │ ├── favicon.svg │ ├── flexsearch.min.js │ ├── fonts │ │ ├── roboto-mono-v6-latin-regular.woff │ │ ├── roboto-mono-v6-latin-regular.woff2 │ │ ├── roboto-v19-latin-300italic.woff │ │ ├── roboto-v19-latin-300italic.woff2 │ │ ├── roboto-v19-latin-700.woff │ │ ├── roboto-v19-latin-700.woff2 │ │ ├── roboto-v19-latin-regular.woff │ │ └── roboto-v19-latin-regular.woff2 │ ├── katex │ │ ├── auto-render.min.js │ │ ├── fonts │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ ├── KaTeX_AMS-Regular.woff2 │ │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ │ ├── KaTeX_Fraktur-Bold.woff │ │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ │ ├── KaTeX_Fraktur-Regular.woff │ │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ ├── KaTeX_Main-Bold.woff2 │ │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ │ ├── KaTeX_Main-BoldItalic.woff │ │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ ├── KaTeX_Main-Italic.woff2 │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ ├── KaTeX_Main-Regular.woff2 │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ ├── KaTeX_Math-Italic.woff2 │ │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ │ ├── KaTeX_SansSerif-Bold.woff │ │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ │ ├── KaTeX_SansSerif-Italic.woff │ │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ │ ├── KaTeX_SansSerif-Regular.woff │ │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ │ ├── KaTeX_Script-Regular.ttf │ │ │ ├── KaTeX_Script-Regular.woff │ │ │ ├── KaTeX_Script-Regular.woff2 │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ ├── KaTeX_Size1-Regular.woff2 │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ ├── KaTeX_Size2-Regular.woff2 │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ ├── KaTeX_Size3-Regular.woff2 │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ ├── KaTeX_Size4-Regular.woff │ │ │ ├── KaTeX_Size4-Regular.woff2 │ │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ │ ├── KaTeX_Typewriter-Regular.woff │ │ │ └── KaTeX_Typewriter-Regular.woff2 │ │ ├── katex.min.css │ │ └── katex.min.js │ ├── mermaid.min.js │ └── svg │ │ ├── calendar.svg │ │ ├── edit.svg │ │ ├── menu.svg │ │ ├── toc.svg │ │ └── translate.svg │ └── theme.toml └── tools ├── diagrams.js ├── readme.js ├── toc.js ├── toc └── build-model.js └── watch.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{*.yml}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | indent_style = space 17 | indent_size = 2 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /.fleek.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "image": "node:20.2", 4 | "command": "npm install && npm run build", 5 | "publicDir": "public" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: actions/setup-node@v2-beta 17 | - run: npm install 18 | - run: npm test 19 | - run: npm run build 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | public/ 4 | .DS_Store 5 | yarn.lock 6 | package-lock.json 7 | node_modules 8 | resources 9 | data/toc.json 10 | api/dist 11 | api/worker 12 | .hugo_build.lock 13 | assets/jsconfig.json 14 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v20.2.0 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | public/ 4 | .DS_Store 5 | yarn.lock 6 | package-lock.json 7 | node_modules 8 | resources 9 | static/_gen 10 | data/toc.json 11 | themes 12 | layouts 13 | api/dist 14 | api/worker 15 | content/algorithms/crypto/poseidon.md 16 | -------------------------------------------------------------------------------- /.remarkrc.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # make remark aware of fontmatter. 3 | remark-frontmatter: 4 | remark-math: 5 | # sensible linter defaults see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-recommended#rules 6 | remark-preset-lint-recommended: 7 | # add extra rules 8 | remark-lint-heading-increment: 9 | remark-lint-fenced-code-flag: 10 | remark-lint-first-heading-level: 11 | remark-lint-no-hr-after-heading: 12 | # disable some of the sensible defaults given where we are today. 13 | remark-lint-list-item-indent: false 14 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Copyright 2019 by the Filecoin contributors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /api/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | Install Cloudflare Wrangler 4 | 5 | ```bash 6 | wrangler login # to get the token 7 | 8 | wrangler publish # to publish the worker to specs-api.protocol-labs.workers.dev 9 | ``` 10 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "specs-api", 3 | "version": "1.0.0", 4 | "description": "spec proxy api", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Hugo Dias ", 10 | "license": "MIT", 11 | "dependencies": { 12 | "dlv": "^1.1.3", 13 | "merge-options": "^3.0.3", 14 | "nanoid": "^3.1.16", 15 | "p-map": "^4.0.0", 16 | "wrangler": "^2.17.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | target: 'webworker', 3 | // devtool: 'cheap-module-source-map', 4 | entry: './index.js', 5 | mode: 'production', 6 | } 7 | -------------------------------------------------------------------------------- /api/wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "specs-api" 2 | account_id = "e85b6fdda17f8c464c343dc84d1373e8" 3 | workers_dev = true 4 | main = "index.js" 5 | compatibility_date = "2023-04-27" 6 | -------------------------------------------------------------------------------- /assets/_code.scss: -------------------------------------------------------------------------------- 1 | .markdown pre { 2 | max-height: 450px; 3 | overflow: auto; 4 | } 5 | 6 | .markdown code, 7 | code { 8 | margin: 0 1px; 9 | padding: 3px 6px; 10 | font-size: 85%; 11 | border-radius: 3px; 12 | line-height: 16px; 13 | box-decoration-break: clone; 14 | } 15 | -------------------------------------------------------------------------------- /assets/_colors.scss: -------------------------------------------------------------------------------- 1 | // Colors 2 | 3 | .text-missing { 4 | color: var(--cl-red); 5 | } 6 | .text-incorrect { 7 | color: var(--cl-orange); 8 | } 9 | .text-wip { 10 | color: var(--cl-yellow); 11 | } 12 | .text-coming { 13 | color: var(--cl-yellow); 14 | } 15 | .text-reliable { 16 | color: var(--cl-green); 17 | } 18 | .text-stable { 19 | color: var(--cl-blue); 20 | } 21 | .text-transparent { 22 | color: transparent; 23 | } 24 | .text-black { 25 | color: black !important; 26 | } 27 | 28 | .bg-na { 29 | background-color: var(--cl-gray) !important; 30 | } 31 | .bg-missing { 32 | background-color: var(--cl-red) !important; 33 | } 34 | .bg-incorrect { 35 | background-color: var(--cl-orange) !important; 36 | } 37 | .bg-wip { 38 | background-color: var(--cl-yellow) !important; 39 | } 40 | .bg-coming { 41 | background-color: var(--cl-yellow) !important; 42 | } 43 | .bg-done { 44 | background-color: var(--cl-green) !important; 45 | } 46 | .bg-reliable { 47 | background-color: var(--cl-green) !important; 48 | } 49 | .bg-stable { 50 | background-color: var(--cl-blue) !important; 51 | a { 52 | color: black; 53 | } 54 | } 55 | .bg-transparent { 56 | background-color: transparent; 57 | } 58 | .bg-black { 59 | background-color: black; 60 | } 61 | -------------------------------------------------------------------------------- /assets/_dashboard.scss: -------------------------------------------------------------------------------- 1 | #dashboard-container { 2 | // the dashboard is generated on the client, so it throws out in page anchor scrolling, so we set the heigt manually here. 3 | // TODO: Fix properly. perhaps generating the table earlier in the page render could fix it... otherwise writing it into the dom as a post process. 4 | height: 2850px; 5 | overflow: auto; 6 | } 7 | table.Dashboard { 8 | display: table; 9 | table-layout: fixed; 10 | width: 100%; 11 | font-size: 12px; 12 | margin: 0; 13 | } 14 | 15 | table.Dashboard { 16 | th:first-child { 17 | width: 50%; 18 | } 19 | .gg-external { 20 | display: inline-block; 21 | margin-left: 3px; 22 | vertical-align: text-top; 23 | } 24 | } 25 | 26 | .Dashboard tr th, 27 | .Dashboard tr td { 28 | padding: 0 1rem !important; 29 | text-align: center; 30 | } 31 | .Dashboard tr td:first-child { 32 | text-align: left; 33 | } 34 | 35 | .Dashboard-section { 36 | white-space: nowrap; 37 | overflow: hidden; 38 | text-overflow: ellipsis; 39 | } 40 | -------------------------------------------------------------------------------- /assets/_fonts.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Use the default user interface font in all browsers (opinionated). 3 | */ 4 | 5 | html { 6 | font-family: system-ui, /* macOS 10.11-10.12 */ -apple-system, 7 | /* Windows 6+ */ 'Segoe UI', /* Android 4+ */ 'Roboto', 8 | /* Ubuntu 10.10+ */ 'Ubuntu', /* Gnome 3+ */ 'Cantarell', 9 | /* KDE Plasma 5+ */ 'Noto Sans', /* fallback */ sans-serif, 10 | /* macOS emoji */ 'Apple Color Emoji', /* Windows emoji */ 'Segoe UI Emoji', 11 | /* Windows emoji */ 'Segoe UI Symbol', /* Linux emoji */ 'Noto Color Emoji'; 12 | } 13 | 14 | /** 15 | * Use the default monospace user interface font in all browsers (opinionated). 16 | */ 17 | 18 | code, 19 | kbd, 20 | samp, 21 | pre { 22 | font-family: 23 | /* macOS 10.10+ */ 'Menlo', /* Windows 6+ */ 'Consolas', 24 | /* Android 4+ */ 'Roboto Mono', /* Ubuntu 10.10+ */ 'Ubuntu Monospace', 25 | /* KDE Plasma 5+ */ 'Noto Mono', /* KDE Plasma 4+ */ 'Oxygen Mono', 26 | /* Linux/OpenOffice fallback */ 'Liberation Mono', /* fallback */ monospace, 27 | /* macOS emoji */ 'Apple Color Emoji', /* Windows emoji */ 'Segoe UI Emoji', 28 | /* Windows emoji */ 'Segoe UI Symbol', /* Linux emoji */ 'Noto Color Emoji'; 29 | } 30 | -------------------------------------------------------------------------------- /assets/_icons.scss: -------------------------------------------------------------------------------- 1 | .icon { 2 | display: inline-block; 3 | width: 1em; 4 | height: 1em; 5 | stroke-width: 0; 6 | stroke: currentColor; 7 | fill: currentColor; 8 | vertical-align: text-bottom; 9 | margin: 1px; 10 | } 11 | -------------------------------------------------------------------------------- /assets/_utils-custom.scss: -------------------------------------------------------------------------------- 1 | .u-VaMiddle { 2 | vertical-align: middle; 3 | } 4 | -------------------------------------------------------------------------------- /assets/_variables.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | --cl-red: #ff0010; 3 | --cl-orange: #ff6f00; 4 | --cl-yellow: #ffef00; 5 | --cl-green: #90ff00; 6 | --cl-blue: #0090ff; 7 | --cl-gray: #6c8293; 8 | 9 | --color-link: var(--cl-blue); 10 | --color-visited-link: var(--cl-blue); 11 | } 12 | -------------------------------------------------------------------------------- /assets/js/katex.js: -------------------------------------------------------------------------------- 1 | import renderMathInElement from 'katex/dist/contrib/auto-render.mjs' 2 | 3 | function renderKatex(target) { 4 | renderMathInElement(target, { 5 | ignoredTags: ['script', 'noscript', 'style', 'textarea'], 6 | throwOnError: false, 7 | delimiters: [ 8 | { left: '$$', right: '$$', display: true }, 9 | { left: '$', right: '$', display: false }, 10 | { left: '\\(', right: '\\)', display: false }, 11 | { left: '\\[', right: '\\]', display: true }, 12 | ], 13 | }) 14 | } 15 | 16 | export { renderKatex } 17 | -------------------------------------------------------------------------------- /assets/plugins/_bagdes.scss: -------------------------------------------------------------------------------- 1 | .section-badges { 2 | text-align: right; 3 | font-size: 20px; 4 | position: relative; 5 | } 6 | .section-badges .toggle { 7 | cursor: pointer; 8 | padding: 8px 0 8px 16px; 9 | } 10 | 11 | .section-badges .dropdown { 12 | position: absolute; 13 | right: 0; 14 | background-color: white; 15 | border: 1px solid #e9ecef; 16 | padding: 0.75rem 1rem; 17 | list-style-type: none; 18 | margin: 0; 19 | z-index: 10; 20 | display: none; 21 | text-align: left; 22 | font-size: 14px; 23 | font-weight: initial; 24 | line-height: 24px; 25 | max-width: 400px; 26 | } 27 | 28 | .section-badges .dropdown li { 29 | white-space: nowrap; 30 | } 31 | 32 | .section-badges .dropdown code.label { 33 | max-width: 200px; 34 | white-space: nowrap; 35 | overflow: auto; 36 | display: inline-block; 37 | } 38 | .section-badges .dropdown code.label::-webkit-scrollbar { 39 | width: 3px; 40 | height: 3px; 41 | } 42 | .section-badges .dropdown code.label::-webkit-scrollbar-thumb { 43 | border-radius: 12px; 44 | } 45 | 46 | .section-badges input.toggle:checked ~ .dropdown { 47 | display: block; 48 | } 49 | -------------------------------------------------------------------------------- /assets/plugins/_dark.scss: -------------------------------------------------------------------------------- 1 | $gray-100: #232323; 2 | $gray-200: #282a36; 3 | 4 | // https://www.colorhexa.com/090909 5 | $body-background: #090909; 6 | $body-font-color: rgba(255, 255, 255, 0.8); 7 | 8 | $color-link: #0090ff; 9 | $color-visited-link: #0090ff; 10 | 11 | $icon-filter: brightness(0) invert(1); 12 | 13 | $book-search-results-bg: rgba(255, 255, 255, 0.1); 14 | -------------------------------------------------------------------------------- /assets/plugins/_diagrams.scss: -------------------------------------------------------------------------------- 1 | // SVG Diagrams 2 | .diagrams-container { 3 | margin: 20px 0px; 4 | border: 1px solid var(--gray-200); 5 | border-radius: $border-radius; 6 | } 7 | .diagrams { 8 | height: 400px; 9 | overflow: hidden; 10 | outline: none; 11 | cursor: pointer; 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | } 16 | .diagrams img { 17 | max-height: 100%; 18 | max-width: 100%; 19 | display: flex; 20 | justify-content: center; 21 | align-items: center; 22 | } 23 | .diagrams:active { 24 | cursor: grabbing; 25 | } 26 | .diagrams-caption { 27 | border-bottom: 1px solid #e9ecef; 28 | padding: 0.5rem; 29 | font-size: 12px; 30 | font-weight: 500; 31 | .diagrams-link { 32 | text-decoration: none !important; 33 | float: right; 34 | font-weight: 400; 35 | } 36 | } 37 | .diagrams-container .highlight pre { 38 | margin: 0; 39 | border-top-left-radius: 0; 40 | border-top-right-radius: 0; 41 | // margin: 0 -1px; 42 | } 43 | .diagrams-container .embed-comment { 44 | margin: 0.5rem 1rem; 45 | } 46 | -------------------------------------------------------------------------------- /assets/plugins/_meter.scss: -------------------------------------------------------------------------------- 1 | .meter { 2 | height: 24px; /* Can be anything */ 3 | background: #ebebeb; 4 | border-radius: 4px; 5 | color: #222; 6 | border-radius: 4px; 7 | overflow: hidden; 8 | } 9 | .meter > .bar { 10 | display: inline-block; 11 | height: 100%; 12 | line-height: 24px; 13 | text-align: right; 14 | font-size: 12px; 15 | padding-right: 1em; 16 | vertical-align: top; 17 | } 18 | -------------------------------------------------------------------------------- /assets/plugins/_numbered.scss: -------------------------------------------------------------------------------- 1 | .book-page .markdown { 2 | counter-reset: h1 h2 h3 h4 h5 h6; 3 | } 4 | 5 | .book-page .markdown section > h1 { 6 | counter-reset: h2 0; 7 | counter-increment: h1; 8 | } 9 | .book-page .markdown section > h1::before { 10 | content: counter(h1) '. '; 11 | margin-right: 4px; 12 | } 13 | .book-page .markdown section > h2 { 14 | counter-reset: h3 0; 15 | counter-increment: h2; 16 | } 17 | .book-page .markdown section > h2::before { 18 | content: counter(h1) '.' counter(h2) '.'; 19 | margin-right: 4px; 20 | } 21 | .book-page .markdown section > h3 { 22 | counter-reset: h4 0; 23 | counter-increment: h3; 24 | } 25 | .book-page .markdown section > h3::before { 26 | content: counter(h1) '.' counter(h2) '.' counter(h3) '.' ' '; 27 | margin-right: 4px; 28 | } 29 | .book-page .markdown section > h4 { 30 | counter-reset: h5 0; 31 | counter-increment: h4; 32 | } 33 | .book-page .markdown section > h4::before { 34 | content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.' ' '; 35 | margin-right: 4px; 36 | } 37 | .book-page .markdown section > h5 { 38 | counter-reset: h6 0; 39 | counter-increment: h5; 40 | } 41 | .book-page .markdown section > h5::before { 42 | content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.' 43 | counter(h5) '.' ' '; 44 | margin-right: 4px; 45 | } 46 | .book-page .markdown section > h6 { 47 | counter-reset: h7 0; 48 | counter-increment: h6; 49 | } 50 | .book-page .markdown section > h6::before { 51 | content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.' 52 | counter(h5) '.' counter(h6) '.' ' '; 53 | margin-right: 4px; 54 | } 55 | -------------------------------------------------------------------------------- /assets/plugins/_scrollbars.scss: -------------------------------------------------------------------------------- 1 | @import 'defaults'; 2 | @import 'variables'; 3 | 4 | ::-webkit-scrollbar { 5 | width: 6.5px; 6 | height: 6.5px; 7 | } 8 | 9 | * { 10 | -ms-overflow-style: -ms-autohiding-scrollbar; 11 | scrollbar-width: thin; 12 | scrollbar-color: rgba(0, 0, 0, 0.3) transparent; 13 | } 14 | 15 | ::-webkit-scrollbar-thumb { 16 | background: rgba(0, 0, 0, 0.3); 17 | border-radius: 6px; 18 | } 19 | 20 | ::-webkit-scrollbar-button, 21 | ::-webkit-scrollbar-track-piece, 22 | ::-webkit-scrollbar-corner, 23 | ::-webkit-resizer { 24 | display: none; 25 | } 26 | 27 | // code blocks 28 | .markdown pre::-webkit-scrollbar { 29 | background-color: transparent; 30 | } 31 | 32 | .markdown pre { 33 | scrollbar-color: transparent transparent; 34 | } 35 | .markdown pre:hover { 36 | scrollbar-color: rgba(255, 255, 255, 0.3) transparent; 37 | } 38 | .markdown pre:active { 39 | scrollbar-color: rgba(255, 255, 255, 0.4) transparent; 40 | } 41 | 42 | .markdown pre::-webkit-scrollbar-thumb { 43 | background-color: transparent; 44 | } 45 | .markdown pre:hover::-webkit-scrollbar-thumb { 46 | background-color: rgba(255, 255, 255, 0.3); 47 | } 48 | .markdown pre::-webkit-scrollbar-thumb:active { 49 | background-color: rgba(255, 255, 255, 0.4); 50 | } 51 | 52 | // toc 53 | .toc > ol { 54 | scrollbar-color: transparent transparent; 55 | } 56 | .toc > ol:hover { 57 | scrollbar-color: inherit; 58 | } 59 | 60 | .toc > ol::-webkit-scrollbar { 61 | display: none; 62 | } 63 | .toc > ol:hover::-webkit-scrollbar { 64 | display: initial; 65 | } 66 | -------------------------------------------------------------------------------- /assets/plugins/_table-sort.scss: -------------------------------------------------------------------------------- 1 | th[role='columnheader']:not(.no-sort) { 2 | cursor: pointer; 3 | position: relative; 4 | min-width: 110px; 5 | } 6 | 7 | th[role='columnheader']:not(.no-sort):after { 8 | content: ''; 9 | position: absolute; 10 | top: -3px; 11 | right: 10px; 12 | margin-top: 10px; 13 | border-width: 0 4px 4px; 14 | border-style: solid; 15 | border-color: #404040 transparent; 16 | visibility: hidden; 17 | opacity: 0; 18 | -ms-user-select: none; 19 | -webkit-user-select: none; 20 | -moz-user-select: none; 21 | user-select: none; 22 | } 23 | 24 | th[aria-sort='ascending']:not(.no-sort):after { 25 | border-bottom: none; 26 | border-width: 4px 4px 0; 27 | } 28 | 29 | th[aria-sort]:not(.no-sort):after { 30 | visibility: visible; 31 | opacity: 0.4; 32 | } 33 | 34 | th[role='columnheader']:not(.no-sort):hover:after { 35 | visibility: visible; 36 | opacity: 1; 37 | } 38 | -------------------------------------------------------------------------------- /assets/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ .Site.Title }}", 3 | "short_name": "{{ .Site.Title }}", 4 | "start_url": "{{ " / " | relURL }}", 5 | "scope": "{{ " / " | relURL }}", 6 | "icons": [ 7 | { 8 | "src": "/android-chrome-192x192.png", 9 | "sizes": "192x192", 10 | "type": "image/png" 11 | }, 12 | { 13 | "src": "/android-chrome-512x512.png", 14 | "sizes": "512x512", 15 | "type": "image/png" 16 | } 17 | ], 18 | "theme_color": "#0090ff", 19 | "background_color": "#0090ff", 20 | "display": "standalone" 21 | } 22 | -------------------------------------------------------------------------------- /content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Home 3 | type: single 4 | --- 5 | -------------------------------------------------------------------------------- /content/algorithms/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Algorithms 3 | weight: 4 4 | 5 | dashboardWeight: 2 6 | dashboardState: wip 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Algorithms 12 | -------------------------------------------------------------------------------- /content/algorithms/block_reception.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Block Reception' 3 | draft: true 4 | --- 5 | 6 | ```go 7 | func (g *BlockValidationGraph_I) ConsiderBlock(block Block) { 8 | panic("TODO") 9 | // g.UnconnectedBlocks.AddBlock(block) 10 | // g.tryConnectBlockToFringe(block) 11 | } 12 | 13 | func (g *BlockValidationGraph_I) tryConnectBlockToFringe(block Block) { 14 | panic("TODO") 15 | 16 | // try to connect the block, and then try connecting its descendents. 17 | // 18 | // this algorithm should be breadth-first because we need to process the fringe 19 | // in order. Depth-first search may consider blocks whose parents are still 20 | // yet to be added 21 | // blocks := Queue < Block > 22 | // blocks.Enqueue(block) 23 | // for block := range blocks.Dequeue() { 24 | // if !g.ValidationFringe.HasTipset(block.Parents()) { 25 | // continue // ignore this one. not all of its parents are in fringe 26 | // } 27 | 28 | // children := g.UnconnectedBlocks.Children[block] 29 | // g.UnconnectedBlocks.Parents.Remove(block) 30 | // g.UnconnectedBlocks.Children.Remove(block) 31 | // g.ValidationFringe.AddBlock(block) 32 | // blocks.EnqueueAll(children) 33 | // } 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /content/algorithms/crypto/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Cryptographic Primitives' 3 | bookCollapseSection: true 4 | weight: 7 5 | dashboardWeight: 2 6 | dashboardState: wip 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Cryptographic Primitives 12 | 13 | - Merkle tree/DAG 14 | - Vector commitment scheme 15 | - zkSNARK 16 | - Reliable broadcast channel (libp2p) 17 | 18 | - TODO: Add more detail and include references to relevant papers. 19 | -------------------------------------------------------------------------------- /content/algorithms/crypto/bls.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import util "github.com/filecoin-project/specs/util" 4 | 5 | func (self *BLS_I) Verify(input util.Bytes, pk PublicKey, sig util.Bytes) bool { 6 | // blsPk := pk.(*BLSPublicKey) 7 | // 1. Verify public key according to string_to_curve section 2.6.2.1. in 8 | // https://tools.ietf.org/html/draft-boneh-bls-signature-00#page-12 9 | // 2. Verify signature according to section 2.3 10 | // https://tools.ietf.org/html/draft-boneh-bls-signature-00#page-8 11 | panic("bls.Verify TODO") 12 | return false 13 | } 14 | 15 | func (self *BLS_I) MaxSigValue() util.Bytes { 16 | panic("TODO") 17 | } 18 | 19 | func (self *BLS_I) Sign(input util.Bytes, sk *SecretKey) bool { 20 | panic("see 2.3 in https://tools.ietf.org/html/draft-boneh-bls-signature-00#page-8") 21 | return false 22 | } 23 | 24 | func (self *BLS_I) Aggregate(sig2 util.Bytes) util.Bytes { 25 | panic("see 2.5 in https://tools.ietf.org/html/draft-boneh-bls-signature-00#page-8") 26 | var ret util.Bytes 27 | return ret 28 | } 29 | 30 | func (self *BLS_I) VerifyAggregate(messages []util.Bytes, aggPk PublicKey, aggSig util.Bytes) bool { 31 | panic("see 2.5.2 in https://tools.ietf.org/html/draft-boneh-bls-signature-00#page-9") 32 | return false 33 | } 34 | -------------------------------------------------------------------------------- /content/algorithms/crypto/bls.id: -------------------------------------------------------------------------------- 1 | // BLS implements the Signature interface using the BLS signature scheme 2 | // with the BLS12-381 group of elliptic curves. 3 | type BLS struct { 4 | // This signature is the one returned from SigKeyPair.Sign(). It can be 5 | // casted to a BLS signature struct to get the additional functionalities. 6 | Signature 7 | 8 | // This represents the largest potential value for a BLS signature in Bytes 9 | MaxSigValue() Bytes 10 | 11 | // Aggregates this BLS signature and `sig` into one BLS signature that can 12 | // be verified against the aggregation of the two public key that signed 13 | // the aggregated signatures. 14 | Aggregate(sig2 SignatureBytes) SignatureBytes 15 | 16 | // VerifyAggregate verifies the aggregate signature with the aggregate 17 | // public key over all the distinct messages given. Note that if all 18 | // messages are the same, it is sufficient and correct to only call 19 | // `Verify` since it is a subset of `VerifyAggregate`. 20 | VerifyAggregate(messages [Message], aggPk BLSPublicKey, aggSig SignatureBytes) bool 21 | } 22 | 23 | // BLSPublicKey is a PublicKey with an addition method to aggregate public keys 24 | // together. 25 | type BLSPublicKey struct { 26 | PublicKey 27 | 28 | // Aggregate this public key with p2 into one public key. This aggregated 29 | // public key can 30 | // - verify aggregated signatures signed by the two BLSPublicKey 31 | // - be aggregated further down with other (aggregated or not) BLSPublicKey. 32 | Aggregate(p2 BLSPublicKey) BLSPublicKey 33 | } 34 | -------------------------------------------------------------------------------- /content/algorithms/crypto/ecdsa.id: -------------------------------------------------------------------------------- 1 | // ECDSA implements the Signature interface using the ECDSA algorithm with 2 | // the Secp256k1 elliptic curve. 3 | type ECDSA struct { 4 | // The Signature object is the one returned from SigKeyPair.Sign(). It can 5 | // be casted to ECDSA to get the additional functionality described below. 6 | Signature 7 | 8 | // Recover recovers a public key associated with a particular signature. 9 | // 10 | // Out: 11 | // pk - the public key associated with `M` who signed `m` 12 | // err - a standard error message indicating any process issues 13 | // ** 14 | // In: 15 | // m - a series of bytes representing the signed message 16 | // sig - a series of bytes representing a signature usually `r`|`s` 17 | // 18 | Recover(m Message, sig SignatureBytes) struct {pk PublicKey, err error} 19 | } 20 | -------------------------------------------------------------------------------- /content/algorithms/crypto/signatures.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | // Sign generates a proof that miner `M` generate message `m` 4 | // 5 | // Out: 6 | // sig - a signature 7 | // err - a standard error message indicating any process issues 8 | // In: 9 | // m - a series of bytes representing a message to be signed 10 | // 11 | func Sign(keyPair SigKeyPair, m Message) (Signature, error) { 12 | panic("TODO") 13 | } 14 | 15 | // Verify validates the statement: only `M` could have generated `sig` 16 | // given the validator has a message `m`, a signature `sig`, and a 17 | // public key `pk`. 18 | // 19 | // Out: 20 | // valid - a boolean value indicating the signature is valid 21 | // err - a standard error message indicating any process issues 22 | // In: 23 | // pk - the public key belonging to the signer `M` 24 | // m - a series of bytes representing the signed message 25 | // 26 | func Verify(pk PublicKey, sig Signature, m Message) (valid bool, err error) { 27 | panic("TODO") 28 | } 29 | -------------------------------------------------------------------------------- /content/algorithms/crypto/signatures.id: -------------------------------------------------------------------------------- 1 | type Message Bytes 2 | type SecretKey Bytes 3 | type PublicKey Bytes 4 | type SignatureBytes Bytes 5 | 6 | type SigKeyPair struct { 7 | PublicKey 8 | SecretKey 9 | } 10 | 11 | type Signature struct { 12 | Type SigType @(internal) 13 | Sig SignatureBytes @(internal) 14 | } 15 | 16 | type SigType enum { 17 | ECDSASigType 18 | BLSSigType 19 | } 20 | -------------------------------------------------------------------------------- /content/algorithms/crypto/vrf.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | util "github.com/filecoin-project/specs/util" 5 | "golang.org/x/crypto/blake2b" 6 | ) 7 | 8 | func (self *VRFResult_I) ValidateSyntax() bool { 9 | panic("TODO") 10 | return false 11 | } 12 | 13 | func (self *VRFResult_I) Verify(input util.Bytes, pk VRFPublicKey) bool { 14 | // return new(BLS).Verify(self.Proof, pk.(*BLSPublicKey), input) 15 | return false 16 | } 17 | 18 | func (self *VRFResult_I) MaxValue() util.Bytes { 19 | panic("") 20 | // return new(BLS).MaxSigValue() 21 | } 22 | 23 | func (self *VRFKeyPair_I) Generate(input util.Bytes) VRFResult { 24 | // sig := new(BLS).Sign(input, self.SecretKey) 25 | var blsSig util.Bytes 26 | 27 | digest := blake2b.Sum256(blsSig) 28 | ret := &VRFResult_I{ 29 | Proof_: blsSig, 30 | Digest_: digest[:], 31 | } 32 | return ret 33 | } 34 | -------------------------------------------------------------------------------- /content/algorithms/crypto/vrf.id: -------------------------------------------------------------------------------- 1 | type VRFPublicKey PublicKey 2 | type VRFSecretKey SecretKey 3 | 4 | // VRFKeyPair holds the private key and respectively the public key to create 5 | // and respectively verify a VRF output. 6 | type VRFKeyPair struct { 7 | VRFPublicKey 8 | VRFSecretKey 9 | 10 | // Generate a VRF from the given input with the SecretKey that can be 11 | // verified with the PublicKey 12 | Generate(input Bytes) VRFResult 13 | } 14 | 15 | type VRFResult struct { 16 | Output Bytes // @(internal) 17 | 18 | Proof Bytes 19 | Digest Bytes 20 | MaxValue() Bytes 21 | ValidateSyntax() bool 22 | 23 | Verify(input Bytes, pk VRFPublicKey) bool 24 | } 25 | -------------------------------------------------------------------------------- /content/algorithms/crypto/vrf.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Verifiable Random Function' 3 | weight: 2 4 | dashboardWeight: 2 5 | dashboardState: incorrect 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Verifiable Random Function 11 | 12 | Filecoin uses the notion of a [Verifiable Random 13 | Function](https://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Pseudo%20Randomness/Verifiable_Random_Functions.pdf) 14 | (VRF). A VRF uses a private key to produce a digest of 15 | an arbitrary message such that the output is unique per signer and per message. 16 | Any third party in possession of the corresponding public key, the message, and 17 | the VRF output, can verify if the digest has been computed correctly and by the 18 | correct signer. Using a VRF in the ticket generation process allows anyone to 19 | verify if a block comes from an eligible block producer (see [Ticket Generation](storage_power_consensus#tickets) for more details). 20 | 21 | BLS signature can be used as the basis to construct a VRF. Filecoin transforms 22 | the BLS signature scheme it uses (see [Signatures](signatures) into a 23 | VRF, Filecoin uses the random oracle model and deterministically hashes the 24 | signature (using blake2b to produce a 256 bit output) to produce the final digest. 25 | 26 | These digests are often used as entropy for randomness in the protocol (see [Randomness](randomness)). 27 | 28 | {{}} 29 | {{}} 30 | -------------------------------------------------------------------------------- /content/algorithms/expected_consensus/diagrams/double_fork.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | rankdir=RL; 3 | node [shape=box, style="filled", color="green3"] 4 | 5 | B1 [label="B1\nMinerAny"] 6 | B2 [label="B2\nMinerAny"] 7 | B3 [label="B3\nMinerAny"] 8 | B4 [label="B4\nMinerE", color=pink] 9 | B5 [label="B5\nMinerE", color=pink] 10 | 11 | B4 -> B2 -> B1 12 | B5 -> B3 -> B1 13 | } -------------------------------------------------------------------------------- /content/algorithms/expected_consensus/diagrams/parent_grinding.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | rankdir=RL; 3 | node [shape=box, style="filled", color="green3"] 4 | 5 | B1 [label="B1\nMinerAny"] 6 | B2 [label="B2\nMinerAny"] 7 | B3 [label="B3\nMinerE", color=pink] 8 | B4 [label="B4\nMinerE", color=pink] 9 | B5 [label="B5\nMinerAny"] 10 | B4Null [label="", color=gray, style=dashed] 11 | 12 | B4 -> B4Null -> B2 -> B1 13 | B3 -> B1 14 | B5 -> B3 15 | B5 -> B2 16 | } -------------------------------------------------------------------------------- /content/algorithms/expected_consensus/diagrams/time_offset.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | rankdir=RL; 3 | node [shape=box, style="filled", color="green3"] 4 | 5 | B1 [label="B1\nMinerAny"] 6 | B2 [label="B2\nMinerAny"] 7 | B3 [label="B3\nMinerE", color=pink] 8 | B4 [label="B4\nMinerE", color=pink] 9 | 10 | B2 -> B1 11 | B3 -> B2 12 | B4 -> B2 13 | 14 | edge[style=invis]; 15 | B4 -> B3 16 | } -------------------------------------------------------------------------------- /content/algorithms/porep-old/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Proof-of-Replication 3 | bookCollapseSection: true 4 | weight: 2 5 | bookhidden: true 6 | --- 7 | 8 | # Proof-of-Replication 9 | 10 | _Proof-of-Replication(PoRep)_, is a new kind of _Proof-of-Storage_, that can be used to prove that some data _D_ has been replicated to its own uniquely dedicated physical storage. Enforcing unique physical copies enables a verifier to check that a prover is not deduplicating multiple copies of _D_ into the same storage space. This construction is particularly useful in Cloud Computing and Decentralized Storage Networks, which must be transparently verifiable, resistant to Sybil attacks, and unfriendly to outsourcing. 11 | 12 | Section 3.2 of the [Filecoin Paper](https://filecoin.io/filecoin.pdf) provides the original introduction to Proof-of-Replication. 13 | -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'PoRep Commitments' 3 | weight: 2 4 | --- 5 | 6 | # PoRep Commitments 7 | 8 | {{< hint warning >}} 9 | TODO: Description 10 | {{< /hint >}} 11 | -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/data-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/data-layer.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-0.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-1.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-2.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-3.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-4.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/layer-5.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/legend-even.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/legend-even.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/legend-odd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/legend-odd.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/legend.png -------------------------------------------------------------------------------- /content/algorithms/porep-old/porep_commitments/sdr_commitments/replica-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/algorithms/porep-old/porep_commitments/sdr_commitments/replica-layer.png -------------------------------------------------------------------------------- /content/algorithms/pos/porep.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PoRep 3 | weight: 1 4 | dashboardWeight: 2 5 | dashboardState: reliable 6 | dashboardAudit: wip 7 | dashboardTests: 0 8 | --- 9 | 10 | # Proof-of-Replication (PoRep) 11 | 12 | In order to register a sector with the Filecoin network, the sector has to be sealed. Sealing is a computation-heavy process that produces a unique representation of the data in the form of a proof, called **_Proof-of-Replication_** or PoRep. 13 | 14 | The PoRep proof ties together: i) the data itself, ii) the miner actor that performs the sealing and iii) the time when the specific data has been sealed by the specific miner. In other words, if the same miner attempts to seal the same data at a later time, then this will result in a different PoRep proof. Time is included as the blockchain height when sealing took place and the corresponding chain reference is called `SealRandomness`. 15 | 16 | Once the proof has been generated, the miner runs a SNARK on the proof in order to compress it and submits the result to the blockchain. This constitutes a certification that the miner has indeed replicated a copy of the data they agreed to store. 17 | 18 | The PoRep process includes the following two phases: 19 | 20 | - **Sealing preCommit phase 1.** In this phase, PoRep SDR [encoding](sdr#encoding) and [replication](sdr#replication) takes place. 21 | - **Sealing preCommit phase 2.** In this phase, [Merkle proof and tree generation](sdr#merkle-proofs) is performed using the Poseidon hashing algorithm. 22 | -------------------------------------------------------------------------------- /content/appendix/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Appendix 3 | weight: 7 4 | dashboardWeight: 0.2 5 | dashboardState: wip 6 | dashboardAudit: n/a 7 | --- 8 | 9 | # Appendix 10 | -------------------------------------------------------------------------------- /content/implementations/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Implementations 3 | weight: 8 4 | 5 | dashboardhidden: true 6 | dashboardWeight: 1 7 | dashboardState: reliable 8 | dashboardAudit: n/a 9 | --- 10 | 11 | # Filecoin Implementations 12 | 13 | Filecoin is targeting [multiple implementations](https://filecoin.io/blog/announcing-filecoin-implementations-in-rust-and-c++/) of the protocol in order to guarantee security but also resilience of the Filecoin network. There are currently four active implementation efforts: 14 | 15 | - [Lotus](https://lotu.sh): the Go-based implementation, supported by [Protocol Labs](https://protocol.ai), 16 | - [Forest](https://github.com/ChainSafe/forest): the Rust-based implementation, supported by [ChainSafe](https://chainsafe.io), 17 | - [Fuhon (deprecated)](https://github.com/filecoin-project/cpp-filecoin): the C++-based implementation, supported by [Soramitsu](https://soramitsu.co.jp), 18 | - [Venus](https://github.com/filecoin-project/go-filecoin): a second Go-based implementation of Filecoin, previously called `go-filecoin`, which is maintained by the [IPFS-Force Community](https://github.com/ipfs-force-community). 19 | 20 | {{}} 21 | -------------------------------------------------------------------------------- /content/implementations/forest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Forest 3 | weight: 3 4 | dashboardWeight: 1 5 | dashboardState: reliable 6 | dashboardAudit: n/a 7 | implRepos: 8 | - { lang: rust, repo: https://github.com/ChainSafe/forest } 9 | --- 10 | 11 | # Forest 12 | 13 | Forest is an implementation of Filecoin written in Rust. It focuses on performance and low resource usage. It is compatible with most of the JSON-RPC API exposed by Lotus, making it easy to use with existing tools and libraries. 14 | 15 | Forest does not support all features of the reference implementation but is a good fit for specific applications, such as: 16 | 17 | - generating Filecoin snapshots, 18 | - running a bootstrap node, 19 | - running an RPC node. 20 | 21 | Forest does not provide storage provider functionality. 22 | 23 | Links: 24 | 25 | - [Source code](https://github.com/ChainSafe/forest) 26 | - [Documentation](https://docs.forest.chainsafe.io/) 27 | - [Website](https://forest.chainsafe.io/) 28 | 29 | The Forest implementation of Filecoin is maintained by [ChainSafe](https://chainsafe.io/). 30 | -------------------------------------------------------------------------------- /content/implementations/fuhon.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Fuhon (deprecated) 3 | weight: 4 4 | dashboardWeight: 1 5 | dashboardState: reliable 6 | dashboardAudit: n/a 7 | implRepos: 8 | - { lang: c++, repo: https://github.com/filecoin-project/cpp-filecoin } 9 | --- 10 | 11 | # Fuhon (cpp-filecoin) 12 | 13 | Fuhon is the C++ implementation of Filecoin. The implementation uses Rust libraries for BLS, so Rust is needed in order to build successfully. 14 | 15 | You can find the Fuhon codebase [here](https://github.com/filecoin-project/cpp-filecoin). 16 | 17 | The Fuhon implementation of Filecoin is supported by [Soramitsu](https://soramitsu.co.jp/). 18 | 19 | Since May 2022, this implementation has been deprecated and out of support. The existing code repositories will remain public. 20 | -------------------------------------------------------------------------------- /content/implementations/venus.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Venus 3 | weight: 2 4 | dashboardWeight: 1 5 | dashboardState: reliable 6 | dashboardAudit: n/a 7 | implRepos: 8 | - { lang: go, repo: https://github.com/filecoin-project/venus } 9 | --- 10 | 11 | # Venus 12 | 13 | Venus, previously called `go-filecoin`, is another implementation of Filecoin in Go and is maintained by the [IPFS Force Community](https://github.com/ipfs-force-community). The `go-filecoin` implementation, before it was renamed to Venus and taken over by IPFS Force, was already nearly feature-complete (as of June 2020) with `go-filecoin` nodes interoperating with Lotus nodes. 14 | 15 | Protocol Labs is offering [DevGrants](https://github.com/filecoin-project/devgrants/issues/140) to support the development of Venus. 16 | 17 | You can find the Venus codebase [here](https://github.com/filecoin-project/venus) and its extensive documentation website [here](https://go.filecoin.io/). 18 | -------------------------------------------------------------------------------- /content/intro/arch.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Architecture Diagrams' 3 | audit: 1 4 | dashboardWeight: 0.2 5 | dashboardState: reliable 6 | dashboardAudit: n/a 7 | --- 8 | 9 | # Architecture Diagrams 10 | 11 | Actor State Diagram 12 | 13 | ![Actor State Diagram](/intro/new-state-diagram.mmd) 14 | -------------------------------------------------------------------------------- /content/intro/diagrams/buildsys/buildsys.dot: -------------------------------------------------------------------------------- 1 | strict digraph G { 2 | node [shape=box] 3 | graph [ranksep="1", nodesep="1"] 4 | 5 | { // editable inputs 6 | node [fillcolor=lightyellow, style=filled] 7 | ".md" 8 | ".ipld" 9 | ".go" 10 | ".orient" 11 | ".org" 12 | ".dot" 13 | } 14 | 15 | { // outputs 16 | node [fillcolor=lightgreen, style=filled] 17 | "[website]" 18 | "spec.pdf" 19 | } 20 | 21 | { // programs 22 | node [shape=none] 23 | "emacs" 24 | "dot" 25 | "orient" 26 | "bin/codeGen" 27 | "hugo" 28 | "go test" 29 | "make website" 30 | "make pdf" 31 | } 32 | 33 | 34 | ".org" -> "" -> ".md" 35 | ".md" -> "hugo build" -> ".html" 36 | 37 | ".orient" -> "orient" -> "" -> ".md" 38 | ".orient" -> "orient" -> ".dot" 39 | ".orient" -> "orient" -> ".html" 40 | 41 | ".dot" -> "dot" -> ".svg" 42 | 43 | ".ipld" -> "bin/codeGen" -> ".go" 44 | ".go" -> "go test" -> "[ok]" 45 | ".go" -> "hugo build" -> ".html" 46 | 47 | ".html" -> "make website" -> "[website]" 48 | ".svg" -> "make website" -> "[website]" 49 | 50 | ".md" -> "make pdf" -> "spec.pdf" 51 | ".svg" -> "make pdf" -> "spec.pdf" 52 | } 53 | -------------------------------------------------------------------------------- /content/intro/diagrams/overview2/overview2.mmd: -------------------------------------------------------------------------------- 1 | graph TB 2 | 3 | 4 | subgraph FilesAndData 5 | Pos2 6 | File 7 | Piece 8 | DataTransfer 9 | end 10 | 11 | subgraph FilecoinNode 12 | Pos1 13 | 14 | P2PNode 15 | subgraph Repository 16 | Config 17 | IpldStore 18 | KeyStore 19 | end 20 | Clock 21 | FileStore 22 | end 23 | 24 | 25 | subgraph libraries 26 | Pos0 27 | 28 | subgraph multiformats 29 | multihash 30 | multiaddr 31 | end 32 | subgraph libp2p 33 | subgraph libp2pCore 34 | p2p.Node 35 | p2p.PeerID 36 | p2p.PeerInfo 37 | p2p.Node --> p2p.PeerID 38 | p2p.Node --> p2p.PeerInfo 39 | end 40 | subgraph libp2pProtocols 41 | Gossipsub 42 | BootstrapList 43 | end 44 | end 45 | subgraph ipld 46 | ipld.CID 47 | ipld.Selector 48 | ipld.GraphStore 49 | end 50 | subgraph ipfs 51 | Bitswap 52 | Graphsync 53 | UnixFS 54 | DagImports 55 | end 56 | 57 | Bitswap -.-> p2p.Node 58 | Graphsync -.-> p2p.Node 59 | Graphsync -.-> ipld.Selector 60 | Gossipsub -.-> p2p.Node 61 | BootstrapList -.-> p2p.Node 62 | p2p.PeerID -.-> multihash 63 | p2p.PeerInfo -.-> multiaddr 64 | ipld.CID-.->multihash 65 | end 66 | 67 | P2PNode -.-> p2p.Node 68 | IpldStore -.-> ipld.GraphStore 69 | 70 | Pos2 --> Pos1 71 | Pos1 --> Pos0 72 | -------------------------------------------------------------------------------- /content/intro/new-state-diagram.mmd: -------------------------------------------------------------------------------- 1 | stateDiagram 2 | 3 | Null --> Precommitted: PreCommitSectors 4 | Precommitted --> Committed: CommitSectors 5 | Precommitted --> Deleted: CronPreCommitExpiry (PCD) 6 | Committed --> Active: SubmittedWindowPoSt 7 | Committed --> Faulty: DeclareFault\nSubmitWindowPoSt (SP)\nProvingDeadline (SP) 8 | Committed --> Terminated: TerminateSectors\n(TF) 9 | Faulty --> Active: SubmittedWindowPoSt (FF) 10 | Faulty --> Faulty: ProvingDeadline (FF) 11 | Faulty --> Recovering: DeclareFaultRecovered 12 | Faulty --> Terminated: EarlyExpiration (TF)\nTerminateSectors (TF) 13 | Recovering --> Active: SubmittedWindowPoSt (FF) 14 | Recovering --> Faulty: DeclareFault\nProvingDeadline (SP) 15 | Recovering --> Terminated: TerminateSectors (TF) 16 | Active --> Active: SubmittedWindowPoSt 17 | Active --> Faulty: DeclareFault\nSubmitWindowPoSt (SP)\nProvingDeadline (SP) 18 | Active --> Terminated: CronExpiration\nTerminateSectors (TF) 19 | Terminated --> Deleted: CompactSectors 20 | -------------------------------------------------------------------------------- /content/intro/systems/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: System Decomposition 3 | weight: 6 4 | bookCollapseSection: true 5 | dashboardWeight: 0.2 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | --- 9 | 10 | # System Decomposition 11 | -------------------------------------------------------------------------------- /content/intro/systems/system.id: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/intro/systems/system.id -------------------------------------------------------------------------------- /content/libraries/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Libraries 3 | weight: 3 4 | dashboardWeight: 1.5 5 | dashboardState: reliable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Libraries 11 | -------------------------------------------------------------------------------- /content/libraries/ipfs/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: IPFS 3 | bookCollapseSection: true 4 | weight: 2 5 | dashboardWeight: 1 6 | dashboardState: stable 7 | dashboardAudit: wip 8 | dashboardTests: 0 9 | --- 10 | 11 | # IPFS 12 | 13 | Filecoin is built on the same underlying stack as IPFS - including connecting nodes peer-to-peer via [libp2p](https://libp2p.io) and addressing data using [IPLD](https://ipld.io/). Therefore, it borrows many concepts from the InterPlanetary File System (IPFS), such as content addressing, the CID (which, strictly speaking, is part of the Multiformats specification) and Merkle-DAGs (which is part of IPLD). It also makes direct use of `Bitswap` (the data transfer algorithm in IPFS) and `UnixFS` (the file format built on top of IPLD Merkle-Dags). 14 | 15 | ## Bitswap 16 | 17 | [Bitswap](https://github.com/ipfs/go-bitswap) is a simple peer-to-peer data exchange protocol, used primarily in IPFS, which can also be used independently of the rest of the pieces that make up IPFS. In Filecoin, `Bitswap` is used to request and receive blocks when a node is synchonized ("caught up") but `GossipSub` has failed to deliver some blocks to a node. 18 | 19 | Please refer to the [Bitswap specification](https://github.com/ipfs/specs/blob/master/BITSWAP.md) for more information. 20 | 21 | ## UnixFS 22 | 23 | [UnixFS](https://github.com/ipfs/go-unixfs) is a protocol buffers-based format for describing files, directories, and symlinks in IPFS. `UnixFS` is used in Filecoin as a file formatting guideline for files submitted to the Filecoin network. 24 | 25 | Please refer to the [UnixFS specification](https://github.com/ipfs/specs/blob/master/UNIXFS.md) for more information. 26 | -------------------------------------------------------------------------------- /content/releases/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Releases 3 | weight: 9 4 | --- 5 | 6 | # Releases 7 | 8 | {{}} 9 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/bootstrap/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Genesis 3 | description: Genesis - starting the Blockchain 4 | weight: 6 5 | draft: true 6 | --- 7 | 8 | # Genesis - starting the Blockchain 9 | 10 | {{< hint warning >}} 11 | **WARNING:** This section is not yet complete. 12 | {{< /hint >}} 13 | 14 | Network Bootstrapping starts with production of the genesis block. 15 | 16 | The genesis block will contain: - An initial participant set, including committed storage from these miners (pre-sealed using special-cased randomness) - An initial randomness ticket 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/message_pool/message_storage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Message Storage 3 | weight: 2 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Message Storage 11 | 12 | As mentioned earlier, there is no central pool where messages are included. Instead, every node must have allocated memory for incoming messages. 13 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/message_pool/message_syncer.id: -------------------------------------------------------------------------------- 1 | import msg "github.com/filecoin-project/specs/systems/filecoin_vm/message" 2 | 3 | // MessageSyncer is a component of the MessagePool. It is in charge of receiving and 4 | // propagating Messages. It a libp2p pubsub protocol. 5 | type MessageSyncer struct { 6 | /* 7 | // NewMessageReceived is a channel that returns message objects as they arrive. 8 | // It is a notification for MessageSyncer's client (usually the MessagePool). 9 | NewMessageReceived() MessageChan 10 | 11 | pubsub pubsub.PubSub 12 | sub *pubsub.Subscription 13 | mchan MessageChan 14 | */ 15 | 16 | // SubmitMessage is called to send out a set of messages to the rest of the 17 | // network. This is used for messages added locally. All messages enter the network 18 | // through one of these calls, in at least one filecoin node. They 19 | // are then propagated to other filecoin nodes via the MessagePool 20 | // subsystem. Other nodes receive and propagate Messages via their 21 | // own MessagePools 22 | SubmitMessage(m msg.SignedMessage) error 23 | } 24 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/storage_power_consensus/expected_consensus.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import block "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/block" 3 | import chain "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/chain" 4 | import spowact "github.com/filecoin-project/specs-actors/actors/builtin/storage_power" 5 | 6 | type ExpectedConsensus struct { 7 | expectedLeadersPerEpoch UVarint 8 | expectedRewardPerEpoch UVarint 9 | 10 | ComputeChainWeight(tipset chain.Tipset) block.ChainWeight 11 | IsValidConsensusFault(faults spowact.ConsensusFaultType, blocks [block.Block]) bool 12 | IsWinningChallengeTicket( 13 | challengeTicket util.Bytes 14 | sectorPower abi.StoragePower 15 | networkPower abi.StoragePower 16 | numSectorsSampled util.UVarint 17 | numSectorsMiner util.UVarint 18 | ) bool 19 | 20 | log2b(x UVarint) UVarint 21 | wParams weightFunctionParameters 22 | } 23 | 24 | type weightFunctionParameters struct { 25 | wRatio_num UVarint 26 | wRatio_den UVarint 27 | wPrecision UVarint 28 | } 29 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/struct/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Blocks 3 | bookCollapseSection: true 4 | weight: 1 5 | dashboardWeight: 1.5 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Blocks 12 | 13 | The Block is the main unit of the Filecoin blockchain, as is also the case with most other blockchains. Block messages are directly linked with Tipsets, which are groups of Block messages as detailed later on in this section. In the following we discuss the main structure of a Block message and the process of validating Block messages in the Filecoin blockchain. 14 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/struct/block/block.go: -------------------------------------------------------------------------------- 1 | package block 2 | 3 | // The maximum sum of the size of the serialized messages included in a block. 4 | const BlockMaxSize = 512 * 1024 5 | 6 | // The maximum sum of the gas limits of the messages included in a block. 7 | const BlockGasLimit = 0 // Placeholder 8 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/struct/block/election.go: -------------------------------------------------------------------------------- 1 | package block 2 | 3 | import ( 4 | addr "github.com/filecoin-project/go-address" 5 | abi "github.com/filecoin-project/specs-actors/actors/abi" 6 | acrypto "github.com/filecoin-project/specs-actors/actors/crypto" 7 | filcrypto "github.com/filecoin-project/specs/algorithms/crypto" 8 | util "github.com/filecoin-project/specs/util" 9 | ) 10 | 11 | func (tix *Ticket_I) ValidateSyntax() bool { 12 | return tix.VRFResult_.ValidateSyntax() 13 | } 14 | 15 | //func (tix *Ticket_I) Verify(proof util.Bytes, digest util.Bytes, pk filcrypto.VRFPublicKey) bool { 16 | //p := blake2b.Sum256(proof) 17 | //return tix.VRFResult_.Verify(proof, pk) && bytes.Compare(digest, p[:]) == 0 18 | //} 19 | 20 | func (tix *Ticket_I) Verify(randomness util.Bytes, pk filcrypto.VRFPublicKey, minerActorAddr addr.Address) bool { 21 | input := acrypto.DeriveRandWithMinerAddr(acrypto.DomainSeparationTag_TicketProduction, randomness, minerActorAddr) 22 | return tix.VRFResult_.Verify(input, pk) 23 | } 24 | 25 | func (tix *Ticket_I) DrawRandomness(epoch abi.ChainEpoch) util.Bytes { 26 | return acrypto.DeriveRandWithEpoch(acrypto.DomainSeparationTag_TicketDrawing, tix.Output(), int(epoch)) 27 | } 28 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/struct/block/election.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import filcrypto "github.com/filecoin-project/specs/algorithms/crypto" 3 | import addr "github.com/filecoin-project/go-address" 4 | 5 | type Ticket struct { 6 | VRFResult filcrypto.VRFResult 7 | 8 | Output Bytes @(cached) 9 | DrawRandomness(round abi.ChainEpoch) Bytes 10 | ValidateSyntax() bool 11 | Verify( 12 | input Bytes 13 | pk filcrypto.VRFPublicKey 14 | minerActorAddr addr.Address 15 | ) bool 16 | } 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_blockchain/struct/block_producer/block_producer.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import block "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/block" 3 | import addr "github.com/filecoin-project/go-address" 4 | import msg "github.com/filecoin-project/specs/systems/filecoin_vm/message" 5 | import chain "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/chain" 6 | import cid "github.com/ipfs/go-cid" 7 | 8 | type BlockProducer struct { 9 | // call by StorageMiningSubsystem when elected as a leader 10 | // a procedural call that calls GetMostProfitableMessages(minerAddr Address) 11 | // and then get back the messages and call AssembleBlock 12 | // TODO minerAddr is of type StorageMiner.Address 13 | GenerateBlock( 14 | ePoStInfo abi.OnChainElectionPoStVerifyInfo 15 | newTicket block.Ticket 16 | chainHead chain.Tipset 17 | minerAddr addr.Address 18 | ) 19 | 20 | // call by BlockProducer itself after getting back messages 21 | AssembleBlock( 22 | ePoStInfo abi.OnChainElectionPoStVerifyInfo 23 | T0 block.Ticket 24 | tipset chain.Tipset 25 | minerAddr addr.Address 26 | messages [msg.SignedMessage] 27 | ) block.Block 28 | } 29 | 30 | type BlockStore struct { 31 | GetBlock(c cid.Cid) block.Block 32 | PutBlock(block block.Block) error 33 | } 34 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Files & Data 3 | bookCollapseSection: true 4 | weight: 2 5 | 6 | dashboardWeight: 1.5 7 | dashboardState: reliable 8 | dashboardAudit: n/a 9 | dashboardTests: 0 10 | --- 11 | 12 | # Files & Data 13 | 14 | Filecoin's primary aim is to store client's Files and Data. 15 | This section details data structures and tooling related to working with files, 16 | chunking, encoding, graph representations, `Pieces`, storage abstractions, and more. 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/data_transfer/alternate-pull-flow.mmd: -------------------------------------------------------------------------------- 1 | sequenceDiagram 2 | 3 | participant Requestor 4 | participant ReqDT as Data Transfer Module
(Requestor) 5 | participant ReqSC as Scheduler
(Requestor) 6 | participant ReqGS as Graphsync
(Requestor) 7 | participant ResGS as Graphsync
(Responder) 8 | participant ResSC as Scheduler
(Responder) 9 | participant ResDT as Data Transfer Module
(Responder) 10 | participant Responder 11 | 12 | Note over Requestor,ReqGS: One System. Likely A Client 13 | Note over ResGS,Responder: One System. Likely A Miner 14 | 15 | Requestor ->> ReqDT : Initiate Pull 16 | ReqDT ->> ReqSC : Schedule Transfer 17 | ReqSC ->> ReqGS : Make Graphsync Request w/ Data Transfer Request Piggy Backed 18 | ReqGS ->> ResGS : Send Graphsync Request (w/ Data Transfer Request) 19 | ResGS ->> ResDT : Verify Request (validate & schedule) 20 | ResDT ->> Responder : Validate Pull Request 21 | Responder ->> ResDT : Pull Request validated 22 | ResDT ->> ResSC : Schedule Transfer 23 | ResSC ->> ResGS : Send response w/ DTR Accepted Piggy Backed 24 | ResGS ->> ReqGS : Send response w/ DTR Accepted Piggy Backed 25 | ReqGS ->> ReqSC : Response Progress (to end) (include DT Accepted) 26 | ReqSC ->> ReqDT : Request Complete 27 | ReqDT ->> Requestor : Request Completed (if listening) -------------------------------------------------------------------------------- /content/systems/filecoin_files/data_transfer/data-transfer-modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_files/data_transfer/data-transfer-modules.png -------------------------------------------------------------------------------- /content/systems/filecoin_files/data_transfer/pull-flow.mmd: -------------------------------------------------------------------------------- 1 | sequenceDiagram 2 | 3 | participant Requestor 4 | participant ReqDT as Data Transfer Module
(Requestor) 5 | participant ReqSC as Scheduler
(Requestor) 6 | participant ReqGS as Graphsync
(Requestor) 7 | participant ResGS as Graphsync
(Responder) 8 | participant ResSC as Scheduler
(Responder) 9 | participant ResDT as Data Transfer Module
(Responder) 10 | participant Responder 11 | 12 | Note over Requestor,ReqGS: One System. Likely A Client 13 | Note over ResGS,Responder: One System. Likely A Miner 14 | 15 | Requestor ->> ReqDT : Initiate Pull 16 | ReqDT ->> ResDT : Send Data Transfer Request 17 | ResDT ->> Responder : Validate Pull Request 18 | Responder ->> ResDT : Pull Request validated 19 | ResDT ->> ResSC : Schedule Transfer 20 | ResDT ->> ReqDT : Send Data Transfer Request Accepted 21 | ReqDT ->> ReqSC : Schedule Transfer 22 | ReqSC ->> ReqGS : Make Graphsync Request 23 | ReqGS ->> ResGS : Send Graphsync Request 24 | ResGS ->> ResSC : Verify Transfer Scheduled 25 | ResSC ->> ResGS : Request is scheduled 26 | ResGS ->> ReqGS : Send Response 27 | ReqGS ->> ReqSC : Response Progress (to end) 28 | ReqSC ->> ReqDT : Request Complete 29 | ReqDT ->> Requestor : Request Completed (if listening) -------------------------------------------------------------------------------- /content/systems/filecoin_files/data_transfer/push-flow.mmd: -------------------------------------------------------------------------------- 1 | sequenceDiagram 2 | 3 | participant Requestor 4 | participant ReqDT as Data Transfer Module
(Requestor) 5 | participant ReqSC as Scheduler
(Requestor) 6 | participant ReqGS as Graphsync
(Requestor) 7 | participant ResGS as Graphsync
(Responder) 8 | participant ResSC as Scheduler
(Responder) 9 | participant ResDT as Data Transfer Module
(Responder) 10 | participant Responder 11 | 12 | Note over Requestor,ReqGS: One system. Likely A Client 13 | Note over ResGS,Responder: One system. Likely A Miner 14 | 15 | Requestor ->> ReqDT : Initiate Push 16 | ReqDT ->> ReqSC : Schedule Transfer 17 | ReqDT ->> ResDT : Send Data Transfer Request 18 | ResDT ->> Responder : Validate Push Request 19 | Responder ->> ResDT : Push Request validated 20 | ResDT ->> ResSC : Schedule Transfer 21 | ResSC ->> ResGS : Make Graphsync Request 22 | ResGS ->> ReqGS : Send Graphsync Request 23 | ReqGS ->> ReqSC : Verify Transfer Scheduled 24 | ReqSC ->> ReqGS : Request is scheduled 25 | ReqGS ->> ResGS : Send Response 26 | ResGS ->> ResSC : Response Progress (to end) 27 | ResSC ->> ResDT : Request Complete 28 | ResDT ->> Responder : Request Completed (if listening) 29 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/error_correction/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Error Correction 3 | weight: 5 4 | bookCollapseSection: true 5 | draft: true 6 | --- 7 | 8 | # Forward Error Correction and Erasure Codes 9 | 10 | In order to reduce likelihood of problems,`Clients` prepare their data by 11 | applying erasure or error correcting codes. This section describes how 12 | that will happen. 13 | 14 | {{< hint warning >}} 15 | TODO 16 | {{< /hint >}} 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/error_correction/erasure_coding/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | menuTitle: Erasure Coding 3 | title: Erasure Coding 4 | --- 5 | 6 | # Erasure Coding 7 | 8 | TODO 9 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/error_correction/erasure_coding/coding.id: -------------------------------------------------------------------------------- 1 | // type Encoding struct { 2 | // Encode(buf Bytes) Bytes 3 | // Decode(buf Bytes) Bytes 4 | // } 5 | // 6 | // // ErasureCoding is an Encoding that enables creating data that 7 | // // is highly tolerant to failures and erasures. 8 | // // 9 | // // ErasureCoding MAY make use of the internal structure of a piece, 10 | // // to encode individual leaf nodes together, or separately. It also 11 | // // must store the full serialized piece data, not just the leaf nodes. 12 | // type ErasureCoding struct { 13 | // Encode(p Piece) Piece 14 | // Decode(p Piece) Piece 15 | // } 16 | // 17 | // type ErasureCodingAlgorithm union { 18 | // ReedSolomon ErasureCoding 19 | // OnlineCodes ErasureCoding 20 | // // RaptorCodes ErasureCoding 21 | // // TornadoCodes ErasureCoding 22 | // } 23 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/error_correction/error_correcting_codes/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | menuTitle: Error Correcting Codes 3 | title: Error Correcting Codes 4 | --- 5 | 6 | # Error Correcting Codes 7 | 8 | TODO 9 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/error_correction/error_correcting_codes/coding.id: -------------------------------------------------------------------------------- 1 | // type Encoding struct { 2 | // Encode(buf Bytes) Bytes 3 | // Decode(buf Bytes) Bytes 4 | // } 5 | // 6 | // // ErasureCoding is an Encoding that enables creating data that 7 | // // is highly tolerant to failures and erasures. 8 | // // 9 | // // ErasureCoding MAY make use of the internal structure of a piece, 10 | // // to encode individual leaf nodes together, or separately. It also 11 | // // must store the full serialized piece data, not just the leaf nodes. 12 | // type ErasureCoding struct { 13 | // Encode(p Piece) Piece 14 | // Decode(p Piece) Piece 15 | // } 16 | // 17 | // type ErasureCodingAlgorithm union { 18 | // ReedSolomon ErasureCoding 19 | // OnlineCodes ErasureCoding 20 | // // RaptorCodes ErasureCoding 21 | // // TornadoCodes ErasureCoding 22 | // } 23 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/file/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: File 3 | weight: 1 4 | bookCollapseSection: true 5 | dashboardWeight: 1 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # File 12 | 13 | {{< embed src="file.id" lang="go" >}} 14 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/file/file.go: -------------------------------------------------------------------------------- 1 | package file 2 | 3 | import ( 4 | "io/ioutil" 5 | ) 6 | 7 | func ReadAll(f File) ([]byte, error) { 8 | f2 := FileReadWriter{f, 0} 9 | return ioutil.ReadAll(f2) 10 | } 11 | 12 | type FileReadWriter struct { 13 | f File 14 | offset int 15 | } 16 | 17 | func (f FileReadWriter) Read(buf []byte) (n int, err error) { 18 | ret := f.f.Read(f.offset, len(buf), buf) 19 | f.offset += ret.size() 20 | return ret.size(), ret.e() 21 | } 22 | 23 | func (f FileReadWriter) Write(buf []byte) (n int, err error) { 24 | ret := f.f.Write(f.offset, len(buf), buf) 25 | f.offset += ret.size() 26 | return ret.size(), ret.e() 27 | } 28 | 29 | func FromPath(path Path) *FileReadWriter { 30 | return &FileReadWriter{} // TODO: move to using Filestore 31 | } 32 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/file/file.id: -------------------------------------------------------------------------------- 1 | // Path is an opaque locator for a file (e.g. in a unix-style filesystem). 2 | type Path string 3 | 4 | // File is a variable length data container. 5 | // The File interface is modeled after a unix-style file, but abstracts the 6 | // underlying storage system. 7 | type File interface { 8 | Path() Path 9 | Size() int 10 | Close() error 11 | 12 | // Read reads from File into buf, starting at offset, and for size bytes. 13 | Read(offset int, size int, buf Bytes) struct {size int, e error} 14 | 15 | // Write writes from buf into File, starting at offset, and for size bytes. 16 | Write(offset int, size int, buf Bytes) struct {size int, e error} 17 | } 18 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/file/filestore.id: -------------------------------------------------------------------------------- 1 | // FileStore is an object that can store and retrieve files by path. 2 | type FileStore struct { 3 | Open(p Path) union {f File, e error} 4 | Create(p Path) union {f File, e error} 5 | Store(p Path, f File) error 6 | Delete(p Path) error 7 | 8 | // maybe add: 9 | // Copy(SrcPath, DstPath) 10 | } 11 | -------------------------------------------------------------------------------- /content/systems/filecoin_files/piece/pieces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_files/piece/pieces.png -------------------------------------------------------------------------------- /content/systems/filecoin_markets/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Market' 3 | description: 'Markets in Filecoin' 4 | bookCollapseSection: true 5 | weight: 7 6 | dashboardWeight: 2 7 | dashboardState: stable 8 | dashboardAudit: n/a 9 | dashboardTests: 0 10 | --- 11 | 12 | # Markets 13 | 14 | Filecoin is a consensus protocol, a data-storage platform, and a marketplace for storing and retrieving data. There are two major components to Filecoin markets, the storage market and the retrieval market. While storage and retrieval negotiations for both the storage and the retrieval markets are taking place primarily _off the blockchain_ (at least in the current version of Filecoin), storage deals made in the storage market will be published on-chain and will be enforced by the protocol. Storage deal negotiation and order matching are expected to happen off-chain in the first version of Filecoin. Retrieval deals are also negotiated off-chain and executed with micropayments between transacting parties in payment channels. 15 | 16 | Even though most of the market actions happen off the blockchain, there are on-chain invariants that create economic structure for network success and allow for positive emergent behavior. You can read more about the relationship between on-chain deals and storage power in [Storage Power Consensus](storage_power_consensus). 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/onchain_storage_market/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Storage Market On-Chain Components 3 | weight: 2 4 | bookCollapseSection: true 5 | dashboardWeight: 2 6 | dashboardState: reliable 7 | dashboardAudit: wip 8 | dashboardTests: 0 9 | --- 10 | 11 | # Storage Market On-Chain Components 12 | 13 | ## Storage Deals 14 | 15 | There are two types of deals in Filecoin markets, storage deals and retrieval deals. Storage deals are recorded on the blockchain and enforced by the protocol. Retrieval deals are off chain and enabled by a micropayment channel between transacting parties (see [Retrieval Market](retrieval_market) for more information). 16 | 17 | The lifecycle of a Storage Deal touches several major subsystems, components, and protocols in Filecoin. 18 | 19 | This section describes the storage deal data type and provides a technical outline of the deal flow in terms of how all the components interact with each other, as well as the functions they call. For more detail on the off-chain parts of the storage market see the [Storage Market section](storage_market). 20 | 21 | ## Data Types 22 | 23 | {{}} 24 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/onchain_storage_market/faults.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Faults' 3 | weight: 4 4 | dashboardWeight: 2 5 | dashboardState: reliable 6 | dashboardAudit: wip 7 | dashboardTests: 0 8 | --- 9 | 10 | # Faults 11 | 12 | There are two main categories of faults in the Filecoin network: 13 | 14 | 1. [Storage or Sector Faults](sector#sector-faults) that relate with the failure to store files agreed in a deal previously due to a hardware error or malicious behaviour, and 15 | 2. [Consensus Faults](expected_consensus#consensus-faults) that relate to a miner trying deviate from the protocol in order to gain more power than their storage deserves. 16 | 17 | Please refer to the corresponding sections for more details. 18 | 19 | Both Storage and Consensus Faults come with penalties that slash the miner's collateral. See more details on the different types of collaterals in the [Miner Collaterals](filecoin_mining#miner_collaterals). 20 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/deal_status.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Retrieval Deal Status' 3 | weight: 5 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Retrieval Deal Status 11 | 12 | {{}} 13 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_client.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Retrieval Client' 3 | weight: 3 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Retrieval Client 11 | 12 | ## Client Dependencies 13 | 14 | The Retrieval Client Depends On The Following Dependencies 15 | 16 | - **Host**: A libp2p host (set setup the libp2p protocols) 17 | - **Filecoin Node**: A node implementation to query the chain for pieces and to setup and manage payment channels 18 | - **BlockStore**: Same as one used by data transfer module 19 | - **Data Transfer**: Module used for transferring payload. Writes to the blockstore. 20 | 21 | {{}} 22 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_peer_resolver.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | 3 | type RetrievalPeerResolver struct { 4 | GetPeers(PieceCID abi.PieceCID) [RetrievalPeer] 5 | } 6 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_peer_resolver.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Retrieval Peer Resolver' 3 | weight: 1 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Retrieval Peer Resolver 11 | 12 | The `peer resolver` is a content routing interface to discover retrieval miners that have a given Piece. 13 | 14 | It can be backed by both a local store of previous storage deals or by querying the chain. 15 | 16 | ```go 17 | // PeerResolver is an interface for looking up providers that may have a piece 18 | type PeerResolver interface { 19 | GetPeers(payloadCID cid.Cid) ([]RetrievalPeer, error) // TODO: channel 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_protocols.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Retrieval Protocols' 3 | weight: 2 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Retrieval Protocols 11 | 12 | The `retrieval market` is implemented using the following `libp2p` service. 13 | 14 | {{}} 15 | **Name**: Query Protocol 16 | **Protocol ID**: `/fil//retrieval/qry/1.0.0` 17 | {{}} 18 | 19 | Request: CBOR Encoded RetrievalQuery Data Structure 20 | Response: CBOR Encoded RetrievalQueryResponse Data Structure 21 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_provider.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import peer "github.com/libp2p/go-libp2p-core/peer" 3 | 4 | type RetrievalProviderDealState struct { 5 | RetrievalDealProposal 6 | Status DealStatus 7 | Receiver peer.ID 8 | TotalSent UInt 9 | FundsReceived abi.TokenAmount 10 | } 11 | 12 | type RetrievalProviderEvent struct { 13 | Open 14 | Progress 15 | Error 16 | Complete 17 | } 18 | 19 | type RetrievalProviderDealID struct { 20 | From peer.ID 21 | ID RetrievalDealID 22 | } 23 | 24 | type RetrievalProviderSubscriber struct { 25 | OnEvent(event RetrievalProviderEvent, RetrievalProviderDealState) 26 | } 27 | 28 | type RetrievalProvider struct { 29 | // V0 30 | SetPricePerByte(price abi.TokenAmount) 31 | SetPaymentInterval(paymentInterval UInt, paymentIntervalIncrease UInt) 32 | SubscribeToEvents(subscriber RetrievalProviderSubscriber) 33 | 34 | // V1 35 | SetPricePerUnseal(price abi.TokenAmount) 36 | ListDeals() {RetrievalProviderDealID: RetrievalProviderDealState} 37 | } 38 | -------------------------------------------------------------------------------- /content/systems/filecoin_markets/retrieval_market/retrieval_provider.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Retrieval Provider (Miner)' 3 | weight: 4 4 | dashboardWeight: 2 5 | dashboardState: stable 6 | dashboardAudit: n/a 7 | dashboardTests: 0 8 | --- 9 | 10 | # Retrieval Provider (Miner) 11 | 12 | ## Provider Dependencies 13 | 14 | The Retrieval Provider depends on the following dependencies 15 | 16 | - **Host**: A libp2p host (set setup the libp2p protocols) 17 | - **Filecoin Node**: A node implementation to query the chain for pieces and to setup and manage payment channels 18 | - **StorageMining Subsystem**: For unsealing sectors 19 | - **BlockStore**: Same as one used by data transfer module 20 | - **Data Transfer**: Module used for transferring payload. Reads from the blockstore. 21 | 22 | {{}} 23 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/base_mining.id: -------------------------------------------------------------------------------- 1 | type SealedSector struct {} 2 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/sector/sector-quality/sector-quality.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_mining/sector/sector-quality/sector-quality.jpg -------------------------------------------------------------------------------- /content/systems/filecoin_mining/sector/sector-recovery.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sector Recovery 3 | weight: 6 4 | dashboardWeight: 2 5 | dashboardState: reliable 6 | dashboardAudit: wip 7 | dashboardTests: 0 8 | --- 9 | 10 | # Sector Recovery 11 | 12 | Miners should try to recover faulty sectors in order to avoid paying the penalty, which is approximately equal to the block reward that the miner would receive from that sector. After fixing technical issues, the miner should call `RecoveryDeclaration` and produce the WindowPoSt challenge in order to regain the power from that sector. 13 | 14 | Note that if a sector is in a faulty state for 42 consecutive days it will be terminated and the miner will receive a penalty. The miner can terminate the sector themselves by calling `TerminationDeclaration`, if they know that they cannot recover it, in which case they will receive a smaller penalty fee. 15 | 16 | Both the `RecoveryDeclaration` and the `TerminationDeclaration` can be found in the [miner actor implementation](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/miner/miner_actor.go). 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/sector/sectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_mining/sector/sectors.png -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine.dot: -------------------------------------------------------------------------------- 1 | digraph miner_post { 2 | Compound=true 3 | splines=ortho 4 | ranksep=0.2 5 | nodesep=2 6 | node [shape=circle width=1.2 fixedsize=true] 7 | edge [penwidth=2] 8 | 9 | OK [shape=doublecircle] // doublecircle because it is the init state 10 | Challenged 11 | 12 | subgraph cluster_0 { 13 | label="Lose power on all sectors" 14 | style=filled 15 | color=grey90 16 | DetectedFault 17 | } 18 | 19 | Challenged -> DetectedFault [color="red"] 20 | Challenged -> DetectedFault [style="invis"] 21 | DetectedFault -> OK [color="green"] 22 | 23 | OK -> Challenged [color="black"] 24 | Challenged -> OK [color="blue"] 25 | } 26 | 27 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/diagrams/miner_post_state_machine_legend.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | rankdir=LR 3 | node [shape=plaintext] 4 | subgraph cluster_01 { 5 | label = "Legend"; 6 | key [label=< 7 | 8 | 9 | 10 | 11 | 12 |
OnSurprisePoStChallenge: OK - Challenged
OnMinerSurprisePoStSuccess: Challenged - OK
OnMinerSurprisePoStSuccess: DetectedFault - OK
OnMinerSurprisePoStFailure: Challenged - DetectedFault
>] 13 | key2 [label=< 14 | 15 | 16 | 17 | 18 |
 
 
 
 
>] 19 | key:i0:e -> key2:i0:w [color=black] 20 | key:i1:e -> key2:i1:w [color=blue] 21 | key:i2:e -> key2:i2:w [color=green] 22 | key:i3:e -> key2:i3:w [color=red] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine.dot: -------------------------------------------------------------------------------- 1 | digraph sector_state { 2 | Compound=true 3 | splines=ortho 4 | ranksep=0.2 5 | nodesep=2 6 | node [shape=circle width=1.2 fixedsize=true] 7 | edge [penwidth=2] 8 | 9 | Cleared [shape=doublecircle] // doublecircle because it is the init state 10 | PreCommit 11 | 12 | subgraph cluster_0 { 13 | label="Proving Set (Counted for Power)" 14 | style=filled 15 | color=grey90 16 | Active 17 | } 18 | 19 | TempFault 20 | 21 | Cleared -> PreCommit [color="black"] 22 | PreCommit -> Active [color="green"] 23 | 24 | // fail to commit sector (expiry) 25 | PreCommit -> Cleared [color="gray"] 26 | 27 | // either declare Fault or miss PoSt 28 | Active -> TempFault [color="orange"] 29 | TempFault -> Active [color="cyan"] 30 | PreCommit -> Active [style="invis"] 31 | Active -> Cleared [color="blue:white:purple"] 32 | 33 | } 34 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/diagrams/sector_state_machine_legend.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | rankdir=LR 3 | node [shape=plaintext] 4 | subgraph cluster_01 { 5 | label = "Legend"; 6 | key [label=< 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
SectorPreCommit: Cleared - PreCommit
PreCommitExpiration: PreCommit - Cleared
SectorProveCommit: PreCommit - Active
TemporaryFaultEffectiveBegin: Active - TempFault
TemporaryFaultEffectiveEnd: TempFault - Active
SectorExpiration: Active - Cleared
UserTerminateion: Active - Cleared
>] 16 | key2 [label=< 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
 
 
 
 
 
 
 
>] 25 | key:i0:e -> key2:i0:w [color=black] 26 | key:i1:e -> key2:i1:w [color=gray] 27 | key:i2:e -> key2:i2:w [color=green] 28 | key:i3:e -> key2:i3:w [color=orange] 29 | key:i4:e -> key2:i4:w [color=cyan] 30 | key:i5:e -> key2:i5:w [color=blue] 31 | key:i6:e -> key2:i6:w [color=purple] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/mining_cycle/timing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_mining/storage_mining/mining_cycle/timing.png -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_mining/storage_miner_actor.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Storage Miner Actor 3 | weight: 5 4 | dashboardWeight: 2 5 | dashboardState: wip 6 | dashboardAudit: done 7 | dashboardAuditURL: /#section-appendix.audit_reports.actors 8 | dashboardAuditDate: '2020-10-19' 9 | dashboardTests: 0 10 | --- 11 | 12 | # Storage Miner Actor 13 | 14 | {{}} 15 | 16 | {{}} 17 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Storage Proving 3 | weight: 4 4 | bookCollapseSection: true 5 | dashboardWeight: 1 6 | dashboardState: wip 7 | dashboardAudit: wip 8 | dashboardTests: 0 9 | --- 10 | 11 | # Storage Proving 12 | 13 | ## Filecoin Proving Subsystem 14 | 15 | {{}} 16 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/poster/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sector Poster 3 | dashboardWeight: 1 4 | dashboardState: wip 5 | dashboardAudit: wip 6 | dashboardTests: 0 7 | --- 8 | 9 | # Sector Poster 10 | 11 | ## PoSt Generator object 12 | 13 | {{}} 14 | 15 | {{}} 16 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/poster/post_generator.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import sector_index "github.com/filecoin-project/specs/systems/filecoin_mining/sector_index" 3 | 4 | type UInt64 UInt 5 | 6 | // TODO: move this to somewhere the blockchain can import 7 | // candidates: 8 | // - filproofs - may have to learn about Sectors (and if we move Seal stuff, Deals) 9 | // - "blockchain/builtins" or something like that - a component in the blockchain that handles storage verification 10 | type PoStSubmission struct { 11 | PostProof abi.PoStProof 12 | ChainEpoch abi.ChainEpoch 13 | } 14 | 15 | type PoStGenerator struct { 16 | SectorStore sector_index.SectorStore 17 | 18 | GeneratePoStCandidates( 19 | challengeSeed abi.PoStRandomness 20 | candidateCount UInt 21 | sectors [abi.SectorID] 22 | ) [abi.PoStCandidate] 23 | 24 | CreateElectionPoStProof( 25 | randomness abi.PoStRandomness 26 | witness [abi.PoStCandidate] 27 | ) [abi.PoStProof] 28 | 29 | CreateSurprisePoStProof( 30 | randomness abi.PoStRandomness 31 | witness [abi.PoStCandidate] 32 | ) [abi.PoStProof] 33 | 34 | // FIXME: Verification shouldn't require a PoStGenerator. Move this. 35 | VerifyPoStProof( 36 | Proof abi.PoStProof 37 | challengeSeed abi.PoStRandomness 38 | ) bool 39 | } 40 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/sealer/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sector Sealer 3 | dashboardWeight: 1 4 | dashboardState: wip 5 | dashboardAudit: wip 6 | dashboardTests: 0 7 | --- 8 | 9 | # Sector Sealer 10 | 11 | {{}} 12 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/sealer/sealer.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import sector "github.com/filecoin-project/specs/systems/filecoin_mining/sector" 3 | import file "github.com/filecoin-project/specs/systems/filecoin_files/file" 4 | import addr "github.com/filecoin-project/go-address" 5 | 6 | type SealInputs struct { 7 | SectorSize abi.SectorSize 8 | RegisteredProof abi.RegisteredProof // FIXME: Ensure this is provided. 9 | SectorID abi.SectorID 10 | MinerID addr.Address 11 | RandomSeed abi.SealRandomness // This should be derived from SEAL_EPOCH = CURRENT_EPOCH - FINALITY. 12 | UnsealedPath file.Path 13 | SealedPath file.Path 14 | DealIDs [abi.DealID] 15 | } 16 | 17 | type CreateSealProofInputs struct { 18 | SectorID abi.SectorID 19 | RegisteredProof abi.RegisteredProof 20 | InteractiveRandomSeed abi.InteractiveSealRandomness 21 | SealedPaths [file.Path] 22 | SealOutputs 23 | } 24 | 25 | type SealOutputs struct { 26 | ProofAuxTmp sector.ProofAuxTmp 27 | } 28 | 29 | type CreateSealProofOutputs struct { 30 | SealInfo abi.SealVerifyInfo 31 | ProofAux sector.PersistentProofAux 32 | } 33 | 34 | type SectorSealer struct { 35 | SealSector() union {so SealOutputs, err error} 36 | CreateSealProof(si CreateSealProofInputs) union {so CreateSealProofOutputs, err error} 37 | 38 | MaxUnsealedBytesPerSector(SectorSize UInt) UInt 39 | } 40 | -------------------------------------------------------------------------------- /content/systems/filecoin_mining/storage_proving/storage_proving_subsystem.id: -------------------------------------------------------------------------------- 1 | import abi "github.com/filecoin-project/specs-actors/actors/abi" 2 | import poster "github.com/filecoin-project/specs/systems/filecoin_mining/storage_proving/poster" 3 | import sealer "github.com/filecoin-project/specs/systems/filecoin_mining/storage_proving/sealer" 4 | import block "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/block" 5 | 6 | type StorageProvingSubsystem struct { 7 | SectorSealer sealer.SectorSealer 8 | PoStGenerator poster.PoStGenerator 9 | 10 | VerifySeal(sv abi.SealVerifyInfo, pieceInfos [abi.PieceInfo]) union {ok bool, err error} 11 | ComputeUnsealedSectorCID(sectorSize UInt, pieceInfos [abi.PieceInfo]) union {unsealedSectorCID abi.UnsealedSectorCID, err error} 12 | 13 | ValidateBlock(block block.Block) 14 | 15 | // TODO: remove this? 16 | // GetPieceInclusionProof(pieceRef CID) union { PieceInclusionProofs, error } 17 | 18 | GenerateElectionPoStCandidates( 19 | challengeSeed abi.PoStRandomness 20 | sectorIDs [abi.SectorID] 21 | ) [abi.PoStCandidate] 22 | 23 | GenerateSurprisePoStCandidates( 24 | challengeSeed abi.PoStRandomness 25 | sectorIDs [abi.SectorID] 26 | ) [abi.PoStCandidate] 27 | 28 | CreateElectionPoStProof( 29 | challengeSeed abi.PoStRandomness 30 | candidates [abi.PoStCandidate] 31 | ) [abi.PoStProof] 32 | 33 | CreateSurprisePoStProof( 34 | challengeSeed abi.PoStRandomness 35 | candidates [abi.PoStCandidate] 36 | ) [abi.PoStProof] 37 | } 38 | -------------------------------------------------------------------------------- /content/systems/filecoin_nodes/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Filecoin Nodes 3 | bookCollapseSection: true 4 | weight: 1 5 | dashboardWeight: 1 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Filecoin Nodes 12 | 13 | This section starts by discussing the concept of Filecoin Nodes. Although different node types in the Lotus implementation of Filecoin are less strictly defined than in other blockchain networks, there are different properties and features that different types of nodes should implement. In short, nodes are defined based on the set of _services_ they provide. 14 | 15 | In this section we also discuss issues related to storage of system files in Filecoin nodes. Note that by storage in this section we do not refer to the storage that a node commits for mining in the network, but rather the local storage repositories that it needs to have available for keys and IPLD data among other things. 16 | 17 | In this section we are also discussing the network interface and how nodes find and connect with each other, how they interact and propagate messages using libp2p, as well as how to set the node's clock. 18 | -------------------------------------------------------------------------------- /content/systems/filecoin_nodes/repository/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Repository 3 | weight: 2 4 | bookCollapseSection: true 5 | dashboardWeight: 1 6 | dashboardState: stable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Node Repository 12 | 13 | The Filecoin node repository is simply local storage for system and chain data. It is an abstraction of the data which any functional Filecoin node needs to store locally in order to run correctly. 14 | 15 | The repository is accessible to the node's systems and subsystems and can be compartmentalized from the node's `FileStore`. 16 | 17 | The repository stores the node's keys, the IPLD data structures of stateful objects as well as the node configuration settings. 18 | 19 | The Lotus implementation of the FileStore Repository can be found [here](https://github.com/filecoin-project/lotus/blob/master/node/repo/fsrepo.go). 20 | -------------------------------------------------------------------------------- /content/systems/filecoin_token/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Token 3 | bookCollapseSection: true 4 | weight: 5 5 | dashboardWeight: 1 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # Token 12 | -------------------------------------------------------------------------------- /content/systems/filecoin_token/minting_model/final-stages-of-economy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_token/minting_model/final-stages-of-economy.jpg -------------------------------------------------------------------------------- /content/systems/filecoin_token/multisig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Multisig Wallet 3 | weight: 4 4 | bookCollapseSection: true 5 | dashboardWeight: 1 6 | dashboardState: reliable 7 | dashboardAudit: done 8 | dashboardAuditURL: /#section-appendix.audit_reports.actors 9 | dashboardAuditDate: '2020-10-19' 10 | dashboardTests: 0 11 | --- 12 | 13 | # Multisig Wallet & Actor 14 | 15 | The Multisig actor is a single actor representing a group of Signers. Signers may be external users, other Multisigs, or even the Multisig itself. There should be a maximum of 256 signers in a multisig wallet. In case more signers are needed, then the multisigs should be combined into a tree. 16 | 17 | The implementation of the Multisig Actor can be found [here](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/multisig/multisig_actor.go). 18 | 19 | The Multisig Actor statuses can be found [here](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/multisig/multisig_state.go). 20 | -------------------------------------------------------------------------------- /content/systems/filecoin_token/token_allocation/filtokenallocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/content/systems/filecoin_token/token_allocation/filtokenallocation.png -------------------------------------------------------------------------------- /content/systems/filecoin_vm/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Virtual Machine 3 | description: VM - Virtual Machine 4 | bookCollapseSection: true 5 | weight: 3 6 | dashboardWeight: 2 7 | dashboardState: reliable 8 | dashboardAudit: n/a 9 | dashboardTests: 0 10 | --- 11 | 12 | # Virtual Machine 13 | 14 | An Actor in the Filecoin Blockchain is the equivalent of the smart contract in the Ethereum Virtual Machine. 15 | 16 | The Filecoin Virtual Machine (VM) is the system component that is in charge of execution of all actors code. Execution of actors on the Filecoin VM (i.e., on-chain executions) incur a gas cost. 17 | 18 | Any operation applied (i.e., executed) on the Filecoin VM produces an output in the form of a _State Tree_ (discussed below). The latest _State Tree_ is the current source of truth in the Filecoin Blockchain. The _State Tree_ is identified by a CID, which is stored in the IPLD store. 19 | -------------------------------------------------------------------------------- /content/systems/filecoin_vm/runtime/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Runtime 3 | weight: 5 4 | bookCollapseSection: true 5 | dashboardWeight: 1 6 | dashboardState: reliable 7 | dashboardAudit: n/a 8 | dashboardTests: 0 9 | --- 10 | 11 | # VM Runtime Environment (Inside the VM) 12 | 13 | ## Receipts 14 | 15 | A `MessageReceipt` contains the result of a top-level message execution. Every syntactically valid and correctly signed message can be included in a block and will produce a receipt from execution. 16 | 17 | A syntactically valid receipt has: 18 | 19 | - a non-negative `ExitCode`, 20 | - a non empty `Return` value only if the exit code is zero, and 21 | - a non-negative `GasUsed`. 22 | 23 | ```go 24 | type MessageReceipt struct { 25 | ExitCode exitcode.ExitCode 26 | Return []byte 27 | GasUsed int64 28 | } 29 | ``` 30 | 31 | ## `vm/runtime` Actors Interface 32 | 33 | The Actors Interface implementation can be found [here](https://github.com/filecoin-project/specs-actors/blob/master/actors/runtime/runtime.go) 34 | 35 | ## `vm/runtime` VM Implementation 36 | 37 | The Lotus implementation of the Filecoin Virtual Machine runtime can be found [here](https://github.com/filecoin-project/lotus/blob/master/chain/vm/runtime.go) 38 | 39 | ## Exit Codes 40 | 41 | There are some common runtime exit codes that are shared by different actors. Their definition can be found [here](https://github.com/filecoin-project/go-state-types/blob/master/exitcode/common.go). 42 | -------------------------------------------------------------------------------- /content/systems/filecoin_vm/state_tree/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: State Tree 3 | weight: 2 4 | dashboardWeight: 1.5 5 | dashboardState: reliable 6 | dashboardAudit: wip 7 | dashboardTests: 0 8 | --- 9 | 10 | # State Tree 11 | 12 | The State Tree is the output of the execution of any operation applied on the Filecoin Blockchain. The on-chain (i.e., VM) state data structure is a map (in the form of a Hash Array Mapped Trie - HAMT) that binds addresses to actor states. The current State Tree function is called by the VM upon every actor method invocation. 13 | 14 | {{}} 15 | -------------------------------------------------------------------------------- /content/test-embed.js: -------------------------------------------------------------------------------- 1 | function name() { 2 | return 1 3 | } 4 | -------------------------------------------------------------------------------- /data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/data/.gitkeep -------------------------------------------------------------------------------- /layouts/partials/body.html: -------------------------------------------------------------------------------- 1 | {{ $opts := dict "targetPath" "main.js" "minify" "true" }} 2 | {{ $js := resources.Get "js/main.js" | js.Build $opts}} 3 | 4 | 5 | {{ if ne .Site.IsServer true }} 6 | 7 | {{end}} 8 | -------------------------------------------------------------------------------- /layouts/partials/docs/search.html: -------------------------------------------------------------------------------- 1 | {{ if default true .Site.Params.BookSearch }} 2 | 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /layouts/partials/docs/toc.html: -------------------------------------------------------------------------------- 1 |
2 |

CONTENTS

3 | {{ .TableOfContents }} 4 |
5 | -------------------------------------------------------------------------------- /layouts/partials/single/brand.html: -------------------------------------------------------------------------------- 1 |

2 | 3 | {{- with .Site.Params.BookLogo -}} 4 | Logo 5 | {{- end -}} 6 | {{ .Site.Title }} 7 | 8 |

9 | -------------------------------------------------------------------------------- /layouts/partials/single/header.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 | 7 | 8 | 9 |
10 | {{ if default true (default .Site.Params.BookToC .Params.BookToC) }} 11 | 15 | {{ end }} 16 |
17 |
-------------------------------------------------------------------------------- /layouts/partials/single/menu-single.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

TABLE OF CONTENTS

4 | 5 |
6 | {{ partial "toc" . }} 7 |
8 | -------------------------------------------------------------------------------- /layouts/partials/single/menu.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/state-badge.html: -------------------------------------------------------------------------------- 1 | {{ if .dashboardState }} 2 | 7 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/toc.html: -------------------------------------------------------------------------------- 1 | {{ define "toc-list" }} 2 | {{ $depth := .depth }} 3 |
    4 | {{ range .children }} 5 |
  1. 6 | {{.number}} {{.text}} 7 | {{ if gt (len .children) 0 }} 8 | {{ template "toc-list" (dict "children" .children "depth" (add 1 $depth) ) }} 9 | {{ end }} 10 |
  2. 11 | {{ end }} 12 |
13 | {{ end }} 14 | 15 | {{ if isset .Site.Data "toc" }} 16 | {{ template "toc-list" (dict "children" .Site.Data.toc "depth" 0 )}} 17 | {{ end }} 18 | -------------------------------------------------------------------------------- /layouts/shortcodes/changelog.html: -------------------------------------------------------------------------------- 1 | {{ $url := printf "%s/releases" $.Site.Params.API }} 2 | {{- range $cls := getJSON $url -}} 3 | {{- printf "## %s" $cls.name | $.Page.RenderString -}} 4 | @hugomrdias {{ $cls.author.login }} released this in {{ $cls.published_at }} · Go to this release 5 | 6 | 7 | 8 |
9 | 19 |
20 | 21 | {{- end -}} 22 | -------------------------------------------------------------------------------- /layouts/shortcodes/katex.html: -------------------------------------------------------------------------------- 1 | 2 | {{- trim .Inner "\n" -}} 3 | 4 | -------------------------------------------------------------------------------- /layouts/shortcodes/plain.html: -------------------------------------------------------------------------------- 1 | {{- if eq (.Get 0) "hidden" -}} 2 | 3 | {{- trim .Inner "\n" -}} 4 | 5 | {{- else -}} 6 | {{- trim .Inner "\n" -}} 7 | {{- end -}} 8 | -------------------------------------------------------------------------------- /static/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/android-chrome-192x192.png -------------------------------------------------------------------------------- /static/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/android-chrome-512x512.png -------------------------------------------------------------------------------- /static/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/apple-touch-icon.png -------------------------------------------------------------------------------- /static/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #2b5797 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/favicon-16x16.png -------------------------------------------------------------------------------- /static/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/favicon-32x32.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/favicon.ico -------------------------------------------------------------------------------- /static/filecoin-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /static/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/mstile-144x144.png -------------------------------------------------------------------------------- /static/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/mstile-150x150.png -------------------------------------------------------------------------------- /static/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/mstile-310x150.png -------------------------------------------------------------------------------- /static/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/mstile-310x310.png -------------------------------------------------------------------------------- /static/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/static/mstile-70x70.png -------------------------------------------------------------------------------- /themes/book/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build with Hugo 2 | 3 | on: [push] 4 | 5 | jobs: 6 | hugo-latest: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@master 10 | 11 | - name: Install Hugo 12 | run: | 13 | LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` 14 | VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-` 15 | wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb 16 | sudo dpkg -i /tmp/hugo.deb 17 | 18 | - name: Run Hugo 19 | working-directory: exampleSite 20 | run: hugo --themesDir ../.. 21 | hugo-minimum: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@master 25 | 26 | - name: Install Hugo 27 | run: | 28 | wget "https://github.com/gohugoio/hugo/releases/download/v0.68.0/hugo_extended_0.68.0_Linux-64bit.deb" -O /tmp/hugo.deb 29 | sudo dpkg -i /tmp/hugo.deb 30 | 31 | - name: Run Hugo 32 | working-directory: exampleSite 33 | run: hugo --themesDir ../.. 34 | -------------------------------------------------------------------------------- /themes/book/.gitignore: -------------------------------------------------------------------------------- 1 | public/ 2 | exampleSite/public/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /themes/book/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Alex Shpak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /themes/book/archetypes/docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ .Name | humanize | title }}" 3 | weight: 1 4 | # bookFlatSection: false 5 | # bookToc: true 6 | # bookHidden: false 7 | # bookCollapseSection: false 8 | # bookComments: true 9 | --- 10 | -------------------------------------------------------------------------------- /themes/book/archetypes/posts.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | --- 5 | -------------------------------------------------------------------------------- /themes/book/assets/_custom.scss: -------------------------------------------------------------------------------- 1 | /* You can add custom styles here. */ 2 | 3 | // @import "plugins/numbered"; 4 | -------------------------------------------------------------------------------- /themes/book/assets/_print.scss: -------------------------------------------------------------------------------- 1 | @media print { 2 | .book-menu, 3 | .book-footer, 4 | .book-toc { 5 | display: none; 6 | } 7 | 8 | .book-header, 9 | .book-header aside { 10 | display: block; 11 | } 12 | 13 | main { 14 | // Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=939897 15 | display: block !important; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /themes/book/assets/_utils.scss: -------------------------------------------------------------------------------- 1 | .flex { 2 | display: flex; 3 | } 4 | 5 | .flex-auto { 6 | flex: 1 1 auto; 7 | } 8 | 9 | .flex-even { 10 | flex: 1 1; 11 | } 12 | 13 | .flex-wrap { 14 | flex-wrap: wrap; 15 | } 16 | 17 | .justify-start { 18 | justify-content: flex-start; 19 | } 20 | 21 | .justify-end { 22 | justify-content: flex-end; 23 | } 24 | 25 | .justify-center { 26 | justify-content: center; 27 | } 28 | 29 | .justify-between { 30 | justify-content: space-between; 31 | } 32 | 33 | .align-center { 34 | align-items: center; 35 | } 36 | 37 | .mx-auto { 38 | margin: 0 auto; 39 | } 40 | 41 | .text-center { 42 | text-align: center; 43 | } 44 | 45 | .text-left { 46 | text-align: left; 47 | } 48 | 49 | .text-right { 50 | text-align: right; 51 | } 52 | 53 | .hidden { 54 | display: none; 55 | } 56 | 57 | input.toggle { 58 | height: 0; 59 | width: 0; 60 | overflow: hidden; 61 | opacity: 0; 62 | position: absolute; 63 | } 64 | 65 | .clearfix::after { 66 | content: ""; 67 | display: table; 68 | clear: both; 69 | } 70 | 71 | @mixin spin($duration) { 72 | animation: spin $duration ease infinite; 73 | @keyframes spin { 74 | 100% { 75 | transform: rotate(360deg); 76 | } 77 | } 78 | } 79 | 80 | @mixin fixed { 81 | position: fixed; 82 | top: 0; 83 | bottom: 0; 84 | overflow-x: hidden; 85 | overflow-y: auto; 86 | } 87 | 88 | @mixin outline { 89 | outline-style: auto; 90 | outline-color: currentColor; 91 | outline-color: -webkit-focus-ring-color; 92 | } 93 | -------------------------------------------------------------------------------- /themes/book/assets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* You can override SASS variables here. */ 2 | 3 | // @import "plugins/dark"; 4 | -------------------------------------------------------------------------------- /themes/book/assets/book.scss: -------------------------------------------------------------------------------- 1 | @import "defaults"; 2 | @import "variables"; 3 | @import "themes/{{ default "light" .Site.Params.BookTheme }}"; 4 | 5 | @import "normalize"; 6 | @import "utils"; 7 | @import "main"; 8 | @import "fonts"; 9 | @import "print"; 10 | 11 | @import "markdown"; 12 | @import "shortcodes"; 13 | 14 | // Custom defined styles 15 | @import "custom"; 16 | -------------------------------------------------------------------------------- /themes/book/assets/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ .Site.Title }}", 3 | "short_name": "{{ .Site.Title }}", 4 | "start_url": "{{ "/" | relURL }}", 5 | "scope": "{{ "/" | relURL }}", 6 | "display": "standalone", 7 | "background_color": "#000000", 8 | "theme_color": "#000000", 9 | "icons": [ 10 | { 11 | "src": "{{ "/favicon.svg" | relURL }}", 12 | "sizes": "512x512" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /themes/book/assets/menu-reset.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var menu = document.querySelector("aside.book-menu nav"); 3 | addEventListener("beforeunload", function(event) { 4 | localStorage.setItem("menu.scrollTop", menu.scrollTop); 5 | }); 6 | menu.scrollTop = localStorage.getItem("menu.scrollTop"); 7 | })(); 8 | -------------------------------------------------------------------------------- /themes/book/assets/mermaid.json: -------------------------------------------------------------------------------- 1 | { 2 | "flowchart": { 3 | "useMaxWidth":true 4 | }, 5 | "theme": "default" 6 | } 7 | -------------------------------------------------------------------------------- /themes/book/assets/plugins/_numbered.scss: -------------------------------------------------------------------------------- 1 | $startLevel: 1; 2 | $endLevel: 6; 3 | 4 | .book-page .markdown { 5 | @for $currentLevel from $startLevel through $endLevel { 6 | > h#{$currentLevel} { 7 | counter-increment: h#{$currentLevel}; 8 | counter-reset: h#{$currentLevel + 1}; 9 | 10 | $content: ""; 11 | @for $n from $startLevel through $currentLevel { 12 | $content: $content + 'counter(h#{$n})"."'; 13 | } 14 | 15 | &::before { 16 | content: unquote($content) " "; 17 | } 18 | } 19 | } 20 | } 21 | 22 | .book-toc nav ul { 23 | li { 24 | counter-increment: item; 25 | 26 | &:first-child { 27 | counter-reset: item; 28 | } 29 | 30 | &:before { 31 | content: counters(item, ".") ". "; 32 | float: left; 33 | margin-inline-end: $padding-4; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /themes/book/assets/plugins/_scrollbars.scss: -------------------------------------------------------------------------------- 1 | @import "defaults"; 2 | @import "variables"; 3 | 4 | // Webkit 5 | ::-webkit-scrollbar { 6 | width: $padding-8; 7 | } 8 | 9 | ::-webkit-scrollbar-thumb { 10 | background: transparent; 11 | border-radius: $padding-8; 12 | } 13 | 14 | :hover::-webkit-scrollbar-thumb { 15 | background: var(--gray-500); 16 | } 17 | 18 | // MS 19 | body { 20 | -ms-overflow-style: -ms-autohiding-scrollbar; 21 | } 22 | 23 | // Future 24 | .book-menu nav { 25 | scrollbar-color: transparent var(--gray-500); 26 | } 27 | -------------------------------------------------------------------------------- /themes/book/assets/search-data.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | (function () { 4 | const indexCfg = {{ with i18n "bookSearchConfig" }} 5 | {{ . }}; 6 | {{ else }} 7 | {}; 8 | {{ end }} 9 | 10 | indexCfg.doc = { 11 | id: 'id', 12 | field: ['title', 'content'], 13 | store: ['title', 'href', 'section'], 14 | }; 15 | 16 | const index = FlexSearch.create('balance', indexCfg); 17 | window.bookSearchIndex = index; 18 | 19 | {{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}} 20 | {{- $pages = where $pages "Params.booksearchexclude" "!=" true -}} 21 | {{- $pages = where $pages "Content" "not in" (slice nil "") -}} 22 | 23 | {{ range $index, $page := $pages }} 24 | index.add({ 25 | 'id': {{ $index }}, 26 | 'href': '{{ $page.RelPermalink }}', 27 | 'title': {{ (partial "docs/title" $page) | jsonify }}, 28 | 'section': {{ (partial "docs/title" $page.Parent) | jsonify }}, 29 | 'content': {{ $page.Plain | jsonify }} 30 | }); 31 | {{- end -}} 32 | })(); 33 | -------------------------------------------------------------------------------- /themes/book/assets/sw-register.js: -------------------------------------------------------------------------------- 1 | {{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}} 2 | if (navigator.serviceWorker) { 3 | navigator.serviceWorker.register( 4 | "{{ $swJS.RelPermalink }}", 5 | { scope: "{{ "/" | relURL }}" } 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /themes/book/assets/sw.js: -------------------------------------------------------------------------------- 1 | const cacheName = self.location.pathname 2 | const pages = [ 3 | {{ if eq .Site.Params.BookServiceWorker "precache" }} 4 | {{ range .Site.AllPages -}} 5 | "{{ .RelPermalink }}", 6 | {{ end -}} 7 | {{ end }} 8 | ]; 9 | 10 | self.addEventListener("install", function (event) { 11 | self.skipWaiting(); 12 | 13 | caches.open(cacheName).then((cache) => { 14 | return cache.addAll(pages); 15 | }); 16 | }); 17 | 18 | self.addEventListener("fetch", (event) => { 19 | const request = event.request; 20 | if (request.method !== "GET") { 21 | return; 22 | } 23 | 24 | /** 25 | * @param {Response} response 26 | * @returns {Promise} 27 | */ 28 | function saveToCache(response) { 29 | if (cacheable(response)) { 30 | return caches 31 | .open(cacheName) 32 | .then((cache) => cache.put(request, response.clone())) 33 | .then(() => response); 34 | } else { 35 | return response; 36 | } 37 | } 38 | 39 | /** 40 | * @param {Error} error 41 | */ 42 | function serveFromCache(error) { 43 | return caches.open(cacheName).then((cache) => cache.match(request.url)); 44 | } 45 | 46 | /** 47 | * @param {Response} response 48 | * @returns {Boolean} 49 | */ 50 | function cacheable(response) { 51 | return response.type === "basic" && response.ok && !response.headers.has("Content-Disposition") 52 | } 53 | 54 | event.respondWith(fetch(request).then(saveToCache).catch(serveFromCache)); 55 | }); 56 | -------------------------------------------------------------------------------- /themes/book/assets/themes/_auto.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | @include theme-light; 3 | } 4 | 5 | @media (prefers-color-scheme: dark) { 6 | :root { 7 | @include theme-dark; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /themes/book/assets/themes/_dark.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | @include theme-dark; 3 | } 4 | -------------------------------------------------------------------------------- /themes/book/assets/themes/_light.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | @include theme-light; 3 | } 4 | -------------------------------------------------------------------------------- /themes/book/exampleSite/assets/_custom.scss: -------------------------------------------------------------------------------- 1 | /* You can add custom styles here. */ 2 | 3 | // @import "plugins/numbered"; 4 | // @import "plugins/scrollbars"; 5 | -------------------------------------------------------------------------------- /themes/book/exampleSite/assets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* You can override SASS variables here. */ 2 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | type: docs 4 | --- 5 | 6 | # Acerbo datus maxime 7 | 8 | {{< columns >}} 9 | ## Astris ipse furtiva 10 | 11 | Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut 12 | olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis, 13 | modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies 14 | 15 | <---> 16 | 17 | ## Suis quot vota 18 | 19 | Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat: 20 | miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod 21 | nunc! Fragosis suae dextra geruntur functus vulgata. 22 | {{< /columns >}} 23 | 24 | 25 | ## Tempora nisi nunc 26 | 27 | Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei, 28 | tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis 29 | sequens! 30 | 31 | var panel = ram_design; 32 | if (backup + system) { 33 | file.readPoint = network_native; 34 | sidebar_engine_device(cell_tftp_raster, 35 | dual_login_paper.adf_vci.application_reader_design( 36 | graphicsNvramCdma, lpi_footer_snmp, integer_model)); 37 | } 38 | 39 | ## Locis suis novi cum suoque decidit eadem 40 | 41 | Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab? 42 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/example/collapsed/3rd-level/4th-level.md: -------------------------------------------------------------------------------- 1 | # 4th Level of Menu 2 | 3 | ## Caesorum illa tu sentit micat vestes papyriferi 4 | 5 | Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non 6 | regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo; 7 | gestanda nitidi, vero? Dum ne pectoraque testantur. 8 | 9 | Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut 10 | manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus 11 | pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae 12 | iusto! Sedes ante dum superest **extrema**. 13 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/example/collapsed/3rd-level/_index.md: -------------------------------------------------------------------------------- 1 | # 3rd Level of Menu 2 | 3 | Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae 4 | miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me 5 | ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta. 6 | Intravit quam erat figentem hunc, motus de fontes parvo tempestate. 7 | 8 | iscsi_virus = pitch(json_in_on(eupViral), 9 | northbridge_services_troubleshooting, personal( 10 | firmware_rw.trash_rw_crm.device(interactive_gopher_personal, 11 | software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel, 12 | mips_whitelist_duplex, cpa))); 13 | if (5) { 14 | managementNetwork += dma - boolean; 15 | kilohertz_token = 2; 16 | honeypot_affiliate_ergonomics = fiber; 17 | } 18 | mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet( 19 | analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet), 20 | gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork, 21 | trim_duplex_file), cellTapeDirect, token_tooltip_mashup( 22 | ripcordingMashup))); 23 | module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) + 24 | coreLog.joystick(componentUdpLink), windows_expansion_touchscreen); 25 | bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling( 26 | ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp); 27 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/example/collapsed/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookCollapseSection: true 3 | weight: 20 4 | --- 5 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookFlatSection: true 3 | --- 4 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/buttons.md: -------------------------------------------------------------------------------- 1 | # Buttons 2 | 3 | Buttons are styled links that can lead to local page or external link. 4 | 5 | ## Example 6 | 7 | ```tpl 8 | {{}}Get Home{{}} 9 | {{}}Contribute{{}} 10 | ``` 11 | 12 | {{< button relref="/" >}}Get Home{{< /button >}} 13 | {{< button href="https://github.com/alex-shpak/hugo-book" >}}Contribute{{< /button >}} 14 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/columns.md: -------------------------------------------------------------------------------- 1 | # Columns 2 | 3 | Columns help organize shorter pieces of content horizontally for readability. 4 | 5 | 6 | ```html 7 | {{}} 8 | # Left Content 9 | Lorem markdownum insigne... 10 | 11 | <---> 12 | 13 | # Mid Content 14 | Lorem markdownum insigne... 15 | 16 | <---> 17 | 18 | # Right Content 19 | Lorem markdownum insigne... 20 | {{}} 21 | ``` 22 | 23 | ## Example 24 | 25 | {{< columns >}} 26 | ## Left Content 27 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 28 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 29 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 30 | Miseratus fonte Ditis conubia. 31 | 32 | <---> 33 | 34 | ## Mid Content 35 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 36 | stringit, frustra Saturnius uteroque inter! 37 | 38 | <---> 39 | 40 | ## Right Content 41 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 42 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 43 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 44 | Miseratus fonte Ditis conubia. 45 | {{< /columns >}} 46 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/details.md: -------------------------------------------------------------------------------- 1 | # Details 2 | 3 | Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode. 4 | 5 | ## Example 6 | ```tpl 7 | {{}} 8 | ## Markdown content 9 | Lorem markdownum insigne... 10 | {{}} 11 | ``` 12 | ```tpl 13 | {{}} 14 | ## Markdown content 15 | Lorem markdownum insigne... 16 | {{}} 17 | ``` 18 | 19 | {{< details "Title" open >}} 20 | ## Markdown content 21 | Lorem markdownum insigne... 22 | {{< /details >}} 23 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/expand.md: -------------------------------------------------------------------------------- 1 | # Expand 2 | 3 | Expand shortcode can help to decrease clutter on screen by hiding part of text. Expand content by clicking on it. 4 | 5 | ## Example 6 | ### Default 7 | 8 | ```tpl 9 | {{}} 10 | ## Markdown content 11 | Lorem markdownum insigne... 12 | {{}} 13 | ``` 14 | 15 | {{< expand >}} 16 | ## Markdown content 17 | Lorem markdownum insigne... 18 | {{< /expand >}} 19 | 20 | ### With Custom Label 21 | 22 | ```tpl 23 | {{}} 24 | ## Markdown content 25 | Lorem markdownum insigne... 26 | {{}} 27 | ``` 28 | 29 | {{< expand "Custom Label" "..." >}} 30 | ## Markdown content 31 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 32 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 33 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 34 | Miseratus fonte Ditis conubia. 35 | {{< /expand >}} 36 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | Hint shortcode can be used as hint/alerts/notification block. 4 | There are 3 colors to choose: `info`, `warning` and `danger`. 5 | 6 | ```tpl 7 | {{}} 8 | **Markdown content** 9 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 10 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 11 | {{}} 12 | ``` 13 | 14 | ## Example 15 | 16 | {{< hint info >}} 17 | **Markdown content** 18 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 19 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 20 | {{< /hint >}} 21 | 22 | {{< hint warning >}} 23 | **Markdown content** 24 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 25 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 26 | {{< /hint >}} 27 | 28 | {{< hint danger >}} 29 | **Markdown content** 30 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 31 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 32 | {{< /hint >}} 33 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/katex.md: -------------------------------------------------------------------------------- 1 | # KaTeX 2 | 3 | KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/) 4 | 5 | ## Example 6 | {{< columns >}} 7 | 8 | ```latex 9 | {{}} 10 | f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi 11 | {{}} 12 | ``` 13 | 14 | <---> 15 | 16 | {{< katex display >}} 17 | f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi 18 | {{< /katex >}} 19 | 20 | {{< /columns >}} 21 | 22 | ## Display Mode Example 23 | 24 | Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block` 25 | {{< katex display >}} 26 | f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi 27 | {{< /katex >}} 28 | Text continues here. 29 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/mermaid.md: -------------------------------------------------------------------------------- 1 | # Mermaid Chart 2 | 3 | [Mermaid](https://mermaidjs.github.io/) is library for generating svg charts and diagrams from text. 4 | 5 | ## Example 6 | 7 | {{< columns >}} 8 | ```tpl 9 | {{}} 10 | sequenceDiagram 11 | Alice->>Bob: Hello Bob, how are you? 12 | alt is sick 13 | Bob->>Alice: Not so good :( 14 | else is well 15 | Bob->>Alice: Feeling fresh like a daisy 16 | end 17 | opt Extra response 18 | Bob->>Alice: Thanks for asking 19 | end 20 | {{}} 21 | ``` 22 | 23 | <---> 24 | 25 | {{< mermaid >}} 26 | sequenceDiagram 27 | Alice->>Bob: Hello Bob, how are you? 28 | alt is sick 29 | Bob->>Alice: Not so good :( 30 | else is well 31 | Bob->>Alice: Feeling fresh like a daisy 32 | end 33 | opt Extra response 34 | Bob->>Alice: Thanks for asking 35 | end 36 | {{< /mermaid >}} 37 | 38 | {{< /columns >}} 39 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/section/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookCollapseSection: true 3 | --- 4 | 5 | # Section 6 | 7 | Section renders pages in section as definition list, using title and description. 8 | 9 | ## Example 10 | 11 | ```tpl 12 | {{}} 13 | ``` 14 | 15 | {{
}} 16 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/section/page1.md: -------------------------------------------------------------------------------- 1 | # Page 1 2 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/section/page2.md: -------------------------------------------------------------------------------- 1 | # Page 2 2 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/docs/shortcodes/tabs.md: -------------------------------------------------------------------------------- 1 | # Tabs 2 | 3 | Tabs let you organize content by context, for example installation instructions for each supported platform. 4 | 5 | ```tpl 6 | {{}} 7 | {{}} # MacOS Content {{}} 8 | {{}} # Linux Content {{}} 9 | {{}} # Windows Content {{}} 10 | {{}} 11 | ``` 12 | 13 | ## Example 14 | 15 | {{< tabs "uniqueid" >}} 16 | {{< tab "MacOS" >}} 17 | # MacOS 18 | 19 | This is tab **MacOS** content. 20 | 21 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 22 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 23 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 24 | Miseratus fonte Ditis conubia. 25 | {{< /tab >}} 26 | 27 | {{< tab "Linux" >}} 28 | 29 | # Linux 30 | 31 | This is tab **Linux** content. 32 | 33 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 34 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 35 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 36 | Miseratus fonte Ditis conubia. 37 | {{< /tab >}} 38 | 39 | {{< tab "Windows" >}} 40 | 41 | # Windows 42 | 43 | This is tab **Windows** content. 44 | 45 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 46 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 47 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. 48 | Miseratus fonte Ditis conubia. 49 | {{< /tab >}} 50 | {{< /tabs >}} 51 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/menu/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | headless: true 3 | --- 4 | 5 | - [**Example Site**]({{< relref "/docs/example" >}}) 6 | - [Table of Contents]({{< relref "/docs/example/table-of-contents" >}}) 7 | - [With ToC]({{< relref "/docs/example/table-of-contents/with-toc" >}}) 8 | - [Without ToC]({{< relref "/docs/example/table-of-contents/without-toc" >}}) 9 | - [Collapsed]({{< relref "/docs/example/collapsed" >}}) 10 | - [3rd]({{< relref "/docs/example/collapsed/3rd-level" >}}) 11 | - [4th]({{< relref "/docs/example/collapsed/3rd-level/4th-level" >}}) 12 |
13 | 14 | - **Shortcodes** 15 | - [Buttons]({{< relref "/docs/shortcodes/buttons" >}}) 16 | - [Columns]({{< relref "/docs/shortcodes/columns" >}}) 17 | - [Expand]({{< relref "/docs/shortcodes/expand" >}}) 18 | - [Hints]({{< relref "/docs/shortcodes/hints" >}}) 19 | - [Katex]({{< relref "/docs/shortcodes/katex" >}}) 20 | - [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}}) 21 | - [Tabs]({{< relref "/docs/shortcodes/tabs" >}}) 22 |
23 | -------------------------------------------------------------------------------- /themes/book/exampleSite/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | menu: 3 | after: 4 | name: blog 5 | weight: 5 6 | title: Blog 7 | --- 8 | -------------------------------------------------------------------------------- /themes/book/i18n/cn.yaml: -------------------------------------------------------------------------------- 1 | # This should be removed in future, 'cn' is moved to `zh' 2 | - id: Search 3 | translation: 搜索 4 | 5 | - id: Edit this page 6 | translation: 编辑本页 7 | 8 | - id: Last modified by 9 | translation: 最后修改者 10 | 11 | - id: Expand 12 | translation: 展开 13 | 14 | - id: bookSearchConfig 15 | translation: | 16 | { 17 | encode: false, 18 | tokenize: function(str) { 19 | return str.replace(/[\x00-\x7F]/g, '').split(''); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /themes/book/i18n/cs.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Vyhledávat 3 | 4 | - id: Edit this page 5 | translation: Upravit tuto stránku 6 | 7 | - id: Last modified by 8 | translation: Autor poslední změny 9 | 10 | - id: Expand 11 | translation: Rozbalit 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/de.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Suche 3 | 4 | - id: Edit this page 5 | translation: Seite bearbeiten 6 | 7 | - id: Last modified by 8 | translation: Zuletzt geändert von 9 | 10 | - id: Expand 11 | translation: Erweitern 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/en.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Search 3 | 4 | - id: Edit this page 5 | translation: Edit this page 6 | 7 | - id: Last modified by 8 | translation: Last modified by 9 | 10 | - id: Expand 11 | translation: Expand 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/es.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Buscar 3 | 4 | - id: Edit this page 5 | translation: Editar esta página 6 | 7 | - id: Last modified by 8 | translation: Última modificación por 9 | 10 | - id: Expand 11 | translation: Expand 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/fr.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Rechercher 3 | 4 | - id: Edit this page 5 | translation: Modifier cette page 6 | 7 | - id: Last modified by 8 | translation: Dernière modification par 9 | 10 | - id: Expand 11 | translation: Développer 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/ja.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: 検索 3 | 4 | - id: Edit this page 5 | translation: このページを編集する 6 | 7 | - id: Last modified by 8 | translation: 最終更新者 9 | 10 | - id: Expand 11 | translation: 展開 12 | 13 | - id: bookSearchConfig 14 | translation: | 15 | { 16 | encode: false, 17 | tokenize: function(str) { 18 | return str.replace(/[\x00-\x7F]/g, '').split(''); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /themes/book/i18n/jp.yaml: -------------------------------------------------------------------------------- 1 | # This should be removed in future, 'jp' is moved to `ja' 2 | - id: Search 3 | translation: 検索 4 | 5 | - id: Edit this page 6 | translation: このページを編集する 7 | 8 | - id: Last modified by 9 | translation: 最終更新者 10 | 11 | - id: Expand 12 | translation: 展開 13 | 14 | - id: bookSearchConfig 15 | translation: | 16 | { 17 | encode: false, 18 | tokenize: function(str) { 19 | return str.replace(/[\x00-\x7F]/g, '').split(''); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /themes/book/i18n/ko.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Search 3 | 4 | - id: Edit this page 5 | translation: Edit this page 6 | 7 | - id: Last modified by 8 | translation: Last modified by 9 | 10 | - id: Expand 11 | translation: Expand 12 | 13 | - id: bookSearchConfig 14 | translation: | 15 | { 16 | encode: false, 17 | tokenize: function(str) { 18 | return str.replace(/[\x00-\x7F]/g, '').split(''); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /themes/book/i18n/nb.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Søk 3 | 4 | - id: Edit this page 5 | translation: Rediger denne siden 6 | 7 | - id: Last modified by 8 | translation: Sist endret av 9 | 10 | - id: Expand 11 | translation: Utvid 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/pt.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Buscar 3 | 4 | - id: Edit this page 5 | translation: Editar página 6 | 7 | - id: Last modified by 8 | translation: Última modificação por 9 | 10 | - id: Expand 11 | translation: Expandir 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/ru.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Поиск 3 | 4 | - id: Edit this page 5 | translation: Редактировать эту страницу 6 | 7 | - id: Last modified by 8 | translation: Последнее изменение от 9 | 10 | - id: Expand 11 | translation: Развернуть 12 | 13 | - id: bookSearchConfig 14 | translation: '{ split: /[^a-zа-яё0-9\w]/gi }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/sv.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Sök 3 | 4 | - id: Edit this page 5 | translation: Redigera denna sida 6 | 7 | - id: Last modified by 8 | translation: Senast modifierad av 9 | 10 | - id: Expand 11 | translation: Expandera 12 | 13 | - id: bookSearchConfig 14 | translation: '{ cache: true }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/uk.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Пошук 3 | 4 | - id: Edit this page 5 | translation: Редагувати цю сторінку 6 | 7 | - id: Last modified by 8 | translation: Остання зміна від 9 | 10 | - id: Expand 11 | translation: Розгорнути 12 | 13 | - id: bookSearchConfig 14 | translation: '{ split: /[^a-zа-яё0-9\w]/gi }' 15 | -------------------------------------------------------------------------------- /themes/book/i18n/zh.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: 搜索 3 | 4 | - id: Edit this page 5 | translation: 编辑本页 6 | 7 | - id: Last modified by 8 | translation: 最后修改者 9 | 10 | - id: Expand 11 | translation: 展开 12 | 13 | - id: bookSearchConfig 14 | translation: | 15 | { 16 | encode: false, 17 | tokenize: function(str) { 18 | return str.replace(/[\x00-\x7F]/g, '').split(''); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /themes/book/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/images/screenshot.png -------------------------------------------------------------------------------- /themes/book/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/images/tn.png -------------------------------------------------------------------------------- /themes/book/layouts/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ partial "docs/html-head" . }} 6 | {{ partial "docs/inject/head" . }} 7 | 8 | 18 | 19 | 20 | 21 |
22 |
23 |

404

24 |

Page Not Found

25 |

26 | {{ .Site.Title }} 27 |

28 |
29 |
30 | 31 | {{ partial "docs/inject/body" . }} 32 | {{ template "_internal/google_analytics_async.html" . }} 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /themes/book/layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | 2 | {{ .Text | safeHTML }} 3 | # 4 | 5 | -------------------------------------------------------------------------------- /themes/book/layouts/_default/_markup/render-image.html: -------------------------------------------------------------------------------- 1 | {{- if .Page.Site.Params.BookPortableLinks -}} 2 | {{- template "portable-image" . -}} 3 | {{- else -}} 4 | {{ .Text }} 5 | {{- end -}} 6 | 7 | {{- define "portable-image" -}} 8 | {{- $isRemote := or (in .Destination "://") (strings.HasPrefix .Destination "//") }} 9 | {{- if not $isRemote }} 10 | {{- $path := print .Page.File.Dir .Destination }} 11 | {{- if strings.HasPrefix .Destination "/" }} 12 | {{- $path = print "/static" .Destination }} 13 | {{- end }} 14 | {{- if not (fileExists $path) }} 15 | {{- warnf "Image '%s' not found in '%s'" .Destination .Page.File }} 16 | {{- end }} 17 | {{- end }} 18 | {{ .Text }} 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /themes/book/layouts/_default/_markup/render-link.html: -------------------------------------------------------------------------------- 1 | {{- if .Page.Site.Params.BookPortableLinks -}} 2 | {{- template "portable-link" . -}} 3 | {{- else -}} 4 | {{ .Text | safeHTML }} 5 | {{- end -}} 6 | 7 | {{- define "portable-link" -}} 8 | {{- $destination := .Destination }} 9 | {{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }} 10 | {{- if not $isRemote }} 11 | {{- $url := urls.Parse .Destination }} 12 | {{- $path := strings.TrimSuffix "/_index.md" $url.Path }} 13 | {{- $path = strings.TrimSuffix "/_index" $path }} 14 | {{- $path = strings.TrimSuffix ".md" $path }} 15 | {{- $page := .Page.GetPage $path }} 16 | {{- if $page }} 17 | {{- $destination = $page.RelPermalink }} 18 | {{- if $url.Fragment }} 19 | {{- $destination = print $destination "#" $url.Fragment }} 20 | {{- end }} 21 | {{- else if fileExists (print .Page.File.Dir .Destination) }} 22 | 23 | {{- else -}} 24 | {{- warnf "Page '%s' not found in '%s'" .Destination .Page.File }} 25 | {{- end }} 26 | {{- end }} 27 | {{ .Text | safeHTML }} 28 | {{- end -}} 29 | -------------------------------------------------------------------------------- /themes/book/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "dummy" }}{{ end }} 2 | -------------------------------------------------------------------------------- /themes/book/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "dummy" }}{{ end }} 2 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/brand.html: -------------------------------------------------------------------------------- 1 |

2 | 3 | {{- with .Site.Params.BookLogo -}} 4 | Logo 5 | {{- end -}} 6 | {{ .Site.Title }} 7 | 8 |

9 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/comments.html: -------------------------------------------------------------------------------- 1 | 2 | {{ template "_internal/disqus.html" . }} 3 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/date.html: -------------------------------------------------------------------------------- 1 | 5 | {{- $format := default "January 2, 2006" .Format -}} 6 | {{- return (.Date.Format $format) -}} 7 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/footer.html: -------------------------------------------------------------------------------- 1 |
2 | {{ if .Site.IsMultiLingual }} 3 | {{ partial "docs/languages" . }} 4 | {{ end }} 5 | 6 | {{ if and .GitInfo .Site.Params.BookRepo }} 7 |
8 | {{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}} 9 | 10 | Calendar 11 | {{ $date }} 12 | 13 |
14 | {{ end }} 15 | 16 | {{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} 17 | 23 | {{ end }} 24 |
25 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/header.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 | {{ partial "docs/title" . }} 7 | 8 | 13 |
14 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/body.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/body.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/content-after.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/content-after.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/content-before.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/content-before.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/footer.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/head.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/head.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/menu-after.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/menu-after.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/inject/menu-before.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/layouts/partials/docs/inject/menu-before.html -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/languages.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $translations := dict }} 3 | {{ range .Site.Home.AllTranslations }} 4 | {{ $translations = merge $translations (dict .Language.Lang .) }} 5 | {{ end }} 6 | {{ range .Translations }} 7 | {{ $translations = merge $translations (dict .Language.Lang .) }} 8 | {{ end }} 9 | 10 |
11 |
    12 |
  • 13 | Languages 14 | {{ $.Site.Language.LanguageName }} 15 |
  • 16 |
17 | 18 | 28 |
29 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/menu-bundle.html: -------------------------------------------------------------------------------- 1 | {{ with .Site.GetPage .Site.Params.BookMenuBundle }} 2 | {{- $href := printf "href=\"%s\"" $.RelPermalink -}} 3 | {{- replace .Content $href (print $href "class=active") | safeHTML -}} 4 | {{ end }} 5 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/menu-hugo.html: -------------------------------------------------------------------------------- 1 | 5 | {{ if . }} 6 | {{ template "book-menu-hugo" . }} 7 | {{ end }} 8 | 9 | {{ define "book-menu-hugo" }} 10 | 28 | {{ end }} 29 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/menu.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | {{ $script := resources.Get "menu-reset.js" | resources.Minify }} 20 | {{ with $script.Content }} 21 | 22 | {{ end }} 23 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/post-meta.html: -------------------------------------------------------------------------------- 1 | {{ with .Date}} 2 |
{{ partial "docs/date" (dict "Date" . "Format" $.Site.Params.BookDateFormat) }}
3 | {{ end }} 4 | 5 | {{ range $taxonomy, $_ := .Site.Taxonomies }} 6 | {{ with $terms := $.GetTerms $taxonomy }} 7 |
8 | {{ range $n, $term := $terms }}{{ if $n }}, {{ end }} 9 | {{ $term.Title }} 10 | {{- end }} 11 |
12 | {{ end }} 13 | {{ end }} 14 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/search.html: -------------------------------------------------------------------------------- 1 | {{ if default true .Site.Params.BookSearch }} 2 | 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/taxonomy.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/title.html: -------------------------------------------------------------------------------- 1 | 5 | {{ $title := "" }} 6 | 7 | {{ if .Title }} 8 | {{ $title = .Title }} 9 | {{ else if and .IsSection .File }} 10 | {{ $title = path.Base .File.Dir | humanize | title }} 11 | {{ else if and .IsPage .File }} 12 | {{ $title = .File.BaseFileName | humanize | title }} 13 | {{ end }} 14 | 15 | {{ return $title }} 16 | -------------------------------------------------------------------------------- /themes/book/layouts/partials/docs/toc.html: -------------------------------------------------------------------------------- 1 | {{ .TableOfContents }} 2 | -------------------------------------------------------------------------------- /themes/book/layouts/posts/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ range sort .Paginator.Pages }} 3 |
4 |

5 | {{ .Title }} 6 |

7 | {{ partial "docs/post-meta" . }} 8 |

9 | {{- .Summary -}} 10 | {{ if .Truncated }} 11 | ... 12 | {{ end }} 13 |

14 |
15 | {{ end }} 16 | 17 | {{ template "_internal/pagination.html" . }} 18 | {{ end }} 19 | 20 | {{ define "toc" }} 21 | {{ partial "docs/taxonomy" . }} 22 | {{ end }} 23 | -------------------------------------------------------------------------------- /themes/book/layouts/posts/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |

4 | {{ .Title }} 5 |

6 | {{ partial "docs/post-meta" . }} 7 |

8 | {{- .Content -}} 9 |

10 |
11 | {{ end }} 12 | 13 | {{ define "toc" }} 14 | {{ partial "docs/toc" . }} 15 | {{ end }} 16 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | {{ $ref := "" }} 2 | {{ $target := "" }} 3 | {{ with .Get "href" }} 4 | {{ $ref = . }} 5 | {{ $target = "_blank" }} 6 | {{ end }} 7 | {{ with .Get "relref" }} 8 | {{ $ref = relref $ . }} 9 | {{ end }} 10 | 11 | {{ $.Inner }} 12 | 13 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/columns.html: -------------------------------------------------------------------------------- 1 |
2 | {{ range split .Inner "<--->" }} 3 |
4 | {{ . | markdownify }} 5 |
6 | {{ end }} 7 |
8 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/details.html: -------------------------------------------------------------------------------- 1 |
2 | {{ cond .IsNamedParams (.Get "title") (.Get 0) }} 3 |
4 | {{ .Inner | markdownify }} 5 |
6 |
7 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/expand.html: -------------------------------------------------------------------------------- 1 | {{ warnf "Expand shortcode is deprecated. Use 'details' instead." }} 2 |
3 | 13 |
14 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/hint.html: -------------------------------------------------------------------------------- 1 |
2 | {{ .Inner | markdownify }} 3 |
4 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/katex.html: -------------------------------------------------------------------------------- 1 | {{- if not (.Page.Scratch.Get "katex") -}} 2 | 3 | 4 | 5 | 6 | {{- .Page.Scratch.Set "katex" true -}} 7 | {{- end -}} 8 | 9 | 10 | {{ cond (in .Params "display") "\\[" "\\(" -}} 11 | {{- trim .Inner "\n" -}} 12 | {{- cond (in .Params "display") "\\]" "\\)" }} 13 | 14 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/mermaid.html: -------------------------------------------------------------------------------- 1 | {{ if not (.Page.Scratch.Get "mermaid") }} 2 | 3 | 4 | {{ with resources.Get "mermaid.json" }} 5 | 6 | {{ end }} 7 | {{ .Page.Scratch.Set "mermaid" true }} 8 | {{ end }} 9 | 10 |

11 | {{- .Inner -}} 12 |

13 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/section.html: -------------------------------------------------------------------------------- 1 |
2 | {{ range .Page.Pages }} 3 |
4 | {{ partial "docs/title" . }} 5 |
6 |
7 | {{ default .Summary .Description }} 8 |
9 | {{ end }} 10 |
11 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{ if .Parent }} 2 | {{ $name := .Get 0 }} 3 | {{ $group := printf "tabs-%s" (.Parent.Get 0) }} 4 | 5 | {{ if not (.Parent.Scratch.Get $group) }} 6 | {{ .Parent.Scratch.Set $group slice }} 7 | {{ end }} 8 | 9 | {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} 10 | {{ else }} 11 | {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} 12 | {{ end}} 13 | -------------------------------------------------------------------------------- /themes/book/layouts/shortcodes/tabs.html: -------------------------------------------------------------------------------- 1 | {{ if .Inner }}{{ end }} 2 | {{ $id := .Get 0 }} 3 | {{ $group := printf "tabs-%s" $id }} 4 | 5 |
6 | {{- range $index, $tab := .Scratch.Get $group -}} 7 | 8 | 11 |
12 | {{- .Content | markdownify -}} 13 |
14 | {{- end -}} 15 |
16 | -------------------------------------------------------------------------------- /themes/book/layouts/taxonomy/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |

{{ .Title | title }}

4 | {{ $taxonomies := index .Site.Taxonomies .Page.Type }} 5 | {{ range $taxonomies }} 6 | 7 | {{ end }} 8 |
9 | {{ end }} 10 | 11 | {{ define "toc" }} 12 | {{ partial "docs/taxonomy" . }} 13 | {{ end }} 14 | -------------------------------------------------------------------------------- /themes/book/layouts/taxonomy/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ range sort .Paginator.Pages }} 3 |
4 |

5 | {{ .Title }} 6 |

7 | {{ partial "docs/post-meta" . }} 8 |

9 | {{- .Summary -}} 10 | {{ if .Truncated }} 11 | ... 12 | {{ end }} 13 |

14 |
15 | {{ end }} 16 | 17 | {{ template "_internal/pagination.html" . }} 18 | {{ end }} 19 | 20 | {{ define "toc" }} 21 | {{ partial "docs/taxonomy" . }} 22 | {{ end }} 23 | -------------------------------------------------------------------------------- /themes/book/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/favicon.png -------------------------------------------------------------------------------- /themes/book/static/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-mono-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-mono-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-300italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-300italic.woff -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-300italic.woff2 -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-700.woff -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-700.woff2 -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-regular.woff -------------------------------------------------------------------------------- /themes/book/static/fonts/roboto-v19-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/fonts/roboto-v19-latin-regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/specs/3d0b0c14074c59e22721917d50c13a9b039643a7/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /themes/book/static/svg/calendar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/static/svg/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/static/svg/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/static/svg/toc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/static/svg/translate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/book/theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "Book" 5 | license = "MIT" 6 | licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE" 7 | description = "Hugo documentation theme as simple as plain book" 8 | homepage = "https://github.com/alex-shpak/hugo-book" 9 | tags = ["responsive", "clean", "documentation", "docs", "flexbox", "search", "mobile", "multilingual", "disqus"] 10 | features = [] 11 | min_version = "0.68" 12 | 13 | [author] 14 | name = "Alex Shpak" 15 | homepage = "https://github.com/alex-shpak/" 16 | -------------------------------------------------------------------------------- /tools/readme.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const vfile = require('to-vfile') 3 | const remark = require('remark') 4 | const toc = require('remark-toc') 5 | 6 | const readme = vfile.readSync('README.md') 7 | 8 | // inject toc into readme 9 | remark() 10 | .use(toc, { tight: true }) 11 | .process(readme, function (err) { 12 | if (err) throw err 13 | vfile.writeSync(readme) 14 | console.log('Updated README.md') 15 | }) 16 | -------------------------------------------------------------------------------- /tools/toc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const jsdom = require('jsdom') 4 | const path = require('path') 5 | const fs = require('fs') 6 | const { buildTocModel } = require('./toc/build-model') 7 | 8 | const src = 'public/index.html' 9 | const dest = 'data/toc.json' 10 | 11 | // run as script, so do the thing 12 | if (require.main === module) { 13 | run(src, dest) 14 | } 15 | 16 | async function run(src, dest) { 17 | console.log('Building toc.json') 18 | console.time('Built toc.json') 19 | await buildToc(src, dest) 20 | console.timeEnd('Built toc.json') 21 | } 22 | 23 | async function buildToc(src, dest) { 24 | if (!fs.existsSync(path.dirname(dest))) { 25 | fs.mkdirSync(path.dirname(dest)) 26 | } 27 | const dom = await jsdom.JSDOM.fromFile(src) 28 | const model = buildTocModel(dom.window.document.querySelector('.markdown')) 29 | const json = JSON.stringify(model, null, 2) 30 | let prev = Buffer.from('') 31 | try { 32 | prev = fs.readFileSync(dest) 33 | } catch { 34 | // ok, no previous data. 35 | } 36 | if (!Buffer.from(json).equals(prev)) { 37 | try { 38 | fs.writeFileSync(dest, json) 39 | console.log(`Updated toc.json`) 40 | } catch (err) { 41 | return console.error(err) 42 | } 43 | } 44 | } 45 | 46 | module.exports.configureWatcher = (watcher) => { 47 | watcher.on('all', async (_, p) => { 48 | if (p === src) { 49 | await buildToc(src, dest) 50 | } 51 | }) 52 | 53 | watcher.add(src) 54 | } 55 | -------------------------------------------------------------------------------- /tools/watch.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chokidar = require('chokidar') 3 | const diagrams = require('./diagrams') 4 | const toc = require('./toc') 5 | 6 | watch() 7 | 8 | function watch() { 9 | const watcher = chokidar.watch([], { 10 | awaitWriteFinish: { 11 | stabilityThreshold: 1000, 12 | pollInterval: 100, 13 | }, 14 | ignoreInitial: true, 15 | }) 16 | 17 | watcher 18 | .on('error', (err) => console.error('error watching: ', err)) 19 | .on('all', (event, p) => console.log(event, p)) 20 | 21 | toc.configureWatcher(watcher) 22 | diagrams.configureWatcher(watcher) 23 | } 24 | --------------------------------------------------------------------------------