Skip to content

Commit

Permalink
fix wiki lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ukane-philemon authored and chappjc committed Aug 22, 2022
1 parent 4e2100d commit 5e78c84
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 87 deletions.
2 changes: 1 addition & 1 deletion docs/release-notes/release-notes-0.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ reality of unreliable consumer networks and other such technical issues.
In this release, there are two primary inaction violations that adjust a users
score: (1) failure to respond with a preimage for an order when the epoch for
that order is closed (preimage miss), and (2) swap negotiation resulting in
match revocation as described in the [previous section](#revoked_matches).
match revocation as described in the [previous section](#revoked-matches).

The score threshold at which an account becomes suspended (ban score) is an
operator set variable, but the default is 20.
Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/release-notes-0.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ most notable fixes are:

166 commits, 287 files changed, 40,296 insertions(+), 18,072 deletions(-)

https://github.com/decred/dcrdex/compare/4517832...release-v0.2
<https://github.com/decred/dcrdex/compare/4517832...release-v0.2>

9 contributors

Expand Down
4 changes: 2 additions & 2 deletions docs/release-notes/release-notes-0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ and server/cmd/dcrdex/sample-dcrdex.conf
- When connecting to a Bitcoin Core wallet, check the wallet type to prevent use
of "descriptor" wallets, which do not support the full set of RPCs required by
the DEX client. See
https://bitcoincore.org/en/releases/0.21.0/#experimental-descriptor-wallets
<https://bitcoincore.org/en/releases/0.21.0/#experimental-descriptor-wallets>
for more information on descriptor wallets.
([256cd69](https://github.com/decred/dcrdex/commit/256cd69a73ccaa2af0a31757a5d62e4aab57eddd))
- If a user has active trades, they must be settled by a wallet that can
Expand Down Expand Up @@ -603,7 +603,7 @@ The most notable fixes are:

186 commits, 330 files changed, 50,332 insertions(+), 23,221 deletions(-)

https://github.com/decred/dcrdex/compare/ba59397...release-v0.4
<https://github.com/decred/dcrdex/compare/ba59397...release-v0.4>

12 contributors

Expand Down
29 changes: 15 additions & 14 deletions docs/wiki/Client-Installation-and-Configuration.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Client Installation and Configuration

## Client Quick Start Installation

The DEX client can be installed in one of the following ways:

1. Download the the standalone DEX client for your operating system for the
1. Download the standalone DEX client for your operating system for the
[latest release on GitHub](https://github.com/decred/dcrdex/releases).
2. [Use Decrediton](https://docs.decred.org/wallets/decrediton/decrediton-setup/),
the official graphical Decred wallet, which integrates the DEX client, and go
Expand Down Expand Up @@ -102,7 +104,7 @@ wallet.
standalone client, open a command prompt in the folder containing the
pre-compiled dexc client files and run `./dexc` (`dexc.exe` on Windows).

2. In your web browser, navigate to http://localhost:5758. Skip this step if
2. In your web browser, navigate to <http://localhost:5758>. Skip this step if
using Decrediton.

<img src="images/omnibar-client.png" width="320">
Expand Down Expand Up @@ -151,7 +153,7 @@ wallet.
like to the wallet since *only* the amount required for the fee will be spent
in the next step. The remaining balance will be available for trading or may
be withdrawn later. In the case of the screenshot above, the form indicates
that for the client to make a fee payment transaction for the amount 0.001
that for the client to make a fee payment transaction for the amount of 0.001
BTC, the wallet should be funded with "at least 0.00100823 BTC to also cover
network fees". For example, you can send yourself 5 BTC and only the
required amount will be spent on the registration fee, with the remainder in
Expand Down Expand Up @@ -205,14 +207,13 @@ wallet.

Bundle the CSS and JavaScript with Webpack:

```
npm clean-install
npm run build
```sh
npm clean-install && npm run build
```

**Build and run the client** from *client/cmd/dexc*.

```
```sh
go build
./dexc
```
Expand All @@ -221,25 +222,25 @@ Connect to the client from your browser at `localhost:5758`.

While `dexc` may be run from within the git workspace as described above, the
`dexc` binary executable generated with `go build` and the entire `site` folder
may be copied into a different folder as long as `site` is in the same directory
can be copied into a different folder as long as `site` is in the same directory
as `dexc` (e.g. `/opt/dcrdex/dexc` and `/opt/dcrdex/site`).

### Docker

**Build the docker image**
#### Build the docker image

```
```sh
docker build -t user/dcrdex -f client/Dockerfile .
```

**Create docker volume**
#### Create docker volume

```
```sh
docker volume create --name=dcrdex_data
```

**Run image**
#### Run image

```
```sh
docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/root/.dexc user/dcrdex
```
10 changes: 5 additions & 5 deletions docs/wiki/Client-applications.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Client Applications and the Core Package
# Client Applications and the Core Package

### Applications
## Applications

There are two client applications.

#### dexc
### dexc

The **browser-based GUI** (a.k.a. "the app") offers a familiar exchange
experience in your browser. The app is really just a one-client web server that
Expand All @@ -17,12 +17,12 @@ Most users will only need to use this application.

See the README for instructions on obtaining and starting **dexc**.

#### dexcctl
### dexcctl

The **dexcctl** utility enables trading via CLI. Commands are parsed and
issued to **Core** for execution. **dexcctl** also requires **dexc**.

### Core client Go language package
## Core client Go language package

For developers, the `decred.org/dcrdex/client/core` Go language package provides
the `Core` client type, which offers an intuitive programmer interface, with
Expand Down
8 changes: 5 additions & 3 deletions docs/wiki/Contribution-Guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Contribution Guide

We welcome your contributions to dcrdex.

Development is coordinated via [github issues](/../issues) and the
Expand All @@ -21,15 +23,15 @@ You can access the room at [chat.decred.org](https://chat.decred.org),
- Document all exported symbols. Use full sentences and proper punctuation.
- Justify the creation of exported types/variables/methods/functions. If it can be exported, it probably should be.
- Do not use `make` to allocate 0-capacity slices (e.g. `make([]int, 0)`) unless you have a good reason. It is safe to append to a `nil` slice.
- When declaring a variable with it's zero value, just use `var` and not `:=`. For example, `var x int64` instead of `x := int64(0)`.
- When declaring a variable with its zero value, just use `var` and not `:=`. For example, `var x int64` instead of `x := int64(0)`.
- When defining `error` strings, avoid beginning with a capital letter unless it refers to an exported type or proper noun, and avoid ending with punctuation. There are exceptions, so this is not checked by a linter.

## Get paid

If you are already a Decred contractor, you can charge for your development work
on **dcrdex**. If you are not a Decred contractor, but would like to be, you
on **dcrdex**. If you are not a Decred contractor but would like to be, you
should first
[familiarize yourself with the on-boarding process](https://docs.decred.org/contributing/overview/).
[familiarize yourself with the onboarding process](https://docs.decred.org/contributing/overview/).
**dcrdex** is a great place to get started, but you would be expected to take on
only smaller jobs until you are comfortable navigating the code and have shown
the ability to communicate and follow through.
2 changes: 1 addition & 1 deletion docs/wiki/Getting Started With Fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ A failure may occur while fuzzing for several reasons:
## Other Highlighted Fuzz Flags

- **-fuzztime**:
The total time or number of iterations that the fuzz target will be executed before exiting, specified as a time.Duration (for example, `-fuzztime 1h30s`) or using aspecial syntax Nx to run the fuzz target N times (for example, `-fuzztime 1000x`). The default is to run forever.
The total time or number of iterations that the fuzz target will be executed before exiting, specified as a time.Duration (for example, `-fuzztime 1h30s`) or using a special syntax Nx to run the fuzz target N times (for example, `-fuzztime 1000x`). The default is to run forever.
- **-fuzzminimizetime**: the time or number of iterations that the fuzz target will be executed during each minimization attempt, default 60sec. You can completely disable minimization by setting -fuzzminimizetime 0 when fuzzing.
- **-parallel**: the number of fuzzing processes running at once, default $GOMAXPROCS. Currently, setting -cpu during fuzzing has no effect.
- **-keepfuzzing**: Keep running the fuzz test if a crasher is found. (default false)
Expand Down
24 changes: 12 additions & 12 deletions docs/wiki/Home.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<img src="images/logo_wide_v1.svg" width="250">
# <img src="images/logo_wide_v1.svg" alt="DCRDEX" width="250">

The dcrdex wiki provides documentation for dcrdex users and developers.

Also have a look at the [README](https://github.com/decred/dcrdex/blob/master/README.md) and the [spec](https://github.com/decred/dcrdex/blob/master/spec/README.mediawiki).
Also, have a look at the [README](https://github.com/decred/dcrdex/blob/master/README.md) and the [spec](https://github.com/decred/dcrdex/blob/master/spec/README.mediawiki).

## Usage

Expand All @@ -14,20 +14,20 @@ The following instructions assume that you have already forked **dcrdex**.

1. Initialize your forked wiki on github by navigating to the wiki tab of your forked **dcrdex** repo and clicking the "Create the first page" button. Be sure to "Save page" as well.

<img src="images/wiki-creation.png" width="700">
<img src="images/wiki-creation.png" width="700">

2. In your terminal, navigate to your local **dcrdex** directory and add your remote wiki.

```
git remote add wiki https://github.com/your-username/dcrdex.wiki.git
git push wiki -d master
git subtree push --prefix docs/wiki wiki master
```
```sh
git remote add wiki https://github.com/your-username/dcrdex.wiki.git
git push wiki -d master
git subtree push --prefix docs/wiki wiki master
```

3. Now after committing changes to the files in the docs/wiki folder, you can apply them to your dcrdex wiki and view immediately. Assuming you are in the root directory:
3. Now after committing changes to the files in the docs/wiki folder, you can apply them to your dcrdex wiki and view them immediately. Assuming you are in the root directory:

```
git push wiki $(git subtree split --prefix docs/wiki):master --force
```
```sh
git push wiki $(git subtree split --prefix docs/wiki):master --force
```

4. Make a pull request with your changes to dcrdex. They will make it to the main wiki eventually.
10 changes: 6 additions & 4 deletions docs/wiki/Localization-and-Translation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Localization and Translation

The DEX client supports translations for the browser frontend and the notification messages from the backend.

To add a new locale, the translations must be defined in the following locations:
Expand All @@ -6,13 +8,13 @@ To add a new locale, the translations must be defined in the following locations
2. Notification strings (client/core/locale_ntfn.go)
3. JavaScript strings (client/webserver/site/src/js/locales.js)

If you decide to do the following for a different language, please see https://github.com/decred/dcrdex/wiki/Contribution-Guide for help with the github workflow.
If you decide to do the following for a different language, please see <https://github.com/decred/dcrdex/wiki/Contribution-Guide> for help with the github workflow.

## Step 1 - HTML

The HTML strings involved creating [client/webserver/locales/zh-cn.go](https://github.com/decred/dcrdex/blob/master/client/webserver/locales/zh-cn.go), which contains a `var ZhCN map[string]string` that provides a translation for a string identified by a certain key. The translation is not of the key itself, but of the corresponding English string in the `EnUS` map in https://github.com/decred/dcrdex/blob/master/client/webserver/locales/en-us.go. The name of this file should be a [BCP 47 language tag](https://www.w3.org/International/articles/bcp47/), preferably the "language-region" form.
The HTML strings involved creating [client/webserver/locales/zh-cn.go](https://github.com/decred/dcrdex/blob/master/client/webserver/locales/zh-cn.go), which contains a `var ZhCN map[string]string` that provides a translation for a string identified by a certain key. The translation is not of the key itself, but of the corresponding English string in the `EnUS` map in <https://github.com/decred/dcrdex/blob/master/client/webserver/locales/en-us.go>. The name of this file should be a [BCP 47 language tag](https://www.w3.org/International/articles/bcp47/), preferably the "language-region" form.

The new HTML strings map must then be listed in https://github.com/decred/dcrdex/blob/master/client/webserver/locales/locales.go with an appropriate language tag.
The new HTML strings map must then be listed in <https://github.com/decred/dcrdex/blob/master/client/webserver/locales/locales.go> with an appropriate language tag.

Once the new file is created in **client/webserver/locales** and the new map registered in **client/webserver/locales/locales.go**, it is then necessary to run `go generate` in the **client/webserver/site** folder. This creates the localized HTML template files in the **localized_html** folder.

Expand All @@ -31,4 +33,4 @@ Once the translations are added to **client/core/locale_ntfn.go**, the new map i

The JavaScript strings involved editing [client/webserver/site/src/js/locales.js](https://github.com/decred/dcrdex/blob/master/client/webserver/site/src/js/locales.js) with a new `export const zhCN` object, with strings corresponding to the English text in the `enUS` object at the top of the same file. Finally, the new object is listed in the `const localesMap` at the end of the file.

When testing, remember to rebuild the site assets bundle with `npm ci && npm run build` in the **client/webserver/site** folder.
When testing, remember to rebuild the site assets bundle with `npm ci && npm run build` in the **client/webserver/site** folder.
12 changes: 7 additions & 5 deletions docs/wiki/Native-BTC-Wallet-Recovery-and-Rescanning.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# BTC Wallet Recovery and Rescanning

## Reinitializing the Native BTC Wallet

If the native BTC wallet is corrupted, the dexc.log may have a message containing "connectWallet: wallet not found", such as:
Expand All @@ -10,27 +12,27 @@ In this case, the Wallets page (/wallets) will still show the wallet since it wa

![wallets view](https://user-images.githubusercontent.com/9373513/149597739-06318c29-f6be-4837-bb6f-2055971be8cf.png)

This may be solvable by simply clicking the gears to open the settings box, and then clicking Submit:
This may be solvable by simply clicking the gears to open the settings box, and then click Submit:

![wallet settings](https://user-images.githubusercontent.com/9373513/149597817-abbcbf5f-d05f-4b48-996f-485030d2a74c.png)

The dexc.log should say:

> [INF] CORE: Initializing a built-in btc wallet
The wallet will begin re-synchronizing. This may take several minutes.
The wallet will begin re-synchronizing. This may take several minutes.

If this process results in errors, it may be necessary to go to the folder containing the wallet data and **delete the wallet.db so it may be regenerated** from your application seed. First SHUTDOWN DEX. Next, for mainnet, on Linux, this would be in the folder `~/.dexc/mainnet/assetdb/btc/mainnet/`. There may be a wallet.db file in this folder, which you should rename wallet.db.bak. Now startup and login to DEX. Go to the Wallets page to see wallet status, which should re-synchronize. Check notifications and logs for any errors.

## Rescanning the wallet

There will be a Rescan button added to the Wallets page, but for now you can force the wallet to rescan in one of two ways. First, SHUTDOWN DEX. Then do one of the following:
There will be a Rescan button added to the Wallets page, but for now, you can force the wallet to rescan in one of two ways. First, SHUTDOWN DEX. Then do one of the following:

1. Delete the wallet.db file in the "assetdb/btc" folder as described at the end of the previous section. Start back up and log in. Follow the instructions in [the Reinitializing the Native BTC Wallet section](#reinitializing-the-native-btc-wallet) to reinitialize the wallet and begin a resync.
2. OR (**safest option**) use the `dropwtxmgr` tool on that wallet.db file. See the instructions in https://github.com/btcsuite/btcwallet/blob/master/docs/force_rescans.md. You will build that tool as described there and then run it on DEX's btc wallet.db. For example `dropwtxmgr --db ~/.dexc/mainnet/assetdb/btc/mainnet/wallet.db`. When you start DEX and login again, it will begin to rescan the wallet.
2. OR (**safest option**) use the `dropwtxmgr` tool on that wallet.db file. See the instructions in <https://github.com/btcsuite/btcwallet/blob/master/docs/force_rescans.md>. You will build that tool as described there and then run it on DEX's btc wallet.db. For example `dropwtxmgr --db ~/.dexc/mainnet/assetdb/btc/mainnet/wallet.db`. When you start DEX and login again, it will begin to rescan the wallet.

## Full reinitialize

In addition to reinitializing or rescanning the BTC wallet.db file, you may also remove all of the chain data files to force resynchronization of all blockchain data used by the neutrino service that powers the wallet. To do this, delete all of the files in `~/.dexc/mainnet/assetdb/btc/mainnet/` (for mainnet), including neutrino.db, reg_filter_headers.bin, block_headers.bin, and wallet.db. You may keep peers.json to help with bootstrapping when you restart, but it may be deleted too.

Next, startup DEX and go to the Wallet page. Finally, click the gears icon for the Bitcoin wallet, and click Submit after ensuring it is currently showing the Native wallet option as in the [first section's screenshot](#reinitializing-the-native-btc-wallet).
Next, startup DEX and go to the Wallet page. Finally, click the gears icon for the Bitcoin wallet, and click Submit after ensuring it is currently showing the Native wallet option as in the [first section's screenshot](#reinitializing-the-native-btc-wallet).
8 changes: 5 additions & 3 deletions docs/wiki/Server-Admin.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Server Settings

## Exchange Settings

### Admin HTTP JSON API

See https://github.com/decred/dcrdex/blob/6693bc57283d4cf5b451778091aa1c1b20cb9187/server/admin/server.go#L145
See <https://github.com/decred/dcrdex/blob/6693bc57283d4cf5b451778091aa1c1b20cb9187/server/admin/server.go#L145>

### Markets JSON Settings File

```
```text
{
"markets" (array): Array of market objects.
[
Expand All @@ -30,4 +32,4 @@ See https://github.com/decred/dcrdex/blob/6693bc57283d4cf5b451778091aa1c1b20cb91
},...
}
}
```
```

0 comments on commit 5e78c84

Please sign in to comment.