From f6a68b5857a13b98948aa4837d537c7755a8a3d6 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 14 Mar 2018 13:34:59 -0400 Subject: [PATCH] [Content] Add devnet details (#40) * content - Add devnet details - Description in examples section - Glossary entry and updated testnet/regtest * content - Devnet P2P - Add to start string and spork key tables Closes #36 --- _data/glossary/en/devnet.yaml | 32 +++++++++++ _data/glossary/en/regression-test-mode.yaml | 1 + _data/glossary/en/testnet.yaml | 1 + _includes/devdoc/example_intro.md | 11 +++- _includes/devdoc/example_testing.md | 60 +++++++++++++++++++++ _includes/devdoc/ref_p2p_networking.md | 4 ++ 6 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 _data/glossary/en/devnet.yaml diff --git a/_data/glossary/en/devnet.yaml b/_data/glossary/en/devnet.yaml new file mode 100644 index 00000000..63c42fd1 --- /dev/null +++ b/_data/glossary/en/devnet.yaml @@ -0,0 +1,32 @@ +--- +# This file is licensed under the MIT License (MIT) available on +# http://opensource.org/licenses/MIT. + +required: + #-------------40 characters-------------# + title_max_40_characters_no_formatting: Devnet, Development Network + + summary_max_255_characters_no_formatting: > + A development environment in which developers can obtain and + spend duffs that have no real-world value on a network that + is very similar to the Dash mainnet. Multiple independent devnets can + coexist without interference. Devnets can be either public or private. + + synonyms_shown_in_glossary_capitalize_first_letter: + - Devnet + +optional: + synonyms_and_pluralizations_not_shown_in_glossary: + - devnets + - devnets mode + - devnets modes + - development network + + not_to_be_confused_with_capitalize_first_letter: + - Regtest (a local testing environment where developers can control block generation) + - Testnet (a global testing environment which mostly mimics mainnet) + + links_html_or_markdown_style_capitalize_first_letter: + - "[Devnet mode](/en/developer-examples#devnet-mode) --- Developer Examples" + +--- diff --git a/_data/glossary/en/regression-test-mode.yaml b/_data/glossary/en/regression-test-mode.yaml index 90105b35..5ef8f327 100644 --- a/_data/glossary/en/regression-test-mode.yaml +++ b/_data/glossary/en/regression-test-mode.yaml @@ -23,6 +23,7 @@ optional: - regtest modes not_to_be_confused_with_capitalize_first_letter: + - Devnet (a public or private development network which mimics mainnet) - Testnet (a global testing environment which mostly mimics mainnet) links_html_or_markdown_style_capitalize_first_letter: diff --git a/_data/glossary/en/testnet.yaml b/_data/glossary/en/testnet.yaml index 440388f3..8f438c86 100644 --- a/_data/glossary/en/testnet.yaml +++ b/_data/glossary/en/testnet.yaml @@ -22,6 +22,7 @@ optional: - testing network not_to_be_confused_with_capitalize_first_letter: + - Devnet (a public or private development network which mimics mainnet) - Regtest (a local testing environment where developers can control block generation) links_html_or_markdown_style_capitalize_first_letter: diff --git a/_includes/devdoc/example_intro.md b/_includes/devdoc/example_intro.md index 68616452..1cbd739b 100644 --- a/_includes/devdoc/example_intro.md +++ b/_includes/devdoc/example_intro.md @@ -26,6 +26,13 @@ Once installed, you'll have access to three programs: `dashd`, * `dash-cli` allows you to send RPC commands to `dashd` from the command line. For example, `dash-cli help` +{% endautocrossref %} + +### Configuration file + + +{% autocrossref %} + All three programs get settings from `dash.conf` in the `DashCore` application directory: @@ -53,8 +60,8 @@ directory: chmod 0600 dash.conf ~~~ -For development, it's safer and cheaper to use Dash's test network (testnet) -or regression test mode (regtest) described below. +For development, it's safer and cheaper to use Dash's test network (testnet), +regression test mode (regtest), or a develper network (devnet) described below. Questions about Dash use are best sent to the [Dash forum][forum tech support] and [Discord channels][Discord channels]. Errors or suggestions related to diff --git a/_includes/devdoc/example_testing.md b/_includes/devdoc/example_testing.md index 1184c7ea..b0b18465 100644 --- a/_includes/devdoc/example_testing.md +++ b/_includes/devdoc/example_testing.md @@ -109,3 +109,63 @@ configuration directory locations on various operating systems. Always back up mainnet wallets before performing dangerous operations such as deleting.) {% endautocrossref %} + +### Devnet Mode +{% include helpers/subhead-links.md %} + +{% autocrossref %} + +Developer networks (devnets) have some aspects of testnet and some aspects of +regtest. Unlike testnet, multiple independent devnets can be created and coexist +without interference. Each one is identified by a name which is hardened into a +"devnet genesis" block, which is automatically positioned at height 1. Validation +rules will ensure that a node from `devnet=test1` never be able to +accept blocks from `devnet=test2`. This is done by checking the +expected devnet genesis block. + +The genesis block of the devnet is the same as the one from regtest. This +starts the devnet with a very low difficulty, allowing quick generation of a +sufficient balance to create a masternode. + +The devnet name is put into the sub-version of the `version` message. +If a node connects to the wrong network, it will immediately be disconnected. + +To use devnet, use the argument `-devnet=` with `dash-cli`, +`dashd`or `dash-qt` or add `devnet=` to your `dash.conf` file as +[described earlier](#configuration-file). + +Devnets must be assigned both `-port` and `-rpcport` unless they are not +listening (`-listen=0`). It is possible to run a devnet on a private (RFC1918) +network by using the `-allowprivatenet=1` argument. + +{% endautocrossref %} + +Example devnet start command: + +{% highlight bash %} +> dashd -devnet=mydevnet -rpcport=18998 -port=18999 -daemon +Dash Core server starting +{% endhighlight %} + +{% autocrossref %} + +You can now use Dash Core RPCs prefixed with `dash-cli -devnet=`. + +Devnet wallets and block chain state (chainstate) are saved in the `devnet-` +subdirectory of the Dash Core configuration directory. You can safely +delete the `devnet-` subdirectory and restart Dash Core to +start a new devnet. (See the [Developer Examples Introduction][devexamples] for default +configuration directory locations on various operating systems. Always back up +mainnet wallets before performing dangerous operations such as deleting.) + +Eventually, there may be many public and/or private devnets that vary in size +and function. Providing the correct devnet name and the seed node of the network +will be all that is required to join. + +An old devnet can be easily dropped and a new one started just by destroying all +nodes and recreating them with a new devnet name. This works best in combination +with an automated deployment using something like Ansible and Terraform. The +[Dash Cluster Ansible](https://github.com/dashpay/dash-cluster-ansible) provides +a way to do this (currently a work-in-progress at an early development stage). + +{% endautocrossref %} diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 092f83dd..3c3626e0 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -7,6 +7,8 @@ http://opensource.org/licenses/MIT. ## P2P Network {% include helpers/subhead-links.md %} + + {% autocrossref %} This section describes the Dash P2P network protocol (but it is [not a @@ -37,6 +39,7 @@ The following constants and defaults are taken from Dash Core's | Mainnet | 9999 | 0xBD6B0CBF | 0xBF0C6BBD | 0x1e0ffff0 | Testnet | 19999 | 0xFFCAE2CE | 0xCEE2CAFF | 0x1e0ffff0 | Regtest | 19994 | 0xDCB7C1FC | 0xFCC1B7DC | 0x207fffff +| Devnet | User-defined | 0xFFCAE2CE | 0xCEE2CAFF | 0x207fffff Note: the testnet start string and nBits above are for testnet3. @@ -1339,6 +1342,7 @@ Core can be found in `CPubKey::RecoverCompact`). The hash is a double SHA-256 ha | Mainnet | 04549ac134f694c0243f503e8c8a9a986f5de6610049c40b07816809b0d1
d06a21b07be27b9bb555931773f62ba6cf35a25fd52f694d4e1106ccd237
a7bb899fdd | | Testnet3 | 046f78dcf911fbd61910136f7f0f8d90578f68d0b3ac973b5040fb7afb50
1b5939f39b108b0569dca71488f5bbf498d92e4d1194f6f941307ffd95f7
5e76869f0e | | RegTest | Undefined | +| Devnets | 046f78dcf911fbd61910136f7f0f8d90578f68d0b3ac973b5040fb7afb50
1b5939f39b108b0569dca71488f5bbf498d92e4d1194f6f941307ffd95f7
5e76869f0e | The following annotated hexdump shows a `spork` message.