Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Create a "Testing Applications" subsection in devel-examples #453

Merged
merged 2 commits into from Jun 14, 2014

Conversation

Projects
None yet
2 participants
Contributor

saivann commented Jun 13, 2014

Live previews: (Merged)

This pull request mostly re-uses existing (great) regtest / testnet texts and moves them into a dedicated subsection for higher visibility and so anyone can easily refer & link to them.

Since they are more likely to be referred often from devel-examples and not from devel-guide, I've also moved the "Bitcoin Core setup instructions", and applied a consistent introduction for each page (this also lets us avoid repeating some of this information in "Transaction" examples).

I also needed to fix one regex and some code blocks syntax to prevent autocrossref.rb from inserting links in code blocks (it was replacing "regest" in some of them).

Create a "Testing Applications" subsection in devel-examples
Move existing "regtest / testnet" texts to the new subsection and link to it
Move Bitcoin Core setup instructions in devel-examples
Add a consistent introduction for devel-(guide/ref/examples)
Fix autocrossref.rb to not add links inside {% highlight %} code blocks

@harding harding commented on the diff Jun 13, 2014

_includes/example_testing.md
@@ -0,0 +1,91 @@
+## Testing Applications
@harding

harding Jun 13, 2014

Contributor

I'm wondering if there's a way to have all three documents use the same h2 sections (or almost the same). What do you think about changing this to an h3 under an h2 titled "Bitcoin Core", and then changing the Bitcoin Core APIs h2 in devref to also be "Bitcoin Core"? (At some point we might even add a Bitcoin Core h2 to the devguide.)

@saivann

saivann Jun 13, 2014

Contributor

It is true that these examples are specific to Bitcoin Core, but are you aware of other implementations offering similar testing tools? I actually like the idea of providing a "Testing applications" prominent link because we really want people to experiment there and link to it. So I'm afraid it would be "buried" if we were to move it under "Bitcoin Core".

@saivann

saivann Jun 13, 2014

Contributor

@harding In case you like the idea, I also imagined this subsection could provide examples and links to more testing tools over time (e.g. Gavin's payment request generator - examples and link to source code).

@harding

harding Jun 13, 2014

Contributor

I think it isn't that important---one of the things I like about the way Kramdown creates its automatic head anchors is that they're tied to the text, not the header depth. That means we can always rearrange sections and subsections later. I say we try it your way and see how we feel about it in a few months.

@saivann

saivann Jun 13, 2014

Contributor

@harding Agreed on re-accessing where this should be located later. I was (maybe wrongly) assuming regtest / testnet will be used often (not just from the Transaction examples). Anyway I think the important part is to have these instructions easily "findable" and "linkable". I'm not sure about having the same "Bitcoin Core" subsection in devel-[guide/ref/examples] though, as it seemed good to me to avoid duplicating content, and mixing examples / references / guide content altogether.

Contributor

harding commented Jun 13, 2014

I notice that you use <!--[-->`term`<!--]--> a lot.  
Did you know that you can also use your more elegant noref here?
E.g. `term`<!--noref-->
Contributor

saivann commented Jun 13, 2014

@harding Right! But I would need to define regtest in _autocrossref.yaml, so I appreciated your fallback method better. But any of these are fine to me :)

@harding harding commented on an outdated diff Jun 13, 2014

_includes/example_transactions.md
-Generate 101 blocks using a special version of the `setgenerate` RPC
-which is only available in regtest mode. This takes about 30 seconds on
-a generic PC. Because this is a new block chain using Bitcoin's default
-rules, the first 210,000 blocks pay a block reward of 50 bitcoins.
-However, a block must have 100 confirmations before that reward can be
-spent, so we generate 101 blocks to get access to the coinbase
-transaction from block #1.
-
-{% highlight bash %}
-bitcoin-cli -regtest getbalance
-50.00000000
-{% endhighlight %}
-
-Verify that we now have 50 bitcoins available to spend.
+In order to use this tutorial, you will need to setup [Bitcoin Core][core executable]
+and create a [regression test mode][] environment.
@harding

harding Jun 13, 2014

Contributor

Should probably mention that they need to do everything in the setup including maturing the first coinbase. For example: ...and create a regression test mode environment with 50 BTC in your test wallet.

@harding harding commented on an outdated diff Jun 13, 2014

_includes/guide_intro.md
-* `bitcoind` is more useful for programming: it provides a full peer
- which you can interact with through RPCs to port 8332 (or 18332
- for testnet).
-
-* `bitcoin-cli` allows you to send RPC commands to `bitcoind` from the
- command line. For example, `bitcoin-cli help`
-
-All three programs get settings from `bitcoin.conf` in the `Bitcoin`
-application directiory:
-
-* Windows: `%APPDATA%\Bitcoin\`
-
-* OSX: `$HOME/Library/Application Support/Bitcoin/`
-
-* Linux: `$HOME/.bitcoin/`
+The Developer Guide aims to provide the explanations you need to understand
@harding

harding Jun 13, 2014

Contributor

"Explanations" sounds worse to my ear than the original "information", possibly because information is neutral but explanation is often used in modern English to mean "justification of wrongdoing."

@harding harding commented on an outdated diff Jun 13, 2014

_includes/ref_intro.md
@@ -0,0 +1,19 @@
+{% autocrossref %}
+
+The Developer Reference aims to provide specifications and APIs information
@harding

harding Jun 13, 2014

Contributor

API should be singular (adjectives in English are almost always singular).

Contributor

harding commented Jun 13, 2014

Re: noref: actually, we changed it to ignore everything except whitespace, so even this should work without any additional definitions:

`regtestmode1234(*&^%/`_-+=!<!--noref-->
Contributor

saivann commented Jun 13, 2014

@harding Thanks! I updated the pull req and live preview with your feedback.

Re: noref, that's strange, I had issues using it previously but for some reason, everything works fine now as you were suggesting, thanks!

In the absence of critical feedback, this pull request will be merged on June 14th.

Contributor

harding commented Jun 14, 2014

@saivann LGTM. Thanks!

saivann added a commit that referenced this pull request Jun 14, 2014

Merge pull request #453 from bitcoin/develdocstesting
Create a "Testing Applications" subsection in devel-examples

@saivann saivann merged commit 5f2d32d into master Jun 14, 2014

@saivann saivann deleted the develdocstesting branch Jun 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment