Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zubairzia0/dcrdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmzz committed Dec 21, 2019
2 parents 80449b2 + bd9af88 commit 7834406
Show file tree
Hide file tree
Showing 96 changed files with 1,163 additions and 1,424 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Docker Build
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build -t decred/dcrdocs:$(date +%s) .

23 changes: 23 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and Test
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
run: mkdocs build --clean --strict -f mkdocs.yml -d site

7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Build image
FROM python:3.7.3
FROM python:3.7

LABEL description="dcrdocs build"
LABEL version="1.0"
LABEL maintainer "holdstockjamie@gmail.com"
LABEL maintainer "jholdstock@decred.org"

USER root
WORKDIR /root
Expand All @@ -16,11 +16,11 @@ RUN pip install mkdocs && \
RUN ./bin/build_docs.sh

# Serve image (stable nginx version)
FROM nginx:1.16.0
FROM nginx:1.16

LABEL description="dcrdocs serve"
LABEL version="1.0"
LABEL maintainer "holdstockjamie@gmail.com"
LABEL maintainer "jholdstock@decred.org"

COPY conf/nginx.conf /etc/nginx/conf.d/default.conf

Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dcrdocs

[![Build Status](https://travis-ci.org/decred/dcrdocs.png?branch=master)](https://travis-ci.org/decred/dcrdocs)
[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
[![Build Status](https://github.com/decred/dcrdocs/workflows/Build%20and%20Test/badge.svg)](https://github.com/decred/dcrdocs/actions)
[![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)

`dcrdocs` is source code for the [Decred project documentation](https://docs.decred.org).

Expand Down Expand Up @@ -42,6 +42,7 @@ INFO - Cleaning site directory
[I 160402 15:50:43 handlers:58] Start watching changes
[I 160402 15:50:43 handlers:60] Start detecting changes
```

If you are using Windows, you may need to inform python to search sys.path for the mkdocs module:

```bash
Expand All @@ -52,6 +53,7 @@ INFO - Cleaning site directory
[I 190207 18:05:35 handlers:59] Start watching changes
[I 190207 18:05:35 handlers:61] Start detecting changes
```

Open up <http://127.0.0.1:8000> in your browser, and you will see the documentation home page being displayed. The dev-server also supports auto-reloading, and will rebuild your documentation whenever anything in the configuration file or the documentation directory changes.

## Deploying
Expand Down Expand Up @@ -88,21 +90,23 @@ $ docker run -d --rm -p <local port>:80 decred/dcrdocs:latest
- `wallets/cli/dcrd-and-dcrwallet-cli-arguments.md`
- `wallets/cli/dcrctl-rpc-commands.md`
- `wallets/cli/cli-installation.md`
- `advanced/solo-proof-of-stake-voting.md`
- `advanced/verifying-binaries.md`

#### politeiavoter releases

- `advanced/solo-proof-of-stake-voting.md`

#### Decrediton releases

- `wallets/decrediton/decrediton-setup.md`
- `wallets/decrediton/using-decrediton.md`
- `wallets/decrediton/decrediton-troubleshooting.md`

#### gominer release

- `mining/proof-of-work/pool-mining/gominer.md`

#### Testnet reset

- `advanced/using-testnet.md`


## Getting help

Expand Down
16 changes: 15 additions & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ map $sent_http_content_type $expires {
text/html epoch;
text/css max;
application/javascript max;
~font/ max;
~image/ max;
~video/ max;
}

server {
listen 80;
server_name localhost;

charset utf-8;
server_tokens off;

#Security Headers
Expand All @@ -35,7 +38,7 @@ server {
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss image/svg+xml text/javascript;

rewrite ^/governance/governance/?$ $scheme://$http_host/governance/introduction-to-decred-governance permanent;
rewrite ^/governance/politeia/?$ $scheme://$http_host/governance/politeia/politeia permanent;
Expand Down Expand Up @@ -70,4 +73,15 @@ server {
rewrite ^/proof-of-work/proof-of-work/?$ $scheme://$http_host/proof-of-work/overview permanent;
rewrite ^/governance/introduction-to-decred-governance/?$ $scheme://$http_host/governance/overview permanent;
rewrite ^/contributing/contributing-to-decred/?$ $scheme://$http_host/contributing/overview permanent;
rewrite ^/advanced/address-details/?$ https://devdocs.decred.org/developer-guides/addresses permanent;
rewrite ^/advanced/blockchain-parameters/?$ https://devdocs.decred.org/developer-guides/blockchain-parameters permanent;
rewrite ^/advanced/using-testnet/?$ https://devdocs.decred.org/environments/testnet permanent;
rewrite ^/advanced/transaction-details/?$ https://devdocs.decred.org/developer-guides/transactions/transactions permanent;
rewrite ^/advanced/simnet/?$ https://devdocs.decred.org/environments/simnet permanent;
rewrite ^/advanced/block-header-specifications/?$ https://devdocs.decred.org/developer-guides/block-header-specifications permanent;
rewrite ^/research/transaction-extensions/?$ https://devdocs.decred.org/developer-guides/transactions/transaction-extensions/ permanent;
rewrite ^/contributing/using-github/?$ https://devdocs.decred.org/contributing/contributor-guidelines/ permanent;
rewrite ^/contributing/source-code-contributions/?$ https://devdocs.decred.org/contributing/contributor-guidelines/ permanent;
}


30 changes: 0 additions & 30 deletions docs/advanced/address-details.md

This file was deleted.

45 changes: 45 additions & 0 deletions docs/advanced/atomic-swap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Atomic Swaps

## Overview

An Atomic Swap is a smart contract technology which makes possible to exchange coins from two different blockchains without having to trust any third party, for example a centralized exchange.

Atomic swaps involve each party paying into a contract transaction, one contract for each blockchain. The contracts contain an output that is spendable by either party, but the rules required for redemption are different for each party involved.

One party (called counterparty 1 or the initiator) generates a secret and pays the intended trade amount into a contract transaction. The contract output can be redeemed by the second party (called counterparty 2 or the participant) as long as the secret is known. If a period of time (typically 48 hours) expires after the contract transaction has been mined but has not been redeemed by the participant, the contract output can be refunded back to the initiator's wallet.


## Prerequisites

In order to perform an on-chain atomic swap between 2 cryptocurrencies, there are several prerequisites. Both chains must support:

* Branched transaction scripts
* The same hash algorithm in both chains’ transaction scripts
* Signature checks in transaction scripts
* CheckLockTimeVerify or CheckSequenceVerify (“CLTV” and “CSV” for short) in transaction scripts

The hash function in the scripting language is different from the function used for mining. For example, Decred supports blake256, sha256, ripemd160, and sha1.
The CLTV and the CSV is for performing a timelock.


## Decred-compatible cross-chain atomic swapping

The list of compatible currencies can be seen in the [GitHub repo](https://github.com/decred/atomicswap)


## Use cases

On-chain atomic swaps are not useful in all cases where users want to perform an exchange. This process is well-suited to larger trades that do not require a particularly low latency or high frequency. Since the process involves on-chain transactions, the speed of the process is bound by the mining of blocks, which can take roughly an hour in a worst-case scenario with Bitcoin. Additionally, users must pay transaction fees for both the swap transaction and the redeem transaction on each chain, which can have a non-trivial cost with Bitcoin.


## Privacy

Since these swaps are on-chain, there are some privacy implications that users should be aware of. The swap transactions on each chain include the same hashed value, meaning that anyone doing passive surveillance of the corresponding blockchains can link the coins on one side of the swap to the coins on the other side. This is a different threat model than typical centralized exchanges, where the exchange is required by nation state regulations to retain records of user identities and activity. Instead of having to request data from an exchange, interested parties can follow the coins from one chain to the other. However, despite the ease of determining provenance of the coins across chains, there is no associated identity data available on the counterparties.


## Further Information

For more technical information about Atomic Swaps, visit Decred's atomicswap [Github repo](https://github.com/decred/atomicswap).
You can also read about Atomic Swaps on [Decred's blog](https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps/).


Loading

0 comments on commit 7834406

Please sign in to comment.