Skip to content

Commit 250f558

Browse files
committed
Add prettier and format code
1 parent 2946c45 commit 250f558

File tree

13 files changed

+124
-91
lines changed

13 files changed

+124
-91
lines changed

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
33
};

docs/full-node/Full-Node-More.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ It's a good practice to use API key to limit the access to your full node's rest
77
### API Key Setup
88

99
Please add the following to your `user.conf` by replacing the zeros with your own key (>= 32 characters).
10+
1011
```
1112
alephium.api.api-key = "0000000000000000000000000000000000000000000000000000000000000000"
1213
```
14+
1315
Restart your full node to make this take effect.
1416

1517
#### 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`
1921
### Use API Key
2022

2123
1. Click on the `Authorize` button on the top right of your Swagger UI:
22-
![full-node-api-key-auth0](media/full-node-api-key-auth0.png)
24+
![full-node-api-key-auth0](media/full-node-api-key-auth0.png)
2325

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

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

@@ -33,4 +35,4 @@ To fix the problem:
3335

3436
1. Delete the folder .alephium `rm .alephium`
3537

36-
2. Restart the node and wait for synchronization `java -jar alephium-1.2.6.jar`
38+
2. Restart the node and wait for synchronization `java -jar alephium-1.2.6.jar`

docs/intro.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ This wiki contains the documentation of [Alephium](https://github.com/alephium/a
1010

1111
The protocol's innovations extend battle-tested ideas from [Bitcoin](https://bitcoin.org/bitcoin.pdf) and [Ethereum](https://ethereum.org/en/whitepaper/):
1212

13-
* BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + [algorithm paper](https://github.com/alephium/research/blob/master/alephium.pdf))
14-
* The first sharding algorithm that supports `single-step cross-shard transactions`, offering the same user experience as single chain
15-
* Simple and elegant `PoW based sharding`, does not rely on beacon chain
16-
* `Stateful UTXO model` combines the advantages of both eUTXO model and account model (see code, wiki to come)
17-
* Tokens are first-class citizens and UTXO-based, which are `owned by users` directly instead of contracts
18-
* Offer the same expressiveness as `account model`. DApps can be easily built on top of it with better security
19-
* Support `multiple participants` in a single smart contract transaction. Multiple calls can be packed into a single transaction too.
20-
* Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come)
21-
* Less IO intensive
22-
* Flash loan is not available by design
23-
* Eliminate many attack vectors of EVM, including unlimited authorization, double dip issue, reentrancy attack, etc
24-
* UTXO style `fine-grained execution model` reduces risk-free arbitrage
25-
* `Front-running mitigation` through random execution of transactions (see code, wiki to come)
26-
* PoLW algorithm reduces the energy consumption of PoW in the long term ([research paper](https://github.com/alephium/research/blob/master/polw.pdf))
27-
* Adaptive rewards based on hashrate and timestamp are designed and implemented
28-
* Internal mining cost through burning will be added when hashrate and energy consumption is significantly high
13+
- BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + [algorithm paper](https://github.com/alephium/research/blob/master/alephium.pdf))
14+
- The first sharding algorithm that supports `single-step cross-shard transactions`, offering the same user experience as single chain
15+
- Simple and elegant `PoW based sharding`, does not rely on beacon chain
16+
- `Stateful UTXO model` combines the advantages of both eUTXO model and account model (see code, wiki to come)
17+
- Tokens are first-class citizens and UTXO-based, which are `owned by users` directly instead of contracts
18+
- Offer the same expressiveness as `account model`. DApps can be easily built on top of it with better security
19+
- Support `multiple participants` in a single smart contract transaction. Multiple calls can be packed into a single transaction too.
20+
- Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come)
21+
- Less IO intensive
22+
- Flash loan is not available by design
23+
- Eliminate many attack vectors of EVM, including unlimited authorization, double dip issue, reentrancy attack, etc
24+
- UTXO style `fine-grained execution model` reduces risk-free arbitrage
25+
- `Front-running mitigation` through random execution of transactions (see code, wiki to come)
26+
- PoLW algorithm reduces the energy consumption of PoW in the long term ([research paper](https://github.com/alephium/research/blob/master/polw.pdf))
27+
- Adaptive rewards based on hashrate and timestamp are designed and implemented
28+
- Internal mining cost through burning will be added when hashrate and energy consumption is significantly high

docs/tutorial-basics/create-a-document.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Add metadata to customize the sidebar label and position:
3030

3131
```md title="docs/hello.md" {1-4}
3232
---
33-
sidebar_label: 'Hi!'
33+
sidebar_label: "Hi!"
3434
sidebar_position: 3
3535
---
3636

docs/tutorial-basics/create-a-page.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Add **Markdown or React** files to `src/pages` to create a **standalone page**:
1515
Create a file at `src/pages/my-react-page.js`:
1616

1717
```jsx title="src/pages/my-react-page.js"
18-
import React from 'react';
19-
import Layout from '@theme/Layout';
18+
import React from "react";
19+
import Layout from "@theme/Layout";
2020

2121
export default function MyReactPage() {
2222
return (

docs/tutorial-extras/manage-docs-versions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434
items: [
3535
// highlight-start
3636
{
37-
type: 'docsVersionDropdown',
37+
type: "docsVersionDropdown",
3838
},
3939
// highlight-end
4040
],

docs/tutorial-extras/translate-your-site.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Modify `docusaurus.config.js` to add support for the `fr` locale:
1313
```js title="docusaurus.config.js"
1414
module.exports = {
1515
i18n: {
16-
defaultLocale: 'en',
17-
locales: ['en', 'fr'],
16+
defaultLocale: "en",
17+
locales: ["en", "fr"],
1818
},
1919
};
2020
```
@@ -60,7 +60,7 @@ module.exports = {
6060
items: [
6161
// highlight-start
6262
{
63-
type: 'localeDropdown',
63+
type: "localeDropdown",
6464
},
6565
// highlight-end
6666
],

docusaurus.config.js

+40-39
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4-
const lightCodeTheme = require('prism-react-renderer/themes/github');
5-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
4+
const lightCodeTheme = require("prism-react-renderer/themes/github");
5+
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
66

77
/** @type {import('@docusaurus/types').Config} */
88
const config = {
9-
title: 'My Site',
10-
tagline: 'Dinosaurs are cool',
11-
url: 'https://your-docusaurus-test-site.com',
12-
baseUrl: '/',
13-
onBrokenLinks: 'throw',
14-
onBrokenMarkdownLinks: 'warn',
15-
favicon: 'img/favicon.ico',
16-
organizationName: 'facebook', // Usually your GitHub org/user name.
17-
projectName: 'docusaurus', // Usually your repo name.
9+
title: "My Site",
10+
tagline: "Dinosaurs are cool",
11+
url: "https://your-docusaurus-test-site.com",
12+
baseUrl: "/",
13+
onBrokenLinks: "throw",
14+
onBrokenMarkdownLinks: "warn",
15+
favicon: "img/favicon.ico",
16+
organizationName: "facebook", // Usually your GitHub org/user name.
17+
projectName: "docusaurus", // Usually your repo name.
1818

1919
presets: [
2020
[
21-
'classic',
21+
"classic",
2222
/** @type {import('@docusaurus/preset-classic').Options} */
2323
({
2424
docs: {
25-
sidebarPath: require.resolve('./sidebars.js'),
25+
sidebarPath: require.resolve("./sidebars.js"),
2626
// Please change this to your repo.
27-
editUrl: "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
27+
editUrl:
28+
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
2829
},
2930
theme: {
30-
customCss: require.resolve('./src/css/custom.css'),
31+
customCss: require.resolve("./src/css/custom.css"),
3132
},
3233
}),
3334
],
@@ -37,60 +38,60 @@ const config = {
3738
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
3839
({
3940
navbar: {
40-
title: 'My Site',
41+
title: "My Site",
4142
logo: {
42-
alt: 'My Site Logo',
43-
src: 'img/logo.svg',
43+
alt: "My Site Logo",
44+
src: "img/logo.svg",
4445
},
4546
items: [
4647
{
47-
type: 'doc',
48-
docId: 'intro',
49-
position: 'left',
50-
label: 'Tutorial',
48+
type: "doc",
49+
docId: "intro",
50+
position: "left",
51+
label: "Tutorial",
5152
},
5253
{
53-
href: 'https://github.com/facebook/docusaurus',
54-
label: 'GitHub',
55-
position: 'right',
54+
href: "https://github.com/facebook/docusaurus",
55+
label: "GitHub",
56+
position: "right",
5657
},
5758
],
5859
},
5960
footer: {
60-
style: 'dark',
61+
style: "dark",
6162
links: [
6263
{
63-
title: 'Docs',
64+
title: "Docs",
6465
items: [
6566
{
66-
label: 'Tutorial',
67-
to: '/docs/intro',
67+
label: "Tutorial",
68+
to: "/docs/intro",
6869
},
6970
],
7071
},
7172
{
72-
title: 'Community',
73+
title: "Community",
7374
items: [
7475
{
75-
label: 'Stack Overflow',
76-
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
76+
label: "Stack Overflow",
77+
href: "https://stackoverflow.com/questions/tagged/docusaurus",
7778
},
7879
{
79-
label: 'Discord',
80-
href: 'https://discordapp.com/invite/docusaurus',
80+
label: "Discord",
81+
href: "https://discordapp.com/invite/docusaurus",
8182
},
8283
{
83-
label: 'Twitter',
84-
href: 'https://twitter.com/docusaurus',
84+
label: "Twitter",
85+
href: "https://twitter.com/docusaurus",
8586
},
8687
],
8788
},
8889
{
89-
title: 'More',
90+
title: "More",
9091
items: [
9192
{
92-
label: 'GitHub',
93-
href: 'https://github.com/facebook/docusaurus',
93+
label: "GitHub",
94+
href: "https://github.com/facebook/docusaurus",
9495
},
9596
],
9697
},

package-lock.json

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"clear": "docusaurus clear",
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
14-
"write-heading-ids": "docusaurus write-heading-ids"
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""
1516
},
1617
"dependencies": {
1718
"@docusaurus/core": "2.0.0-beta.17",
@@ -33,5 +34,8 @@
3334
"last 1 firefox version",
3435
"last 1 safari version"
3536
]
37+
},
38+
"devDependencies": {
39+
"prettier": "2.6.0"
3640
}
3741
}

sidebars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1515
const sidebars = {
1616
// By default, Docusaurus generates a sidebar from the docs folder structure
17-
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
17+
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],
1818

1919
// But you can create a sidebar manually
2020
/*

src/components/HomepageFeatures/index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react';
2-
import clsx from 'clsx';
3-
import styles from './styles.module.css';
1+
import React from "react";
2+
import clsx from "clsx";
3+
import styles from "./styles.module.css";
44

55
const FeatureList = [
66
{
7-
title: 'Easy to Use',
8-
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
7+
title: "Easy to Use",
8+
Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default,
99
description: (
1010
<>
1111
Docusaurus was designed from the ground up to be easily installed and
@@ -14,8 +14,8 @@ const FeatureList = [
1414
),
1515
},
1616
{
17-
title: 'Focus on What Matters',
18-
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
17+
title: "Focus on What Matters",
18+
Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default,
1919
description: (
2020
<>
2121
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
@@ -24,8 +24,8 @@ const FeatureList = [
2424
),
2525
},
2626
{
27-
title: 'Powered by React',
28-
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
27+
title: "Powered by React",
28+
Svg: require("@site/static/img/undraw_docusaurus_react.svg").default,
2929
description: (
3030
<>
3131
Extend or customize your website layout by reusing React. Docusaurus can
@@ -35,9 +35,9 @@ const FeatureList = [
3535
},
3636
];
3737

38-
function Feature({Svg, title, description}) {
38+
function Feature({ Svg, title, description }) {
3939
return (
40-
<div className={clsx('col col--4')}>
40+
<div className={clsx("col col--4")}>
4141
<div className="text--center">
4242
<Svg className={styles.featureSvg} role="img" />
4343
</div>

0 commit comments

Comments
 (0)