Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

[refactor-prompt] update docs #789

Merged
merged 4 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 44 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ What does it currently do
project <https://github.com/neo-project>`_
- Run a Python based P2P node
- Interactive CLI for configuring node and inspecting blockchain
- Build, deploy, and run smart contracts
- Compile, test, deploy and run Smart Contracts written in Python or any smart contract in the ``.avm`` format
- Runs smart contracts on the blockchain in a Python virtual machine
- Very basic Wallet functionality (not fully tested, please do not use
on mainnet)
Expand Down Expand Up @@ -252,8 +252,13 @@ basic interactivity.
np-prompt
NEO cli. Type 'help' to get started

neo> state
Progress: 1054913 / 1237188
neo> show state
Progress: 10926 / 11145
Block-cache length 0
Blocks since program start 0
Time elapsed 0.02598465 mins
Blocks per min 0
TPS: 0

neo>

Expand All @@ -267,20 +272,36 @@ Let's query for a block in the current server by hash or by block index:
np-prompt
NEO cli. Type 'help' to get started

neo> block 122235
neo> show block 122235
{
"hash": "0xf9d7bc6f337a6cbe124b92b90ad7b29e2628e78202ea2daa19ed93fdc779c0e6",
"size": 686,
"version": 0,
"previousblockhash": "0x1f262a0979d6da0eabaaf54252fb2508564a99fee642a77ff0773671fe5fddb9",
"merkleroot": "0x5d4f86734c2a53187aa96751b9180d69f85f9bd7875f2eb83a27666ad052ea1e",
"time": 1496920870,
"index": 122235,
"script": "",
"merkleroot": "1d5a895ea34509a83becb5d2f9391018a3f59d670d94a2c3f8deb509a07464bd",
"previousblockhash": "98ae05cb68ab857659cc6c8379eb7ba68b57ef1f5317904c295341d82d0a1713",
"nonce": "7847dea9df7571c1",
"nextconsensus": "AdyQbbn6ENjqWDa5JNYMwN3ikNcA4JeZdk",
"script": {
"invocation": "40e5a7d23cb065308412d769ca2ba6dd974aa453d0c915c25a7d951488eaa6c4eff5bbe251f01725b959fb89e7dd631f7f41efd50897c466d75e8359154f6137bf402f690a98a44e5ecb22e7f20bb75bac40cac89f4805f4706ec9daf8e6ccc15def216d667423bb148e78db9461e288d7363f699741a0efb4c7c6c6dc902250cf3f4023ba2eb464aa8841cb2230c0f9f016a47c1e54e1f809da550743c33b0529b5996f4c5993a38bb73887e0b3fd7a093f6abd00d136048169a99cf34373560b8956408e816d0a0b018c348070da63f513b5b3332ef31914c420203b792f25048c1b8b397bc4bd47315be44491f7182be8aeca39035a2cd51a20da034820e5e1b5c0644052ce1cb6769e9dc9375ea96db8d538e6b2210a093c555f759ccf1d908f8c2fe3cf6236c4dade54ebca825a36e81049c7f4b149c1458c30b37460fc22581201f2",
"verification": "55210209e7fd41dfb5c2f8dc72eb30358ac100ea8c72da18847befe06eade68cebfcb9210327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee821034ff5ceeac41acf22cd5ed2da17a6df4dd8358fcb2bfb1a43208ad0feaab2746b21026ce35b29147ad09e4afe4ec4a7319095f08198fa8babbe3c56e970b143528d2221038dddc06ce687677a53d54f096d2591ba2302068cf123c1f2d75c2dddc542557921039dafd8571a641058ccc832c5e2111ea39b09c0bde36050914384f7a48bce9bf92102d02b1873a0863cd042cc717da31cea0d7cf9db32b74d4c72c01b0011503e2e2257ae"
},
"tx": [
"1d5a895ea34509a83becb5d2f9391018a3f59d670d94a2c3f8deb509a07464bd"
],
"version": 0,
"time": 1479110368,
"hash": "74671375033f506325ef08d35632f74083cca564dc7ea6444c94d3b9dec3f61b",
"consensus data": 16070047272025254767,
"next_consensus": "59e75d652b5d3827bf04c165bbe9ef95cca4bf55"
{
"txid": "0x5d4f86734c2a53187aa96751b9180d69f85f9bd7875f2eb83a27666ad052ea1e",
"size": 10,
"type": "MinerTransaction",
"version": 0,
"attributes": [],
"vout": [],
"vin": [],
"sys_fee": "0",
"net_fee": "0",
"scripts": [],
"nonce": 3749016001
}
]
}
neo>

Expand Down Expand Up @@ -330,22 +351,19 @@ Basic Wallet commands

::

create wallet {wallet_path}
open wallet {wallet_path}
wallet create {wallet_path}
wallet open {wallet_path}
wallet close

wallet (verbose)
wallet rebuild (start block)
wallet create_addr {number of addresses}
wallet delete_addr {addr}

export wif {address}
import wif {wif}

export nep2 {address}
import nep2 {nep2_encrypted_key}

send {assetId or name} {address} {amount} (--from-addr={addr}) (--fee={priority_fee}) (--owners=[{addr}, ...]) (--tx-attr=[{"usage": <value>,"data":"<remark>"}, ...])

wallet import wif {wif}
wallet export wif {address}

wallet send {args} # (NEO/GAS)
wallet token send {args} # NEP5


For a complete list of commands use ``help``.

Expand Down Expand Up @@ -384,7 +402,6 @@ Logging

Currently, ``np-prompt`` logs to ``prompt.log``

--------------

Tests
-----
Expand Down
Binary file modified docs/source/example/sample2.avm
Binary file not shown.
Binary file modified docs/source/example/sample3.avm
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/source/neo/SmartContract/application-vs-verification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Application vs. Verification
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Now that you have built, tested, and testinvoked your SC, you may be asking, what is this ``Verification`` step, and how do I programatically interact with it?
Lets start out with our example from before of tracking a balance, and restrict it so that only an 'owner' address can perform operations on it. Heres the Smart Contract code:
Now that you have built, tested, and test invoked your SC, you may be asking, what is this ``Verification`` step, and how do I programmatically interact with it?
Lets start out with our example from before of tracking a balance, and restrict it so that only an 'owner' address can perform operations on it. Here's the Smart Contract code:

.. code-block:: python

Expand All @@ -18,7 +18,7 @@ Lets start out with our example from before of tracking a balance, and restrict
print("Running Sample v4")
trigger = GetTrigger()

# This determines that the SC is runnning in Verification mode
# This determines that the SC is running in Verification mode
# This determines whether the TX will be relayed to the rest of the network
# The `Verification` portion of SC is *read-only*, so calls to `Storage.Put` will fail.
# You can, however, use `Storage.Get`
Expand Down Expand Up @@ -81,7 +81,7 @@ We will turn on ``sc-events`` to make sure we can see exactly what is going on.
.. code-block:: sh

neo>
neo> build docs/source/neo/example/sample4.py test 070202 02 True False add AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy 7
neo> sc build_run docs/source/neo/example/sample4.py True False False 070202 02 add AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy 7
Saved output to docs/source/neo/example/sample4.avm
[I 180303 08:25:12 EventHub:71] [test_mode][SmartContract.Contract.Create] [562d6c29209dc96432c6868621fe489cedd05222] ['{\n "version": 0,\n "code": {\n "hash": "0x562d6c29209dc96432c6868621fe489cedd05222",\n "script": "0122c56b6a00527ac46a51527ac46a52527ac4140319e029b925857790e41785be9ccec6cab198966a53527ac41152756e6e696e672053616d706c65207634680f4e656f2e52756e74696d652e4c6f6768164e656f2e52756e74696d652e47657454726967676572616a54527ac46a54c301009c6492001552756e6e696e6720566572696669636174696f6e21680f4e656f2e52756e74696d652e4c6f676a53c368184e656f2e52756e74696d652e436865636b5769746e657373616a55527ac46a55c3642200094973204f776e657221680f4e656f2e52756e74696d652e4c6f67516c756661094e6f74204f776e6572680f4e656f2e52756e74696d652e4c6f67006c7566616a54c301109c6454011452756e6e696e67204170706c69636174696f6e21680f4e656f2e52756e74696d652e4c6f676a51c3652d01632a00114e6f742056616c69642041646472657373680f4e656f2e52756e74696d652e4c6f67006c75666168164e656f2e53746f726167652e476574436f6e74657874616a56527ac46a00c3036164649c6450006a56c36a51c37c680f4e656f2e53746f726167652e476574616a57527ac46a57c36a52c3936a58527ac46a56c36a51c36a58c35272680f4e656f2e53746f726167652e507574616a58c36c7566616a00c30672656d6f76659c644c006a56c36a51c37c680f4e656f2e53746f726167652e476574616a57527ac46a56c36a51c36a57c36a52c3945272680f4e656f2e53746f726167652e507574616a57c36a52c3946c7566616a00c30762616c616e63659c641f006a56c36a51c37c680f4e656f2e53746f726167652e476574616c756661006c756656c56b6a00527ac46a00c3c001149c640700516c756661006c7566",\n "parameters": "070202",\n "returntype": 2\n },\n "name": "test",\n "code_version": "test",\n "author": "test",\n "email": "test",\n "description": "test",\n "properties": {\n "storage": true,\n "dynamic_invoke": false\n }\n}']
[I 180303 08:25:12 EventHub:71] [test_mode][SmartContract.Runtime.Log] [562d6c29209dc96432c6868621fe489cedd05222] [b'Running Sample v4']
Expand All @@ -107,7 +107,7 @@ Currently, in order to interact with the ``Verification`` stage of the Smart Con

.. code-block:: sh

neo> contract 2e80ee491a0a54c9bbb0f791672050f9ab367767
neo> show contract 2e80ee491a0a54c9bbb0f791672050f9ab367767
{
"version": 0,
"code": {
Expand All @@ -133,7 +133,7 @@ Lets test invoke again.

.. code-block:: sh

neo> testinvoke 0x2e80ee491a0a54c9bbb0f791672050f9ab367767 add AMUUgxnLhGxNSATinNp8gKmndqM1BxDZHR 42
neo> sc invoke 0x2e80ee491a0a54c9bbb0f791672050f9ab367767 add AMUUgxnLhGxNSATinNp8gKmndqM1BxDZHR 42
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'Running Sample v4']
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'\x10']
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'Running Application!']
Expand Down
Loading