Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update command-reference.md #418

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
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
293 changes: 278 additions & 15 deletions docs/command-reference.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- markdownlint-enable -->
# Neo-Express N3 Command Reference

> Note, this is the command reference for Neo-Express 3.0, targeting N3.
> Note: This is the command reference for Neo-Express 3.6, targeting N3.
> The [Command Reference](legacy-command-reference.md) for the Neo Legacy
Copy link
Member

Choose a reason for hiding this comment

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

The link is 404.

> compatible version of Neo-Express is also available.

> Note, you can pass -?|-h|--help to show a list of supported commands or to show
> Note: You can pass -?|-h|--help to show a list of supported commands or to show
> help information about a specific command.

## Specifying Signing and Non-Signing Accounts
Expand Down Expand Up @@ -224,6 +224,8 @@ Arguments:
The `wallet delete` command removes a wallet and its accounts from the blockchain network file. This
command does not modify the blockchain data, so any assets associated with that wallet are not changed.

To delete a private net wallet, the `--force` option must be specified.

### neoxp wallet export

```
Expand All @@ -237,7 +239,7 @@ Arguments:
<Name>: Wallet name
```

Similar the top-level `export` command described above, `wallet export` saves an existing Neo-Express
Similar to the top-level `export` command described above, `wallet export` saves an existing Neo-Express
wallet in the [NEP-6 wallet format](https://github.com/neo-project/proposals/blob/master/nep-6.mediawiki)
that can be read by standard Neo tools.

Expand All @@ -264,15 +266,47 @@ Arguments:
```

The `transfer` command is used to transfer assets between accounts in a Neo-Express
blockchain network. The transfer command has four required arguments
blockchain network. The transfer command has four required arguments:

- the quantity to transfer as an integer or `all` to transfer all assets of the specified type

> Note, You cannot transfer all GAS tokens in an account as you have to reserve some GAS tokens to cover the transaction fee.

- The asset to transfer. This can be specified as contract hash or
[NEP-17](https://github.com/neo-project/proposals/blob/master/nep-17.mediawiki)
token symbol such as `neo` or `gas`

- Signing account that is sending the asset

- Non-signing account that is receiving the asset

## neoxp transfernft

```
Usage: neoxp transfernft [options] <Contract> <TokenId> <Sender> <Receiver>

Arguments:
Contract NFT Contract (Symbol or Script Hash)
TokenId TokenId of NFT (Format: HEX, BASE64)
Sender Account to send NFT from (Format: Wallet name, WIF)
Receiver Account to send NFT to (Format: Script Hash, Address, Wallet name)

Options:
-d|--data <DATA> Optional data parameter to pass to transfer operation
-p|--password <PASSWORD> password to use for NEP-2/NEP-6 sender
-i|--input <INPUT> Path to neo-express data file
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
```

The `transfernft` command is used to transfer NFT assets between accounts in a Neo-Express
blockchain network. The transfer command has the following required arguments:

- The contract hash or NEP-11 token symbol of the NFT asset to transfer.
- The TokenID in the HEX or BASE64 format of the NFT asset to transfer.
- Signing account that is sending the NFT asset.
- Non-signing account that is receiving the NFT asset.

## neoxp contract

The `contract` command has a series of subcommands for managing smart contracts
Expand Down Expand Up @@ -384,7 +418,7 @@ Arguments:
[Options]:
-i|--input <INPUT> Path to neo-express data file
<Contract>: Contract name or invocation hash
```
```

The `contract get` command retrieves the manifest of a deployed contract.

Expand Down Expand Up @@ -458,11 +492,11 @@ Arguments:
```

> Note, The smart contract will need to have a method with this signature: e.g.
>
>
> C#: `public static bool Update(ByteString nefFile, string manifest)`
>
>
> Python: `def update(nef: bytes, manifest: str):`
>
>

### neoxp contract download

Expand All @@ -486,17 +520,217 @@ Arguments:
-?|--help Show help information.
```

### neoxp contract validate

The `neoxp contract validate` checks a given contract for compliance with proposal specification. It has two subcommands.

#### nepxp contract validate nep11

```
Usage: neoxp contract validate nep11 [options] <ContractHash>

Arguments:
ContractHash Path to contract .nef file

Options:
-i|--input <INPUT> Path to neo-express data file
```

This command checks if the specified contract is NEP-11 compliant.

#### nepxp contract validate nep17

```
Usage: neoxp contract validate nep17 [options] <ContractHash>

Arguments:
ContractHash Path to contract .nef file

Options:
-i|--input <INPUT> Path to neo-express data file
```

This command checks if the specified contract is NEP-17 compliant.

## neoxp show

The `show` command will display information from the blockchain. There are multiple subcommands
representing the different information that is available:
The `show` command displays information from the blockchain. There are multiple subcommands
representing the different information that is available.

### neoxp show balance

```
Usage: neoxp show balance [options] <Asset> <Account>

Arguments:
Asset Asset to show balance of (symbol or script hash)
Account Account to show asset balance for

Options:
-i|--input <INPUT> Path to neo-express data file
```

The `show balance` displays the balance of a single NEP-17 asset (including NEO and GAS) of a specific account.

### neoxp show balances

```
Usage: neoxp show balances [options] <Account>

Arguments:
Account Account to show asset balances for

Options:
-i|--input <INPUT> Path to neo-express data file
```

The `show balances` displays the balance of all NEP-17 asset (including NEO and GAS) owned by a specific account.

### neoxp show block

```
Usage: neoxp show block [options] <BlockHash>

Arguments:
BlockHash Optional block hash or index. Show most recent block if
unspecified

Options:
-i|--input <INPUT> Path to neo-express data file
```

The `show block` displays the contents of a single block, specified by index or hash.

### neoxp show nft

```
Usage: neoxp show nft [options] <Contract> <Account>

Arguments:
Contract NFT Contract (Symbol or Script Hash)
Account Account to show NFT (Format: Script Hash, Address, Wallet name)

Options:
-i|--input <INPUT> Path to neo-express data file
```

The `show nft` displays the content of an NFT contract for a specified account.

Copy link
Member

Choose a reason for hiding this comment

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

It is suggested to supplement:
The output will consist of TokenId in Base64 format and TokenId in big-endian Hex string format.

### neoxp show notifications

- `show balance` will display the balance of a single NEP-17 asset (including NEO and GAS) of a specific account
- `show balances` will display the balance of all NEP-17 asset (including NEO and GAS) owned by a specific account
- `show block` with display the contents of a single block, specified by index or hash
- `show transaction` with display the contents of a transaction specified by hash and its execution results if available
- `show tx` is an alias for `show transaction`
```
Usage: neoxp show notifications [options]

Options:
-c|--contract <CONTRACT> Limit shown notifications to the specified contract
-n|--count Limit number of shown notifications
-e|--event-name <EVENT_NAME> Limit shown notifications to specified event name
-i|--input <INPUT> Path to neo-express data file
```

The `show notifications` displays contract notifications in JSON format.

### neoxp show transaction

```
Usage: neoxp show transaction [options] <TransactionHash>

Arguments:
TransactionHash Transaction hash

Options:
-i|--input <INPUT> Path to neo-express data file
```

The `show transaction` displays the contents of a transaction specified by hash and its execution results if available.

`show tx` is an alias for `show transaction`

## neoxp candidate

The `candidate` command has a series of subcommands for managing candidates election in the Neo-Express blockchain.

### neoxp candidate list

```
Usage: neoxp candidate list [options]

Options:
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
-i|--input <INPUT> Path to neo-express data file
```
Copy link
Member

Choose a reason for hiding this comment

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

The results include the public key of the candidate and the number of ballots cast.


This command lists candidates

### neoxp candidate register

```
Usage: neoxp candidate register [options] <Account>

Arguments:
Account Account to register candidate

Options:
-p|--password <PASSWORD> Password to use for NEP-2/NEP-6 account
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
-i|--input <INPUT> Path to neo-express data file
```

This command registers a specified account as candidate.

### neoxp candidate unregister

```
Usage: neoxp candidate unregister [options] <Account>

Arguments:
Account Account to unregister candidate

Options:
-p|--password <PASSWORD> Password to use for NEP-2/NEP-6 account
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
-i|--input <INPUT> Path to neo-express data file
```

This command unregisters a specified candidate account.

### neoxp candidate vote

```
Usage: neoxp candidate vote [options] <Account> <PublicKey>

Arguments:
Account Account to vote
PublicKey Candidate publickey

Options:
-p|--password <PASSWORD> Password to use for NEP-2/NEP-6 account
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
-i|--input <INPUT> Path to neo-express data file
```

This command votes for a specified account with public key.

### neoxp candidate unvote

```
Usage: neoxp candidate unvote [options] <Account>

Arguments:
Account Account to unvote

Options:
-p|--password <PASSWORD> Password to use for NEP-2/NEP-6 account
-t|--trace Enable contract execution tracing
-j|--json Output as JSON
-i|--input <INPUT> Path to neo-express data file
```

This command cancels the voting for a specified account with public key.

## neoxp checkpoint

Expand Down Expand Up @@ -616,6 +850,35 @@ The commands supported in a batch file include:
* `policy unblock`
* `transfer`

## neoxp execute

```
Usage: neoxp execute [options] <InputText>

Arguments:
InputText A neo-vm script (Format: HEX, BASE64, Filename)

Options:
-a|--account <ACCOUNT> Account to pay invocation GAS fee
Copy link
Member

Choose a reason for hiding this comment

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

format error

-w|--witness-scope <WITNESS_SCOPE> Witness Scope for transaction signer(s) (Allowed: None,
CalledByEntry, Global)
Allowed values are: None,
CalledByEntry, Global.
Default value is:
CalledByEntry.
-r|--results Invoke contract for results
(does not cost GAS)
-g|--gas Additional GAS to apply to
the contract invocation
Default value is: 0.
-p|--password <PASSWORD> password to use for
NEP-2/NEP-6 account
-t|--trace Enable contract execution
tracing
```

This command invokes a custom script, the input text will be converted to script with a priority: hex, base64, file path.

## neoxp fastfwd

```
Expand Down