Skip to content

feat(Website): add website directory with Docusaurus generated doc site. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
54f4e63
fix(api): fix channel_info_lookup filename
jeff1010322 Mar 23, 2022
2fb6ea3
feat(definitions): updated definitions to match latest versions
jeff1010322 Mar 23, 2022
d5b471a
fix(definitons): Add Data definition
jeff1010322 Mar 23, 2022
65246b8
feat(API): updated and consolidated API documentation, removed outdat…
jeff1010322 Mar 23, 2022
7a21e23
cleanup(Tools): removed Websocket docs, updated Tools to pull m8 doc …
jeff1010322 Mar 23, 2022
a366e78
feat(v0.8.0): updated architecture, tutorial, and examples to v0.8.0
jeff1010322 Mar 24, 2022
32d5e21
fix(api): remove duplicate definition on transaction submit response
jeff1010322 Mar 24, 2022
d5f24f9
fix(api): fix newline markdown spacing
jeff1010322 Mar 25, 2022
1f27a9a
fix(definitions): fix Data definition header
jeff1010322 Mar 25, 2022
d6aa6d7
cleanup(versioning): remove versioning, store all processed docs in d…
jeff1010322 Mar 30, 2022
b9e12eb
feat(website): generate Docusaurus site to display docs, add OpenAPI …
jeff1010322 Mar 30, 2022
2e42799
feat(definitions): remove definitions, used React import of Redoc com…
jeff1010322 Mar 31, 2022
f46b8a7
fix(config): use a number scrollYOffset value
jeff1010322 Apr 4, 2022
21b6d69
cleanup(README): update README to use npm
jeff1010322 Apr 4, 2022
b2afc9c
Merge branch 'main' into website
jeff1010322 Apr 4, 2022
9f68802
fix(deps): bump redocusaurus version to fix api page sidebar scrollin…
jeff1010322 Apr 4, 2022
6a3e1f6
feat(docs): upate docs for mazzaroth v0.8.1 using updated Gateway nam…
jeff1010322 Apr 5, 2022
9be84e1
fix(config): update config for deployment, check-in package-lock
jeff1010322 Apr 6, 2022
82aabb9
fix(config): update links to use duplicate docs routing due to repo n…
jeff1010322 Apr 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.PHONY: all lint

VERSION = "v0.8.0"
OUTPUT = "docs"

PROCESS_INPUTS = $(shell find ./preprocessed/ -type f -name '*.md')

# Create a list of all the output files you want to generate
PROCESS_OUTPUTS := $(patsubst ./preprocessed/%.md, ./$(VERSION)/%.md, $(PROCESS_INPUTS))
PROCESS_OUTPUTS := $(patsubst ./preprocessed/%.md, ./$(OUTPUT)/%.md, $(PROCESS_INPUTS))

#
# # The default is to build all the OUTPUTS files
all: $(PROCESS_OUTPUTS)
#
# # Tell make how to build a single output file
./$(VERSION)/%.md : ./preprocessed/%.md
./$(OUTPUT)/%.md : ./preprocessed/%.md
@mkdir -p "$(@D)"
markdown-pp $< -o $@

Expand Down
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# docs

The latest documentation can be found in the v0.4.2 directory.
The latest documentation markdown can be found in the `docs` directory.

## Markdown preprocessor

