Skip to content

Commit fbfae8c

Browse files
authored
feat(Website): add website directory with Docusaurus generated doc site. (#3)
* fix(api): fix channel_info_lookup filename * feat(definitions): updated definitions to match latest versions * fix(definitons): Add Data definition * feat(API): updated and consolidated API documentation, removed outdated definitions * cleanup(Tools): removed Websocket docs, updated Tools to pull m8 doc and remove cli and it * feat(v0.8.0): updated architecture, tutorial, and examples to v0.8.0 Removed references to outdated objects such as Channel Config, and Accounts. Updated examples to use m8 tool. Updated configs to reference latest config such as default port number. * fix(api): remove duplicate definition on transaction submit response * fix(api): fix newline markdown spacing * fix(definitions): fix Data definition header * cleanup(versioning): remove versioning, store all processed docs in docs directory, remove API Reference * feat(website): generate Docusaurus site to display docs, add OpenAPI Spec to work with Redoc component * feat(definitions): remove definitions, used React import of Redoc component from Open API Spec instead * fix(config): use a number scrollYOffset value * cleanup(README): update README to use npm * fix(deps): bump redocusaurus version to fix api page sidebar scrolling issue * feat(docs): upate docs for mazzaroth v0.8.1 using updated Gateway naming and config values * fix(config): update config for deployment, check-in package-lock * fix(config): update links to use duplicate docs routing due to repo name matching docs dir
1 parent 82b46d0 commit fbfae8c

File tree

136 files changed

+26909
-9105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+26909
-9105
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
.PHONY: all lint
22

3-
VERSION = "v0.8.0"
3+
OUTPUT = "docs"
44

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

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

1010
#
1111
# # The default is to build all the OUTPUTS files
1212
all: $(PROCESS_OUTPUTS)
1313
#
1414
# # Tell make how to build a single output file
15-
./$(VERSION)/%.md : ./preprocessed/%.md
15+
./$(OUTPUT)/%.md : ./preprocessed/%.md
1616
@mkdir -p "$(@D)"
1717
markdown-pp $< -o $@
1818

README.md

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# docs
22

3-
The latest documentation can be found in the v0.4.2 directory.
3+
The latest documentation markdown can be found in the `docs` directory.
44

55
## Markdown preprocessor
66

77
Markdown files in the preprocessed directory use a [Markdown Preprocessor](https://github.com/jreese/markdown-pp)
88
syntax to allow importing modules from other documents and transform the documents
9-
that are finalized in the versioned directories.
9+
that are finalized in the docs directories. So any updates should be made to the
10+
preprocessed docs.
11+
12+
To build the docs run:
13+
14+
```Bash
15+
make all
16+
```
1017

1118
## Markdown lint
1219

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

19-
## Naming Convention
26+
## Docusaurus
2027

21-
We use a specific naming convention to allow the ToC on the website to be
22-
formatted correctly. We replace all underscores with spaces in the ToC, and we
23-
remove everything before the first '-' in the name. The main purpose of this
24-
is to allow good formatting and ordering in the ToC without also maintaining
25-
a metadata file. For example 1-Getting_Started.md -> 'Getting Started' in the
26-
ToC.
27-
28-
The exact logic is:
29-
30-
```Javascript
31-
let text = parts[1].replace(/_/g, " ").replace(".md", "");
32-
if (textParts.length > 1) {
33-
text = textParts.slice(1).join("-");
34-
}
35-
```
28+
The website directory contains a website built with [Docusaurus](https://github.com/facebook/docusaurus).

definitions/ABI.md

-8
This file was deleted.

definitions/Block.md

-8
This file was deleted.

definitions/BlockHeader.md

-12
This file was deleted.

definitions/BlockHeight.md

-5
This file was deleted.

definitions/Call.md

-6
This file was deleted.

definitions/Category.md

-10
This file was deleted.

definitions/ChannelConfig.md

-6
This file was deleted.

definitions/ChannelInfo.md

-10
This file was deleted.

definitions/Contract.md

-9
This file was deleted.

definitions/Data.md

-10
This file was deleted.

definitions/FunctionSignature.md

-10
This file was deleted.

definitions/Parameter.md

-6
This file was deleted.

definitions/Receipt.md

-9
This file was deleted.

definitions/Transaction.md

-9
This file was deleted.

v0.8.0/1-Getting_Started.md docs/1-Getting_Started.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
sidebar_label: "Getting Started"
3+
sidebar_position: 1
4+
---
5+
16
# Mazzaroth
27

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

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

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

6065
```Bash
61-
mazzaroth start standalone --cfg-path my-config.yaml
66+
mazzaroth node start standalone --cfg-path my-config.yaml
6267
```
6368

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

74-
### Readonly
79+
### Gateway
7580

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

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

8893
## Interacting with a Node
8994

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

9499
[m8](https://github.com/kochavalabs/m8) is a command line tool

v0.0.1/2-Account_Creation.md docs/2-Account_Creation.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
sidebar_label: "Account Creation"
3+
sidebar_position: 2
4+
---
5+
16
# Creating Mazzaroth Accounts
27

38
All transactions that are submitted to the network will be signed by a private
File renamed without changes.

preprocessed/4-Architecture/5-Storage.md docs/3-Architecture/5-Storage.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import ApiSchema from '@theme/ApiSchema';
2+
13
# Storage
24

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

68-
!INCLUDE "definitions/BlockHeader.md", 2
70+
<ApiSchema pointer="#/definitions/BlockHeader" />
6971

7072
Every Block Header contains three Merkle Root Hashes, which correspond to the
7173
Transaction Merkle Tree, the Receipt Merkle Tree, and the State DB Merkle Tree.

preprocessed/4-Architecture/6-Data_Structures.md docs/3-Architecture/6-Data_Structures.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ against faulty nodes while allowing a distributed network to reach consensus.
2727
- [PBFT White Paper](http://pmg.csail.mit.edu/papers/osdi99.pdf)
2828

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

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

59-
### Readonly Node
59+
### Gateway Node
6060

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

6565
### Consensus Node
6666

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

7272
## Peer to Peer
7373

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

8989
### Distributed Ledger
9090

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

0 commit comments

Comments
 (0)