Skip to content

Commit

Permalink
feat: adding Namada specs documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende committed Jun 12, 2023
1 parent e15c129 commit 1b7ebdf
Show file tree
Hide file tree
Showing 149 changed files with 9,253 additions and 59 deletions.
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM node:18-alpine AS base

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN pnpm build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT 3000

CMD ["node", "server.js"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion next.config.js → apps/docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const withNextra = require("nextra")({

module.exports = {
...withNextra(),
output: "export",
images: {
unoptimized: true,
},
Expand Down
31 changes: 31 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "nextra-docs-template",
"version": "0.0.1",
"description": "Namada Docs",
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"start": "next start"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shuding/nextra-docs-template.git"
},
"author": "Shu Ding <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/shuding/nextra-docs-template/issues"
},
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
"dependencies": {
"next": "^13.0.6",
"nextra": "latest",
"nextra-theme-docs": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.11.10",
"typescript": "^4.9.3"
}
}
16 changes: 16 additions & 0 deletions apps/docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"index": "Namada",
"introduction": "Introduction",
"running-a-full-node": "Full nodes",
"ledger": "Running the ledger",
"validators": "Validators",
"delegators": "Delegators",
"users": "(Power) Users",
"public-goods-stewards": "Public goods stewards",
"proof-of-stake": "Cubic Proof-of-stake",
"governance": "Governance",
"wallet": "Wallet guide",
"experimental": "Experimenting with namada",
"troubleshooting": "Troubleshooting",
"faq": "FAQ"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions apps/docs/pages/governance/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"on-chain-governance": "On-chain proposals",
"off-chain-governance": "Off-chain proposals"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"quick-start": "Quick Start",
"quick-start": "Quick start",
"install": "Install Namada",
"installing-tendermint": "Install Tendermint",
"testnets": "Testnets",
"base-directory": "Base Directory"
"base-directory": "Base directory"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions apps/docs/pages/introduction/testnets/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"environment-setup": "Environment setup",
"migrating-testnets": "Migrating Testnets",
"pre-genesis": "Pre-genesis",
"genesis-validator-apply": "Applying as a genesis validator",
"joining-the-testnet": "Joining the latest Testnet",
"post-genesis-validator": "Joining the latest Testnet",
"upgrades": "Testnet upgrades",
"pow": "Proof-of-work on Namada"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions apps/docs/pages/public-goods-stewards/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"electing": "Becoming a Steward",
"voting": "Voting for Stewards and PGF proposals",
"proposing": "PGF proposals (Stewards only)"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/docs/pages/users/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"an-introduction-to-namada-addresses": "Namada addresses",
"send-and-receive-nam-tokens": "Sending and receiving NAM",
"shielded-transfers": "Shielded transfers",
"shielded-rewards": "Shield rewards",
"privacy": "Proper Opsec for proper privacy"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/docs/pages/validators/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"hardware": "Hardware requirements",
"genesis-validator-setup": "Genesis validator setup",
"run-your-genesis-validator": "Running a genesis validator",
"post-genesis-validator-setup": "Initialising a validator account",
"staking": "Staking"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/docs/pages/wallet/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"established-accounts": "Established accounts",
"file-system-wallet": "File system wallet",
"web-wallet": "Web wallet",
"hardware-wallet": "Hardware wallet",
"fees": "Fees on Namada"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions apps/specs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Shu Ding

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 30 additions & 0 deletions apps/specs/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useEffect, useState } from "react";
import { useTheme } from "nextra-theme-docs";

export const Logo = () => {
const { theme } = useTheme();
const [isDark, setDark] = useState(false);

useEffect(() => {
setDark(theme === "dark");
}, [theme]);

return (
<div>
<svg
className="nx-w-full nx-py-4 nx-max-w-[200px] "
style={{ maxWidth: "100px" }}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 751 208.9"
fill={isDark ? "#ffff00" : "currentColor"}
>
<rect width="61.5" height="208.9" x="689.5" />
<rect width="61.5" height="208.9" x="609.5" />
<rect width="61.5" height="208.9" x="529" />
<polygon points="476.9 208.9 409.8 208.9 409.8 70.1 332.4 70.1 332.4 208.9 265.3 208.9 265.3 0 476.9 0 476.9 208.9" />
<circle cx="371.1" cy="111.5" r="28.8" />
<polygon points="211.5 208.9 144.5 208.9 144.5 70.1 67 70.1 67 208.9 0 208.9 0 0 211.5 0 211.5 208.9" />
</svg>
</div>
);
};
5 changes: 5 additions & 0 deletions apps/specs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
11 changes: 11 additions & 0 deletions apps/specs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

module.exports = {
...withNextra(),
images: {
unoptimized: true,
},
};
31 changes: 31 additions & 0 deletions apps/specs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "nextra-docs-template",
"version": "0.0.1",
"description": "Namada Docs",
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"start": "next start"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shuding/nextra-docs-template.git"
},
"author": "Shu Ding <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/shuding/nextra-docs-template/issues"
},
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
"dependencies": {
"next": "^13.0.6",
"nextra": "latest",
"nextra-theme-docs": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.11.10",
"typescript": "^4.9.3"
}
}
9 changes: 9 additions & 0 deletions apps/specs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"index": "Introduction",
"base-ledger": "Base ledger",
"masp": "Multi-asset shielded pool",
"interoperability": "Interoperability",
"economics": "Economics",
"user-interfaces": "User interfaces",
"further-reading": "Further reading"
}
3 changes: 3 additions & 0 deletions apps/specs/pages/base-ledger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Base ledger

The base ledger of Namada includes a [consensus system](./base-ledger/consensus.md), validity predicate-based [execution system](./base-ledger/execution.md), and signalling-based [governance mechanism](./base-ledger/governance.md). Namada's ledger also includes proof-of-stake, slashing, fees, and inflation funding for staking rewards, shielded pool incentives, and public goods — these are specified in the [economics section](./economics.md). This section also documents Namada's [multisignature VP](./base-ledger/multisignature.md), [fungible token VP](./base-ledger/fungible-token.md), and [replay protection system](./base-ledger/replay-protection.md).
9 changes: 9 additions & 0 deletions apps/specs/pages/base-ledger/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consensus": "Consensus",
"execution": "Execution",
"governance": "Governance",
"multisignature": "Multisignature",
"fungible-token": "Fungible token",
"replay-protection": "Replay protection",
"block-space-allocator": "Block space allocator"
}
Loading

0 comments on commit 1b7ebdf

Please sign in to comment.