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

Commit be942bc

Browse files
authored
[refactor-prompt] update docs (#789)
* update global readme * update docs * process feedback * update show contract output
1 parent 6ee1777 commit be942bc

File tree

7 files changed

+131
-116
lines changed

7 files changed

+131
-116
lines changed

README.rst

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ What does it currently do
3131
project <https://github.com/neo-project>`_
3232
- Run a Python based P2P node
3333
- Interactive CLI for configuring node and inspecting blockchain
34-
- Build, deploy, and run smart contracts
34+
- Compile, test, deploy and run Smart Contracts written in Python or any smart contract in the ``.avm`` format
3535
- Runs smart contracts on the blockchain in a Python virtual machine
3636
- Very basic Wallet functionality (not fully tested, please do not use
3737
on mainnet)
@@ -252,8 +252,13 @@ basic interactivity.
252252
np-prompt
253253
NEO cli. Type 'help' to get started
254254

255-
neo> state
256-
Progress: 1054913 / 1237188
255+
neo> show state
256+
Progress: 10926 / 11145
257+
Block-cache length 0
258+
Blocks since program start 0
259+
Time elapsed 0.02598465 mins
260+
Blocks per min 0
261+
TPS: 0
257262

258263
neo>
259264

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

270-
neo> block 122235
275+
neo> show block 122235
271276
{
277+
"hash": "0xf9d7bc6f337a6cbe124b92b90ad7b29e2628e78202ea2daa19ed93fdc779c0e6",
278+
"size": 686,
279+
"version": 0,
280+
"previousblockhash": "0x1f262a0979d6da0eabaaf54252fb2508564a99fee642a77ff0773671fe5fddb9",
281+
"merkleroot": "0x5d4f86734c2a53187aa96751b9180d69f85f9bd7875f2eb83a27666ad052ea1e",
282+
"time": 1496920870,
272283
"index": 122235,
273-
"script": "",
274-
"merkleroot": "1d5a895ea34509a83becb5d2f9391018a3f59d670d94a2c3f8deb509a07464bd",
275-
"previousblockhash": "98ae05cb68ab857659cc6c8379eb7ba68b57ef1f5317904c295341d82d0a1713",
284+
"nonce": "7847dea9df7571c1",
285+
"nextconsensus": "AdyQbbn6ENjqWDa5JNYMwN3ikNcA4JeZdk",
286+
"script": {
287+
"invocation": "40e5a7d23cb065308412d769ca2ba6dd974aa453d0c915c25a7d951488eaa6c4eff5bbe251f01725b959fb89e7dd631f7f41efd50897c466d75e8359154f6137bf402f690a98a44e5ecb22e7f20bb75bac40cac89f4805f4706ec9daf8e6ccc15def216d667423bb148e78db9461e288d7363f699741a0efb4c7c6c6dc902250cf3f4023ba2eb464aa8841cb2230c0f9f016a47c1e54e1f809da550743c33b0529b5996f4c5993a38bb73887e0b3fd7a093f6abd00d136048169a99cf34373560b8956408e816d0a0b018c348070da63f513b5b3332ef31914c420203b792f25048c1b8b397bc4bd47315be44491f7182be8aeca39035a2cd51a20da034820e5e1b5c0644052ce1cb6769e9dc9375ea96db8d538e6b2210a093c555f759ccf1d908f8c2fe3cf6236c4dade54ebca825a36e81049c7f4b149c1458c30b37460fc22581201f2",
288+
"verification": "55210209e7fd41dfb5c2f8dc72eb30358ac100ea8c72da18847befe06eade68cebfcb9210327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee821034ff5ceeac41acf22cd5ed2da17a6df4dd8358fcb2bfb1a43208ad0feaab2746b21026ce35b29147ad09e4afe4ec4a7319095f08198fa8babbe3c56e970b143528d2221038dddc06ce687677a53d54f096d2591ba2302068cf123c1f2d75c2dddc542557921039dafd8571a641058ccc832c5e2111ea39b09c0bde36050914384f7a48bce9bf92102d02b1873a0863cd042cc717da31cea0d7cf9db32b74d4c72c01b0011503e2e2257ae"
289+
},
276290
"tx": [
277-
"1d5a895ea34509a83becb5d2f9391018a3f59d670d94a2c3f8deb509a07464bd"
278-
],
279-
"version": 0,
280-
"time": 1479110368,
281-
"hash": "74671375033f506325ef08d35632f74083cca564dc7ea6444c94d3b9dec3f61b",
282-
"consensus data": 16070047272025254767,
283-
"next_consensus": "59e75d652b5d3827bf04c165bbe9ef95cca4bf55"
291+
{
292+
"txid": "0x5d4f86734c2a53187aa96751b9180d69f85f9bd7875f2eb83a27666ad052ea1e",
293+
"size": 10,
294+
"type": "MinerTransaction",
295+
"version": 0,
296+
"attributes": [],
297+
"vout": [],
298+
"vin": [],
299+
"sys_fee": "0",
300+
"net_fee": "0",
301+
"scripts": [],
302+
"nonce": 3749016001
303+
}
304+
]
284305
}
285306
neo>
286307

