Skip to content

Commit

Permalink
Add prettier and format code
Browse files Browse the repository at this point in the history
  • Loading branch information
nop33 committed Mar 22, 2022
1 parent 2946c45 commit 250f558
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 91 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
8 changes: 5 additions & 3 deletions docs/full-node/Full-Node-More.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
![full-node-api-key-auth0](media/full-node-api-key-auth0.png)
![full-node-api-key-auth0](media/full-node-api-key-auth0.png)

2. Fill in the value box with your key and click the authorize button:
![full-node-api-key-auth1](media/full-node-api-key-auth1.png)
![full-node-api-key-auth1](media/full-node-api-key-auth1.png)

Now you could use Swagger UI as if there is no API key.

Expand All @@ -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`
32 changes: 16 additions & 16 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/tutorial-basics/create-a-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial-basics/create-a-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-extras/manage-docs-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
type: "docsVersionDropdown",
},
// highlight-end
],
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial-extras/translate-your-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
};
```
Expand Down Expand Up @@ -60,7 +60,7 @@ module.exports = {
items: [
// highlight-start
{
type: 'localeDropdown',
type: "localeDropdown",
},
// highlight-end
],
Expand Down
79 changes: 40 additions & 39 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -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"),
},
}),
],
Expand All @@ -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",
},
],
},
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -33,5 +34,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "2.6.0"
}
}
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*
Expand Down
22 changes: 11 additions & 11 deletions src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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&apos;ll do the chores. Go
Expand All @@ -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
Expand All @@ -35,9 +35,9 @@ const FeatureList = [
},
];

function Feature({Svg, title, description}) {
function Feature({ Svg, title, description }) {
return (
<div className={clsx('col col--4')}>
<div className={clsx("col col--4")}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
Expand Down
Loading

0 comments on commit 250f558

Please sign in to comment.