diff --git a/babel.config.js b/babel.config.js index e00595da..bfd75dbd 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], + presets: [require.resolve("@docusaurus/core/lib/babel/preset")], }; diff --git a/docs/full-node/Full-Node-More.md b/docs/full-node/Full-Node-More.md index 690d9be4..98827e79 100644 --- a/docs/full-node/Full-Node-More.md +++ b/docs/full-node/Full-Node-More.md @@ -7,9 +7,11 @@ It's a good practice to use API key to limit the access to your full node's rest ### API Key Setup Please add the following to your `user.conf` by replacing the zeros with your own key (>= 32 characters). + ``` alephium.api.api-key = "0000000000000000000000000000000000000000000000000000000000000000" ``` + Restart your full node to make this take effect. #### API Key Generation @@ -19,10 +21,10 @@ On GNU/ Linux: `cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 48 | head -n 1` ### Use API Key 1. Click on the `Authorize` button on the top right of your Swagger UI: - +  2. Fill in the value box with your key and click the authorize button: - +  Now you could use Swagger UI as if there is no API key. @@ -33,4 +35,4 @@ To fix the problem: 1. Delete the folder .alephium `rm .alephium` -2. Restart the node and wait for synchronization `java -jar alephium-1.2.6.jar` +2. Restart the node and wait for synchronization `java -jar alephium-1.2.6.jar` diff --git a/docs/intro.md b/docs/intro.md index 9bf83e1a..9a408ccb 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -10,19 +10,19 @@ This wiki contains the documentation of [Alephium](https://github.com/alephium/a The protocol's innovations extend battle-tested ideas from [Bitcoin](https://bitcoin.org/bitcoin.pdf) and [Ethereum](https://ethereum.org/en/whitepaper/): -* BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + [algorithm paper](https://github.com/alephium/research/blob/master/alephium.pdf)) - * The first sharding algorithm that supports `single-step cross-shard transactions`, offering the same user experience as single chain - * Simple and elegant `PoW based sharding`, does not rely on beacon chain -* `Stateful UTXO model` combines the advantages of both eUTXO model and account model (see code, wiki to come) - * Tokens are first-class citizens and UTXO-based, which are `owned by users` directly instead of contracts - * Offer the same expressiveness as `account model`. DApps can be easily built on top of it with better security - * Support `multiple participants` in a single smart contract transaction. Multiple calls can be packed into a single transaction too. -* Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come) - * Less IO intensive - * Flash loan is not available by design - * Eliminate many attack vectors of EVM, including unlimited authorization, double dip issue, reentrancy attack, etc - * UTXO style `fine-grained execution model` reduces risk-free arbitrage -* `Front-running mitigation` through random execution of transactions (see code, wiki to come) -* PoLW algorithm reduces the energy consumption of PoW in the long term ([research paper](https://github.com/alephium/research/blob/master/polw.pdf)) - * Adaptive rewards based on hashrate and timestamp are designed and implemented - * Internal mining cost through burning will be added when hashrate and energy consumption is significantly high +- BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + [algorithm paper](https://github.com/alephium/research/blob/master/alephium.pdf)) + - The first sharding algorithm that supports `single-step cross-shard transactions`, offering the same user experience as single chain + - Simple and elegant `PoW based sharding`, does not rely on beacon chain +- `Stateful UTXO model` combines the advantages of both eUTXO model and account model (see code, wiki to come) + - Tokens are first-class citizens and UTXO-based, which are `owned by users` directly instead of contracts + - Offer the same expressiveness as `account model`. DApps can be easily built on top of it with better security + - Support `multiple participants` in a single smart contract transaction. Multiple calls can be packed into a single transaction too. +- Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come) + - Less IO intensive + - Flash loan is not available by design + - Eliminate many attack vectors of EVM, including unlimited authorization, double dip issue, reentrancy attack, etc + - UTXO style `fine-grained execution model` reduces risk-free arbitrage +- `Front-running mitigation` through random execution of transactions (see code, wiki to come) +- PoLW algorithm reduces the energy consumption of PoW in the long term ([research paper](https://github.com/alephium/research/blob/master/polw.pdf)) + - Adaptive rewards based on hashrate and timestamp are designed and implemented + - Internal mining cost through burning will be added when hashrate and energy consumption is significantly high diff --git a/docs/tutorial-basics/create-a-document.md b/docs/tutorial-basics/create-a-document.md index feaced79..724449dc 100644 --- a/docs/tutorial-basics/create-a-document.md +++ b/docs/tutorial-basics/create-a-document.md @@ -30,7 +30,7 @@ Add metadata to customize the sidebar label and position: ```md title="docs/hello.md" {1-4} --- -sidebar_label: 'Hi!' +sidebar_label: "Hi!" sidebar_position: 3 --- diff --git a/docs/tutorial-basics/create-a-page.md b/docs/tutorial-basics/create-a-page.md index e112b005..da823040 100644 --- a/docs/tutorial-basics/create-a-page.md +++ b/docs/tutorial-basics/create-a-page.md @@ -15,8 +15,8 @@ Add **Markdown or React** files to `src/pages` to create a **standalone page**: Create a file at `src/pages/my-react-page.js`: ```jsx title="src/pages/my-react-page.js" -import React from 'react'; -import Layout from '@theme/Layout'; +import React from "react"; +import Layout from "@theme/Layout"; export default function MyReactPage() { return ( diff --git a/docs/tutorial-extras/manage-docs-versions.md b/docs/tutorial-extras/manage-docs-versions.md index 6335b0ac..ef0b41bd 100644 --- a/docs/tutorial-extras/manage-docs-versions.md +++ b/docs/tutorial-extras/manage-docs-versions.md @@ -34,7 +34,7 @@ module.exports = { items: [ // highlight-start { - type: 'docsVersionDropdown', + type: "docsVersionDropdown", }, // highlight-end ], diff --git a/docs/tutorial-extras/translate-your-site.md b/docs/tutorial-extras/translate-your-site.md index a25c089e..2ae2d340 100644 --- a/docs/tutorial-extras/translate-your-site.md +++ b/docs/tutorial-extras/translate-your-site.md @@ -13,8 +13,8 @@ Modify `docusaurus.config.js` to add support for the `fr` locale: ```js title="docusaurus.config.js" module.exports = { i18n: { - defaultLocale: 'en', - locales: ['en', 'fr'], + defaultLocale: "en", + locales: ["en", "fr"], }, }; ``` @@ -60,7 +60,7 @@ module.exports = { items: [ // highlight-start { - type: 'localeDropdown', + type: "localeDropdown", }, // highlight-end ], diff --git a/docusaurus.config.js b/docusaurus.config.js index 58f17360..dc50b012 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,33 +1,34 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const lightCodeTheme = require("prism-react-renderer/themes/github"); +const darkCodeTheme = require("prism-react-renderer/themes/dracula"); /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'My Site', - tagline: 'Dinosaurs are cool', - url: 'https://your-docusaurus-test-site.com', - baseUrl: '/', - onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', - favicon: 'img/favicon.ico', - organizationName: 'facebook', // Usually your GitHub org/user name. - projectName: 'docusaurus', // Usually your repo name. + title: "My Site", + tagline: "Dinosaurs are cool", + url: "https://your-docusaurus-test-site.com", + baseUrl: "/", + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + favicon: "img/favicon.ico", + organizationName: "facebook", // Usually your GitHub org/user name. + projectName: "docusaurus", // Usually your repo name. presets: [ [ - 'classic', + "classic", /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - sidebarPath: require.resolve('./sidebars.js'), + sidebarPath: require.resolve("./sidebars.js"), // Please change this to your repo. - editUrl: "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + editUrl: + "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", }, theme: { - customCss: require.resolve('./src/css/custom.css'), + customCss: require.resolve("./src/css/custom.css"), }, }), ], @@ -37,60 +38,60 @@ const config = { /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ navbar: { - title: 'My Site', + title: "My Site", logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', + alt: "My Site Logo", + src: "img/logo.svg", }, items: [ { - type: 'doc', - docId: 'intro', - position: 'left', - label: 'Tutorial', + type: "doc", + docId: "intro", + position: "left", + label: "Tutorial", }, { - href: 'https://github.com/facebook/docusaurus', - label: 'GitHub', - position: 'right', + href: "https://github.com/facebook/docusaurus", + label: "GitHub", + position: "right", }, ], }, footer: { - style: 'dark', + style: "dark", links: [ { - title: 'Docs', + title: "Docs", items: [ { - label: 'Tutorial', - to: '/docs/intro', + label: "Tutorial", + to: "/docs/intro", }, ], }, { - title: 'Community', + title: "Community", items: [ { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/docusaurus', + label: "Stack Overflow", + href: "https://stackoverflow.com/questions/tagged/docusaurus", }, { - label: 'Discord', - href: 'https://discordapp.com/invite/docusaurus', + label: "Discord", + href: "https://discordapp.com/invite/docusaurus", }, { - label: 'Twitter', - href: 'https://twitter.com/docusaurus', + label: "Twitter", + href: "https://twitter.com/docusaurus", }, ], }, { - title: 'More', + title: "More", items: [ { - label: 'GitHub', - href: 'https://github.com/facebook/docusaurus', + label: "GitHub", + href: "https://github.com/facebook/docusaurus", }, ], }, diff --git a/package-lock.json b/package-lock.json index 878b81e6..98ce7827 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,9 @@ "prism-react-renderer": "^1.2.1", "react": "^17.0.1", "react-dom": "^17.0.1" + }, + "devDependencies": { + "prettier": "2.6.0" } }, "node_modules/@algolia/autocomplete-core": { @@ -9312,6 +9315,21 @@ "node": ">=4" } }, + "node_modules/prettier": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", + "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", @@ -19668,6 +19686,12 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" }, + "prettier": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", + "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "dev": true + }, "pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", diff --git a/package.json b/package.json index 7264a240..f3a63af1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "write-heading-ids": "docusaurus write-heading-ids", + "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"" }, "dependencies": { "@docusaurus/core": "2.0.0-beta.17", @@ -33,5 +34,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "prettier": "2.6.0" } } diff --git a/sidebars.js b/sidebars.js index fd342f2c..96621506 100644 --- a/sidebars.js +++ b/sidebars.js @@ -14,7 +14,7 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + tutorialSidebar: [{ type: "autogenerated", dirName: "." }], // But you can create a sidebar manually /* diff --git a/src/components/HomepageFeatures/index.js b/src/components/HomepageFeatures/index.js index 78f410ba..d5d56e76 100644 --- a/src/components/HomepageFeatures/index.js +++ b/src/components/HomepageFeatures/index.js @@ -1,11 +1,11 @@ -import React from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; +import React from "react"; +import clsx from "clsx"; +import styles from "./styles.module.css"; const FeatureList = [ { - title: 'Easy to Use', - Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + title: "Easy to Use", + Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default, description: ( <> Docusaurus was designed from the ground up to be easily installed and @@ -14,8 +14,8 @@ const FeatureList = [ ), }, { - title: 'Focus on What Matters', - Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + title: "Focus on What Matters", + Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default, description: ( <> Docusaurus lets you focus on your docs, and we'll do the chores. Go @@ -24,8 +24,8 @@ const FeatureList = [ ), }, { - title: 'Powered by React', - Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + title: "Powered by React", + Svg: require("@site/static/img/undraw_docusaurus_react.svg").default, description: ( <> Extend or customize your website layout by reusing React. Docusaurus can @@ -35,9 +35,9 @@ const FeatureList = [ }, ]; -function Feature({Svg, title, description}) { +function Feature({ Svg, title, description }) { return ( -
{siteConfig.tagline}