@@ -330,22 +351,19 @@ Basic Wallet commands
330351

331352
::
332353

333-
create wallet {wallet_path}
334-
open wallet {wallet_path}
354+
wallet create {wallet_path}
355+
wallet open {wallet_path}
335356
wallet close
336357

337358
wallet (verbose)
338359
wallet rebuild (start block)
339-
wallet create_addr {number of addresses}
340-
wallet delete_addr {addr}
341-
342-
export wif {address}
343-
import wif {wif}
344-
345-
export nep2 {address}
346-
import nep2 {nep2_encrypted_key}
347-
348-
send {assetId or name} {address} {amount} (--from-addr={addr}) (--fee={priority_fee}) (--owners=[{addr}, ...]) (--tx-attr=[{"usage": <value>,"data":"<remark>"}, ...])
360+
361+
wallet import wif {wif}
362+
wallet export wif {address}
363+
364+
wallet send {args} # (NEO/GAS)
365+
wallet token send {args} # NEP5
366+
349367

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

@@ -384,7 +402,6 @@ Logging
384402

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

387-
--------------
388405

389406
Tests
390407
-----

docs/source/example/sample2.avm

0 Bytes
Binary file not shown.

docs/source/example/sample3.avm

0 Bytes
Binary file not shown.

docs/source/neo/SmartContract/application-vs-verification.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Application vs. Verification
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5-
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?
6-
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:
5+
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?
6+
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:
77

88
.. code-block:: python
99
@@ -18,7 +18,7 @@ Lets start out with our example from before of tracking a balance, and restrict
1818
print("Running Sample v4")
1919
trigger = GetTrigger()
2020
21-
# This determines that the SC is runnning in Verification mode
21+
# This determines that the SC is running in Verification mode
2222
# This determines whether the TX will be relayed to the rest of the network
2323
# The `Verification` portion of SC is *read-only*, so calls to `Storage.Put` will fail.
2424
# You can, however, use `Storage.Get`
@@ -81,7 +81,7 @@ We will turn on ``sc-events`` to make sure we can see exactly what is going on.
8181
.. code-block:: sh
8282
8383
neo>
84-
neo> build docs/source/neo/example/sample4.py test 070202 02 True False add AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy 7
84+
neo> sc build_run docs/source/neo/example/sample4.py True False False 070202 02 add AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy 7
8585
Saved output to docs/source/neo/example/sample4.avm
8686
[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}']
8787
[I 180303 08:25:12 EventHub:71] [test_mode][SmartContract.Runtime.Log] [562d6c29209dc96432c6868621fe489cedd05222] [b'Running Sample v4']
@@ -107,7 +107,7 @@ Currently, in order to interact with the ``Verification`` stage of the Smart Con
107107

108108
.. code-block:: sh
109109
110-
neo> contract 2e80ee491a0a54c9bbb0f791672050f9ab367767
110+
neo> show contract 2e80ee491a0a54c9bbb0f791672050f9ab367767
111111
{
112112
"version": 0,
113113
"code": {
@@ -133,7 +133,7 @@ Lets test invoke again.
133133

134134
.. code-block:: sh
135135
136-
neo> testinvoke 0x2e80ee491a0a54c9bbb0f791672050f9ab367767 add AMUUgxnLhGxNSATinNp8gKmndqM1BxDZHR 42
136+
neo> sc invoke 0x2e80ee491a0a54c9bbb0f791672050f9ab367767 add AMUUgxnLhGxNSATinNp8gKmndqM1BxDZHR 42
137137
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'Running Sample v4']
138138
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'\x10']
139139
[I 180303 09:08:14 EventHub:71] [test_mode][SmartContract.Runtime.Log] [2e80ee491a0a54c9bbb0f791672050f9ab367767] [b'Running Application!']

0 commit comments

Comments
 (0)