Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
Fix code block lexing/highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
sampullman committed Mar 21, 2018
1 parent 1cfdee4 commit 49dc864
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 66 deletions.
8 changes: 4 additions & 4 deletions old-docs-for-reference/go-ethereum-wiki.rst/Sending-ether.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ Sending ether
The basic way of sending a simple transaction of ether using the console
is as follows:

.. code:: JavaScript
.. code:: javascript
> eth.sendTransaction({from:sender, to:receiver, value: amount})
Using the built-in JavaScript, you can easily set variables to hold
these values. For example:

.. code:: JavaScript
.. code:: javascript
> var sender = eth.accounts[0];
> var receiver = eth.accounts[1];
> var amount = web3.toWei(0.01, "ether")
Alternatively, you can compose a transaction in a single line with:

.. code:: JavaScript
.. code:: javascript
> eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1], value: web3.toWei(0.05, "ether")})
Please unlock account d1ade25ccd3d550a7eb532ac759cac7be09c2719.
Expand All @@ -32,7 +32,7 @@ The resulting transaction is

If the password was incorrect you will instead receive an error:

.. code:: JavaScript
.. code:: javascript
error: could not unlock sender account
Expand Down
48 changes: 24 additions & 24 deletions source/account-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Once you have the geth client installed, creating an account is merely a case of

Note that you do not have to run the geth client or sync up with the blockchain to use the ``geth account`` command.

.. code-block:: Bash
.. code-block:: bash
$ geth account new
Expand All @@ -61,13 +61,13 @@ Note that you do not have to run the geth client or sync up with the blockchain
For non-interactive use you supply a plaintext password file as argument to the ``--password`` flag. The data in the file consists of the raw bytes of the password optionally followed by a single newline.

.. code-block:: Bash
.. code-block:: bash
$ geth --password /path/to/password account new
.. Warning:: The ``--password`` flag is meant to be used only for testing or automation in trusted environments. It is a bad idea to save your password to file or expose it in any other way. If you do use the ``--password`` flag with a password file, make sure the file is not readable or even listable for anyone but you. You can achieve this in Mac/Linux systems with:

.. code-block:: Bash
.. code-block:: bash
touch /path/to/password
chmod 600 /path/to/password
Expand All @@ -77,7 +77,7 @@ For non-interactive use you supply a plaintext password file as argument to the
To list all the accounts with keyfiles currently in your ``keystore`` folder use the ``list`` subcommand of the ``geth account`` command:

.. code-block:: Bash
.. code-block:: bash
$ geth account list
Expand All @@ -94,7 +94,7 @@ Using geth console

In order to create a new account using geth, we must first start geth in console mode (or you can use ``geth attach`` to attach a console to an already running instance):

.. code-block:: Bash
.. code-block:: bash
> geth console 2>> file_to_log_output
instance: Geth/v1.4.0-unstable/linux/go1.5.1
Expand All @@ -104,7 +104,7 @@ In order to create a new account using geth, we must first start geth in console
The console allows you to interact with your local node by issuing commands. For example, try the command to list your accounts:

.. code-block:: Javascript
.. code-block:: javascript
> eth.accounts
Expand All @@ -115,7 +115,7 @@ The console allows you to interact with your local node by issuing commands. For
This shows that you have no accounts. You can also create an account from the console:

.. code-block:: Javascript
.. code-block:: javascript
> personal.newAccount()
Passphrase:
Expand All @@ -126,7 +126,7 @@ This shows that you have no accounts. You can also create an account from the co

We just created our first account. If we try to list our accounts again we can see our new account:

.. code-block:: Javascript
.. code-block:: javascript
> eth.accounts
["0xb2f69ddf70297958e582a0cc98bce43294f1007d"]
Expand Down Expand Up @@ -213,7 +213,7 @@ Every option related to key management available using geth can be used the same

Below are "account" related options:

.. code-block:: Javascript
.. code-block:: javascript
> eth account list // List all keys available in wallet.
> eth account new // Create a new key and add it to the wallet.
Expand All @@ -222,15 +222,15 @@ Below are "account" related options:
Below are "wallet" related option:

.. code-block:: Javascript
.. code-block:: javascript
> eth wallet import <file> //Import a presale wallet.
.. Note:: the 'account import' option can only be used to import generic key file. the 'wallet import' option can only be used to import a presale wallet.

It is also possible to access keys management from the integrated console (using the built-in console or geth attach):