Markdown files in the preprocessed directory use a [Markdown Preprocessor](https://github.com/jreese/markdown-pp)
syntax to allow importing modules from other documents and transform the documents
that are finalized in the versioned directories.
that are finalized in the docs directories. So any updates should be made to the
preprocessed docs.

To build the docs run:

```Bash
make all
```

## Markdown lint

Expand All @@ -16,20 +23,6 @@ lint rules.
See [Rules](https://github.com/DavidAnson/markdownlint/blob/v0.20.3/doc/Rules.md)
for reference.

## Naming Convention
## Docusaurus

We use a specific naming convention to allow the ToC on the website to be
formatted correctly. We replace all underscores with spaces in the ToC, and we
remove everything before the first '-' in the name. The main purpose of this
is to allow good formatting and ordering in the ToC without also maintaining
a metadata file. For example 1-Getting_Started.md -> 'Getting Started' in the
ToC.

The exact logic is:

```Javascript
let text = parts[1].replace(/_/g, " ").replace(".md", "");
if (textParts.length > 1) {
text = textParts.slice(1).join("-");
}
```
The website directory contains a website built with [Docusaurus](https://github.com/facebook/docusaurus).
8 changes: 0 additions & 8 deletions definitions/ABI.md

This file was deleted.

8 changes: 0 additions & 8 deletions definitions/Block.md

This file was deleted.

12 changes: 0 additions & 12 deletions definitions/BlockHeader.md

This file was deleted.

5 changes: 0 additions & 5 deletions definitions/BlockHeight.md

This file was deleted.

6 changes: 0 additions & 6 deletions definitions/Call.md

This file was deleted.

10 changes: 0 additions & 10 deletions definitions/Category.md

This file was deleted.

6 changes: 0 additions & 6 deletions definitions/ChannelConfig.md

This file was deleted.

10 changes: 0 additions & 10 deletions definitions/ChannelInfo.md

This file was deleted.

9 changes: 0 additions & 9 deletions definitions/Contract.md

This file was deleted.

10 changes: 0 additions & 10 deletions definitions/Data.md

This file was deleted.

10 changes: 0 additions & 10 deletions definitions/FunctionSignature.md

This file was deleted.

6 changes: 0 additions & 6 deletions definitions/Parameter.md

This file was deleted.

9 changes: 0 additions & 9 deletions definitions/Receipt.md

This file was deleted.

9 changes: 0 additions & 9 deletions definitions/Transaction.md

This file was deleted.

21 changes: 13 additions & 8 deletions v0.8.0/1-Getting_Started.md → docs/1-Getting_Started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
sidebar_label: "Getting Started"
sidebar_position: 1
---

# Mazzaroth

## Introduction
Expand Down Expand Up @@ -47,18 +52,18 @@ There are currently 3 types of nodes available to be deployed:

- [Standalone](#Standalone) nodes are useful for development, but do not connect
to the distributed network of consensus nodes.
- [Readonly](#Readonly) nodes provide users with access to the blockchain
- [Gateway](#Gateway) nodes provide users with access to the blockchain
through RPCs but do not participate in consensus.
- [Consensus](#Consensus) nodes participate in a channel's consensus to
facilitate ordering and execution of transactions.

The command to start a node is `mazzaroth start` followed by the type.
The command to start a node is `mazzaroth node start` followed by the type.
Command line flags may also be provided to override default config values or
you can use a config yaml file. For example, to start a standalone node with
a config file you can use the following command:

```Bash
mazzaroth start standalone --cfg-path my-config.yaml
mazzaroth node start standalone --cfg-path my-config.yaml
```

For the GCP standalone solution a systemd service is already setup and all that
Expand All @@ -71,10 +76,10 @@ A standalone node can be used as a development environment for Mazzaroth.
It provides a way to deploy and interact with a smart contract without
connecting to the global network of nodes.

### Readonly
### Gateway

A readonly node is connected to the network but does not participate in consensus.
The main role of a readonly node is to allow clients to send requests to the
A gateway node is connected to the network but does not participate in consensus.
The main role of a gateway node is to allow clients to send requests to the
channel including submitting transactions and requesting information from
the ledger or state.

Expand All @@ -83,12 +88,12 @@ the ledger or state.
A consensus node is connected to the network and participates in the consensus
that accepts transactions into the channel. A consensus node does not allow
requests from clients, but does receive forwarded transactions from other
readonly nodes in the network.
gateway nodes in the network.

## Interacting with a Node

This guide will walk you through interacting with a Mazzaroth node.
Standalone and Readonly nodes use HTTP to handle requests and can be used to
Standalone and Gateway nodes use HTTP to handle requests and can be used to
deploy contracts, submit transactions, or lookup information from the ledger.

[m8](https://github.com/kochavalabs/m8) is a command line tool
Expand Down
5 changes: 5 additions & 0 deletions v0.0.1/2-Account_Creation.md → docs/2-Account_Creation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
sidebar_label: "Account Creation"
sidebar_position: 2
---

# Creating Mazzaroth Accounts

All transactions that are submitted to the network will be signed by a private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ApiSchema from '@theme/ApiSchema';

# Storage

Data is stored by Mazzaroth in a couple of ways. The Mazzaroth Ledger
Expand Down Expand Up @@ -65,7 +67,7 @@ efficient and secure verification of the data that it stores.
For an example of how this is used in Mazzaroth take a look at the fields of a
Block Header.

!INCLUDE "definitions/BlockHeader.md", 2
<ApiSchema pointer="#/definitions/BlockHeader" />

Every Block Header contains three Merkle Root Hashes, which correspond to the
Transaction Merkle Tree, the Receipt Merkle Tree, and the State DB Merkle Tree.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ against faulty nodes while allowing a distributed network to reach consensus.
- [PBFT White Paper](http://pmg.csail.mit.edu/papers/osdi99.pdf)

Nodes may join a channel as a Consensus node in order to participate in the
consensus protocol. Readonly nodes in a channel will take incoming transactions
consensus protocol. Gateway nodes in a channel will take incoming transactions
from clients and submit them to a consensus node to have the transaction ordered
and executed. The consensus may batch a number of transactions in a single
request round to reduce the number of consensus messages that are needed to
Expand All @@ -45,7 +45,7 @@ There are currently 3 types of nodes:

- [Standalone](#Standalone-Node) nodes are useful for development, but do not connect
to the distributed network of consensus nodes.
- [Readonly](#Readonly-Node) nodes provide users with access to the blockchain through
- [Gateway](#Geadonly-Node) nodes provide users with access to the blockchain through
RPCs but do not participate in consensus.
- [Consensus](#Consensus-Node) nodes participate in a channel's consensus to facilitate
ordering and execution of transactions.
Expand All @@ -56,18 +56,18 @@ A standalone node can be used as a development environment for Mazzaroth.
It provides a way to deploy and interact with a smart contract without
needing a network of nodes.

### Readonly Node
### Gateway Node

A readonly node is connected to the network but does not participate in consensus.
The main role of a readonly node is to allow clients to send requests to the channel
A gateway node is connected to the network but does not participate in consensus.
The main role of a gateway node is to allow clients to send requests to the channel
including submitting transactions and requesting information from the ledger or state.

### Consensus Node

A consensus node is connected to the network and participates in
the consensus that accepts transactions into the channel.
A consensus node does not allow requests from clients,
but does receive forwarded transactions from other readonly nodes in the network.
but does receive forwarded transactions from other gateway nodes in the network.

## Peer to Peer

Expand All @@ -88,9 +88,9 @@ of the network in order to join.

### Distributed Ledger

Each type of node (readonly or consensus) will keep a record of transactions
Each type of node (gateway or consensus) will keep a record of transactions
that have been executed along with receipts in its Ledger.
Consensus and Readonly nodes communicate to each other using a p2p protocol
Consensus and Gateway nodes communicate to each other using a p2p protocol
backed by the membership to make sure transactions are propagated to all nodes
in the network. With Consensus ordering we ensure that the ledger of each node
participating in the network will match for a given height.
Expand Down
Loading