.. code-block:: Javascript
.. code-block:: javascript
> web3.personal
{
Expand All @@ -250,7 +250,7 @@ Ethkey is a CLI tool of the C++ implementation that allows you to interact with
We will assume you have not yet run a client such as eth or anything in the Aleth series of clients. If you have, you can skip this section.
To create a wallet, run ``ethkey`` with the ``createwallet`` command:
.. code-block:: Bash
.. code-block:: bash
> ethkey createwallet
Expand All @@ -261,7 +261,7 @@ You'll be asked for a "master" passphrase. This protects your privacy and acts a
We can list the keys within the wallet simply by using the list command:
.. code-block:: Bash
.. code-block:: bash
> ethkey list
Expand All @@ -271,7 +271,7 @@ We haven't yet created any keys, and it's telling us so! Let's create one.
To create a key, we use the ``new`` command. To use it we must pass a name - this is the name we'll give to this account in the wallet. Let's call it "test":
.. code-block:: Bash
.. code-block:: bash
> ethkey new test
Expand All @@ -282,7 +282,7 @@ Here, let's give it the incredibly imaginative passphrase of 123. (Never ever us
Once you enter a passphrase, it'll ask you to confirm it by entering again. Enter 123 a second time.
Because you gave it its own passphrase, it'll also ask you to provide a hint for this password which will be displayed to you whenever it asks you to enter it. The hint is stored in the wallet and is itself protected by the master passphrase. Enter the truly awful hint of 321 backwards.
.. code-block:: Bash
.. code-block:: bash
> ethkey new test
Expand All @@ -298,7 +298,7 @@ Because you gave it its own passphrase, it'll also ask you to provide a hint for
All normal (aka direct) ICAP addresses begin with XE so you should be able to recognize them easily. Notice also that the key has another identifier after Created key. This is known as the UUID. This is a unique identifier for the key that has absolutely nothing to do with the account itself. Knowing it does nothing to help an attacker discover who you are on the network. It also happens to be the filename for the key, which you can find in either ~/.web3/keys (Mac or Linux) or $HOME/AppData/Web3/keys (Windows).
Now let's make sure it worked properly by listing the keys in the wallet:
.. code-block:: Bash
.. code-block:: bash
> ethkey list
055dde03-47ff-dded-8950-0fe39b1fa101 0092e965… XE472EVKU3CGMJF2YQ0J9RO1Y90BC0LDFZ test
Expand Down Expand Up @@ -336,7 +336,7 @@ Using geth
If you have a standalone installation of geth, importing your presale wallet is accomplished by executing the following command in a terminal:
.. code-block:: Bash
.. code-block:: bash
geth wallet import /path/to/my/presale-wallet.json
Expand All @@ -352,19 +352,19 @@ Using geth
You can update an existing account on the command line with the ``update`` subcommand with the account address or index as parameter. Remember that the account index reflects the order of creation (lexicographic order of keyfile names containing the creation time).
.. code-block:: Bash
.. code-block:: bash
geth account update b0047c606f3af7392e073ed13253f8f4710b08b6
or
.. code-block:: Bash
.. code-block:: bash
geth account update 2
For example:
.. code-block:: Bash
.. code-block:: bash
$ geth account update a94f5374fce5edbc8e2a8697c15331677e6ebf0b
Expand All @@ -381,7 +381,7 @@ The account is saved in the newest version in encrypted format, you are prompted
For non-interactive use the passphrase can be specified with the ``--password`` flag:
.. code-block:: Bash
.. code-block:: bash
geth --password <passwordfile> account update a94f5374fce5edbc8e2a8697c15331677e6ebf0bs
Expand Down Expand Up @@ -413,7 +413,7 @@ Importing an unencrypted private key
Importing an unencrypted private key is supported by ``geth``
.. code-block:: Bash
.. code-block:: bash
geth account import /path/to/<keyfile>
Expand All @@ -423,7 +423,7 @@ The account is saved in encrypted format, you are prompted for a passphrase. You
An example where the data directory is specified. If the ``--datadir`` flag is not used, the new account will be created in the default data directory, i.e., the keyfile will be placed in the ``keystore`` subdirectory of the data directory.
.. code-block:: Bash
.. code-block:: bash
$ geth --datadir /someOtherEthDataDir account import ./key.prv
The new account will be encrypted with a passphrase.
Expand All @@ -434,7 +434,7 @@ An example where the data directory is specified. If the ``--datadir`` flag is n
For non-interactive use the passphrase can be specified with the ``--password`` flag:
.. code-block:: Bash
.. code-block:: bash
geth --password <passwordfile> account import <keyfile>
Expand Down
6 changes: 3 additions & 3 deletions source/contracts-and-transactions/developer-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ To use this console you would need to start a local ethereum node with ipc commu
By default ipc socket should be located at your local home directory in .ethereum after you started a node.
You could also set ``--test`` option to use specific node test commands.

.. code:: Console
.. code:: console
> eth --test
> ethconsole ipc://path/to/geth.ipc
In the console you could then type

.. code:: Console
.. code:: console
> web3.eth.<command name> (arguments, function(){})
Here the defenition of ``--test`` mode node commands:

.. code:: Console
.. code:: console
> web3.test.addBlock("[RLP]", function(){}) - Add a block from a string containing its hex RLP
> web3.test.rewindToBlock:("[int]", function(){}) - Reset the blockchain to specified block number
Expand Down
2 changes: 1 addition & 1 deletion source/ethereum-clients/cpp-ethereum/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Interacting with your node can be done using either geth or the ethereum console

**Using geth**

.. code:: Console
.. code:: console
> geth attach //attach geth to a running eth node.
Expand Down
15 changes: 8 additions & 7 deletions source/mining.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The ``-minerthreads`` parameter can be used to set the number parallel mining th

You can also start and stop CPU mining at runtime using the `console <https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console#adminminerstart>`__. ``miner.start`` takes an optional parameter for the number of miner threads.

.. code-block:: Javascript
.. code-block:: javascript
> miner.start(8)
true
Expand Down Expand Up @@ -126,20 +126,21 @@ Note that your etherbase does not need to be an address of a local account, just

There is an option `to add extra Data <https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console#minersetextra>`__ (32 bytes only) to your mined blocks. By convention this is interpreted as a unicode string, so you can set your short vanity tag.

.. code-block:: javascript
.. code-block:: none
miner.setExtra("ΞTHΞЯSPHΞЯΞ")
> miner.setExtra("ΞTHΞЯSPHΞЯΞ")
...
debug.printBlock(131805)
> debug.printBlock(131805)
BLOCK(be465b020fdbedc4063756f0912b5a89bbb4735bd1d1df84363e05ade0195cb1): Size: 531.00 B TD: 643485290485 {
NoNonce: ee48752c3a0bfe3d85339451a5f3f411c21c8170353e450985e1faab0a9ac4cc
Header:
[
...
[
...
Coinbase: a4d8e9cae4d04b093aac82e6cd355b6b963fb7ff
Number: 131805
Extra: ΞTHΞЯSPHΞЯΞ
...
...
]
}
You can check your hashrate with `miner.hashrate <https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console#adminminerhashrate>`_, the result is in H/s (Hash operations per second).
Expand Down
12 changes: 6 additions & 6 deletions source/network/connecting-to-the-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Checking connectivity and ENODE IDs

To check how many peers the client is connected to in the interactive console, the ``net`` module has two attributes that give you info about the number of peers and whether you are a listening node.

.. code-block:: Javascript
.. code-block:: javascript
> net.listening
true
Expand All @@ -58,7 +58,7 @@ To check how many peers the client is connected to in the interactive console, t
To get more information about the connected peers, such as IP address and port number, supported protocols, use the ``peers()`` function of the ``admin`` object. ``admin.peers()`` returns the list of currently connected peers.

.. code-block:: Javascript
.. code-block:: javascript
> admin.peers
[{
Expand Down Expand Up @@ -90,7 +90,7 @@ To get more information about the connected peers, such as IP address and port n
To check the ports used by geth and also find your enode URI run:

.. code-block:: Javascript
.. code-block:: javascript
> admin.nodeInfo
{
Expand Down Expand Up @@ -135,7 +135,7 @@ This flag enables the JIT VM.

Full example command with console:

.. code-block:: Bash
.. code-block:: bash
geth --fast --cache=1024 --jitvm console
Expand All @@ -153,7 +153,7 @@ Static Nodes, Trusted Nodes, and Boot Nodes

Geth supports a feature called static nodes if you have certain peers you always want to connect to. Static nodes are re-connected on disconnects. You can configure permanent static nodes by putting something like the following into ``<datadir>/static-nodes.json`` (this should be the same folder that your ``chaindata`` and ``keystore`` folders are in)

.. code-block:: Javascript
.. code-block:: javascript
[
"enode://f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0@33.4.2.1:30303",
Expand All @@ -162,7 +162,7 @@ Geth supports a feature called static nodes if you have certain peers you always
You can also add static nodes at runtime via the Javascript console using ``admin.addPeer()``

.. code-block:: Console
.. code-block:: console
> admin.addPeer("enode://f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0@33.4.2.1:30303")
Expand Down
Loading

1 comment on commit 49dc864

@paulvi
Copy link

@paulvi paulvi commented on 49dc864 May 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sampullman Are you aware that you changed some files recently under https://github.com/ethereum/homestead-guide/tree/master/old-docs-for-reference/go-ethereum-wiki.rst,
that is actually should be archive for 2 year old docs

Please sign in to comment.