Skip to content

Commit c3b33f4

Browse files
committed
update
1 parent ce1e309 commit c3b33f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+185
-134
lines changed

docs/n3/develop/deploy/invoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ invoke <scriptHash> <operation> [contractParameters=null] [sender=null] [signer
6464
When invoking a contract in Neo-GUI, you can click `Cosignature` at the bottom of the page, choose `Public key`, and then click `Sign` to add the signature.
6565

6666
:::note
67-
When you invoke the transfer method of the NEP-17 contract using the transfer command, the wallet will automatically appends the signature to the from field. You don't need to add it manually.
67+
When you invoke the transfer method of the NEP-17 contract using the transfer command, the wallet will automatically appends the signature to the from field. You don't need to add it manually.
6868
:::
6969

7070
## Invoking between contracts

docs/n3/develop/network/private-chain/private-chain2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ You can refer to the following example:
211211
```
212212

213213
:::note
214-
If the plugin RpcServer is installed, you also need to modify the port numbers in the plugin config.json file to make them different from each other and from the ports in config.json of the node.
214+
If the plugin RpcServer is installed, you also need to modify the port numbers in the plugin config.json file to make them different from each other and from the ports in config.json of the node.
215215
:::
216216

217217
## Installing consensus plugin
@@ -311,7 +311,7 @@ In the genesis block of the NEO network, 100 million NEO and 30 million GAS are
311311
![](../assets/initial-balance.png)
312312

313313
:::note
314-
You must create multi-party signature address in at least three wallets so as to sign the transfer transaction successfully.
314+
You must create multi-party signature address in at least three wallets so as to sign the transfer transaction successfully.
315315
:::
316316

317317
#### Transferring NEO to a normal address

docs/n3/develop/network/private-chain/solo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Here is an example:
8484
## Starting the private chain
8585

8686
:::note
87-
If the node has downloaded Neo test net block files, you need to delete the Data folder before running Neo-CLI, otherwise the private chain will not be able to properly generate blocks.
87+
If the node has downloaded Neo test net block files, you need to delete the Data folder before running Neo-CLI, otherwise the private chain will not be able to properly generate blocks.
8888
:::
8989

9090
To start the private chain, enter the neo-cli directory and run neo-cli.exe, or run the command line and enter `dotnet neo-cli.dll`. The private chain is set up successfully when it goes as shown below:
@@ -156,7 +156,7 @@ In the genesis block of the Neo network, 100 million NEO and 30 million GAS are
156156

157157
6. Enter `list asset`,then you should see 100 million NEO and 30 million GAS displayed.
158158

159-
7. Create a new wallet using the command `create wallet ` and copy the wallet address.
159+
7. Create a new wallet using the command `create wallet` and copy the wallet address.
160160

161161
8. Open the wallet `consensus.json` again and transfer NEO and GAS to the new created wallet with the `send` command. For example, `send neo NWu2gb7PzhZb4ci9LvW4gBYAQFMGb1s1o7 100000000`, `send gas NWu2gb7PzhZb4ci9LvW4gBYAQFMGb1s1o7 10000000`.
162162

docs/n3/develop/tool/sdk/introduction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This document is applicable to Neo N3. It is recommended you use NEO SDK in conj
1818

1919
1. In Visual Studio 2019, create a new .NET project
2020

21-
:::note
22-
The .NET version of the project cannot be earlier than the .NET version used by the Neo SDK.
23-
:::
21+
:::note
22+
The .NET version of the project cannot be earlier than the .NET version used by the Neo SDK.
23+
:::
2424

2525
2. Right-click the project and select `Manage NuGet Packages`.
2626

@@ -33,10 +33,10 @@ The .NET version of the project cannot be earlier than the .NET version used by
3333
```
3434

3535
:::note
36-
If you use SDK to construct a transaction that requires a signature, you need to ensure that the RpcClient obeject and the network it is connected to are configured the same way, or the transaction constructed by the SDK will not be validated in the blockchain. To do so, load Neo-CLI config.json when constructing the RpcClient object, for example:
36+
If you use SDK to construct a transaction that requires a signature, you need to ensure that the RpcClient obeject and the network it is connected to are configured the same way, or the transaction constructed by the SDK will not be validated in the blockchain. To do so, load Neo-CLI config.json when constructing the RpcClient object, for example:
37+
38+
RpcClient client = new RpcClient(new Uri("http://localhost:20332"), null, null, ProtocolSettings.Load("config.json"))
3739
:::
38-
>
39-
> RpcClient client = new RpcClient(new Uri("http://localhost:20332"), null, null, ProtocolSettings.Load("config.json"))
4040

4141
## Exception handing
4242

docs/n3/develop/tool/sdk/rpc.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ The `RpcClient` encapsulates all the interfaces provided by RpcServer. You can s
44

55

66
## Initializing RpcClient
7+
78
Before you can send RPC requests you need to initialize `RpcClient` first. Choose the RPC server port of a Neo node according to your own needs. Here is an example:
89

910
Test net node:
@@ -21,7 +22,7 @@ RpcClient client = new RpcClient(new Uri("http://localhost:20332"), null, null,
2122
```
2223

2324
:::note
24-
Typically, only one RpcClient instance needs to be initialized in an application, not needing in each method.
25+
Typically, only one RpcClient instance needs to be initialized in an application, not needing in each method.
2526
:::
2627

2728
## Blockchain data
@@ -79,6 +80,7 @@ UInt256 hash256 = UInt256.Parse(hexString);
7980
```
8081

8182
### Get the block header information
83+
8284
Get the specific block header information by the block hash or block index:
8385

8486
```cs
@@ -106,6 +108,7 @@ string serializedBlockHeader = await client.GetBlockHeaderHexAsync("10000").Conf
106108
```
107109

108110
### GetContractStateAsync
111+
109112
Gets the contract information from the contract hash or contract ID
110113

111114
```cs
@@ -117,6 +120,7 @@ ContractState contractState = client.GetContractState(-1);
117120
```
118121

119122
### GetRawMempoolAsync
123+
120124
Gets hash list of the confirmed transactions in the memory.
121125

122126
```cs
@@ -167,13 +171,15 @@ string value = await client.GetStorageAsync("03febccf81ac85e3d795bc5cbd4e84e9078
167171
```
168172

169173
### GetTransactionHeightAsync
174+
170175
Gets the block height of the specified transaction by transaction ID:
171176

172177
```cs
173178
uint height = await client.GetTransactionHeightAsync("f4250dab094c38d8265acc15c366dc508d2e14bf5699e12d9df26577ed74d657").ConfigureAwait(false);
174179
```
175180

176181
### GetNextBlockValidatorsAsync
182+
177183
Gets the consensus nodes information and voting status in the current network.
178184

179185
```cs
@@ -197,13 +203,15 @@ string[] committees = await client.GetCommitteeAsync().ConfigureAwait(false);
197203
## Node
198204

199205
### GetConnectionCount
206+
200207
Gets the number of nodes connected to this node.
201208

202209
```cs
203210
int connectionCount = await client.GetConnectionCountAsync().ConfigureAwait(false);
204211
```
205212

206213
### GetPeersAsync
214+
207215
Gets a list of currently connected / unconnected nodes for this node, including IP address and port.
208216

209217
```cs
@@ -219,6 +227,7 @@ if (connected.Length > 0)
219227
```
220228

221229
### GetVersionAsync
230+
222231
Gets the version of the node receiving the RPC request:
223232

224233
```cs
@@ -227,6 +236,7 @@ string version = rpcVersion.UserAgent;
227236
```
228237

229238
### SendRawTransactionAsync
239+
230240
Sends and broadcasts the serialized transaction.
231241

232242
```cs
@@ -240,6 +250,7 @@ UInt256 txHash = await client.SendRawTransactionAsync(transaction).ConfigureAwai
240250
```
241251

242252
### SubmitBlockAsync
253+
243254
Sends and broadcasts the serialized block:
244255

245256
```cs
@@ -249,6 +260,7 @@ UInt256 blockHash = await client.SubmitBlockAsync("00000000000000000000000000000
249260
## Smart contract
250261

251262
### InvokeFunctionAsync
263+
252264
Invokes the specific method of the smart contract through the specified smart contract script hash, method name, and parameters, and returns the result after running in the virtual machine.
253265

254266
```cs
@@ -288,6 +300,7 @@ long gasConsumed = rpcInvokeResult.GasConsumed;
288300
```
289301

290302
### InvokeScriptAsync
303+
291304
Returns the result after running the specified script in the virtual machine.
292305

293306
```cs
@@ -308,6 +321,7 @@ string address = unclaimedGas.Address;
308321
## Tools
309322

310323
### ListPluginsAsync
324+
311325
Lists all the plugins loaded in the node.
312326

313327
```cs
@@ -320,6 +334,7 @@ foreach (var item in rpcPlugins)
320334
```
321335

322336
### ValidateAddressAsync
337+
323338
Validates if the specified address is a valid Neo address.
324339

325340
```cs
@@ -329,6 +344,7 @@ bool isValid = result.IsValid;
329344
```
330345

331346
## Wallets
347+
332348
The node local wallet interface contains the function of accessing the local wallet file. Before using the methods described in this section, you need to open the wallet using the openwallet method.
333349

334350
This method is disabled by default in the node configuration file for preventing high security risks.
@@ -344,41 +360,47 @@ bool result = await client.OpenWalletAsync(path, password).ConfigureAwait(false)
344360
```
345361

346362
### CloseWalletAsync
363+
347364
Closes the wallet and clears the wallet information in memory.
348365

349366
```cs
350367
bool result = await client.CloseWalletAsync().ConfigureAwait(false);
351368
```
352369

353370
### DumpPrivKeyAsync
371+
354372
Exports the private key of the specified address.
355373

356374
```cs
357375
string wif = await client.DumpPrivKeyAsync("NVVwFw6XyhtRCFQ8SpUTMdPyYt4Vd9A1XQ").ConfigureAwait(false);
358376
```
359377

360378
### GetBalanceAsync
379+
361380
Returns balance of the specified asset in the wallet by the asset id. This method is applicable to the native contract assets and NEP-17 compliant assets.
362381

363382
```cs
364383
BigDecimal balance = await client.GetWalletBalanceAsync(NativeContract.NEO.Hash.ToString()).ConfigureAwait(false);
365384
```
366385

367386
### GetNewAddressAsync
387+
368388
Creates a new account in the wallet and returns the corresponding address.
369389

370390
```cs
371391
string address = await client.GetNewAddressAsync().ConfigureAwait(false);
372392
```
373393

374394
### GetUnclaimedGasAsync
395+
375396
Displays amount of the unclaimed GAS in the wallet.
376397

377398
```cs
378399
BigInteger amount = await client.GetWalletUnclaimedGasAsync().ConfigureAwait(false);
379400
```
380401

381402
### ImportPrivKeyAsync
403+
382404
Imports the private key into the wallet.
383405

384406
```cs
@@ -387,13 +409,15 @@ RpcAccount account = await client.ImportPrivKeyAsync(wif).ConfigureAwait(false);
387409
```
388410

389411
### ListAddressAsync
412+
390413
Lists all the addresses in the wallet.
391414

392415
```cs
393416
List<RpcAccount> acoounts = await client.ListAddressAsync().ConfigureAwait(false);
394417
```
395418

396419
### SendFromAsync
420+
397421
Transfers asset from a specified address to another address.
398422

399423
```cs
@@ -403,13 +427,15 @@ string toAddress= "NZs2zXSPuuv9ZF6TDGSWT1RBmE8rfGj7UW";
403427
string amount = "100";
404428
JObject result = await client.SendFromAsync(assetId, fromAddress, toAddress, amount).ConfigureAwait(false);
405429
```
430+
406431
If the JSON transaction information is returned the transaction was sent successfully, or the transaction failed to be sent.
407432

408433
If the signature is incomplete transaction to be signed is returned.
409434

410435
If the balance is insufficient an error is returned.
411436

412437
### SendManyAsync
438+
413439
Transfers assets to multiple addresses. You can specify the sending address.
414440

415441
```cs
@@ -428,13 +454,15 @@ outs.Add(new RpcTransferOut
428454
});
429455
JObject result = await client.SendManyAsync("", outs).ConfigureAwait(false);
430456
```
457+
431458
If the JSON transaction information is returned the transaction was sent successfully, or the transaction failed to be sent.
432459

433460
If the signature is incomplete transaction to be signed is returned.
434461

435462
If the balance is insufficient an error is returned.
436463

437464
### SendToAddressAsync
465+
438466
Transfers asset to the specified address.
439467

440468
```cs
@@ -443,6 +471,7 @@ string toAddress = "NZs2zXSPuuv9ZF6TDGSWT1RBmE8rfGj7UW";
443471
string amount = "100";
444472
JObject result = await client.SendToAddressAsync(assetId, toAddress, amount).ConfigureAwait(false);
445473
```
474+
446475
If the JSON transaction information is returned the transaction was sent successfully, or the transaction failed to be sent.
447476

448477
If the signature is incomplete transaction to be signed is returned.
@@ -452,6 +481,7 @@ If the balance is insufficient an error is returned.
452481
## Plugins
453482

454483
### GetApplicationLogAsync
484+
455485
Gets the contract log by the specific transaction ID. The plugin ApplicationLogs is required for invoking this method.
456486

457487
```cs
@@ -476,6 +506,7 @@ RpcNep17Balances balances = await client.GetNep17BalancesAsync(address).Configur
476506
```
477507

478508
### GetNep17TransfersAsync
509+
479510
Returns all NEP-17 transaction records at the specific address. The plugin TokensTracker is required for invoking this method.
480511

481512
If start and end timestamps are specified, transactions occurred in the time range is returned.

docs/n3/develop/tool/sdk/transaction.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
`RpcClient` encapsulates the transaction construction module, which allows you to construct transactions in Neo N3 with specific parameters and methods to personalize your functions. This document introduces the relevant methods.
44

55
:::note
6-
If you use SDK to construct a transaction that requires a signature, you need to ensure that the RpcClient object and the network it is connected to are configured the same way, or the transaction constructed by the SDK will not be validated in the blockchain. To do so, load Neo-CLI config.json when constructing the RpcClient object, for example:
6+
If you use SDK to construct a transaction that requires a signature, you need to ensure that the RpcClient object and the network it is connected to are configured the same way, or the transaction constructed by the SDK will not be validated in the blockchain. To do so, load Neo-CLI config.json when constructing the RpcClient object, for example:
7+
8+
RpcClient client = new RpcClient(new Uri("http://localhost:20332"), null, null, ProtocolSettings.Load("config.json"))
79
:::
8-
>
9-
> RpcClient client = new RpcClient(new Uri("http://localhost:20332"), null, null, ProtocolSettings.Load("config.json"))
10+
1011

1112
## Transaction construction process
1213

@@ -18,7 +19,7 @@
1819
byte[] script = scriptHash.MakeScript("transfer", sender, receiver, 1"data");
1920
```
2021

21-
2. Construct `TransactionManagerFactory` with the parameter `RpcClient `; Construct `TransactionManager` with the parameters `Script` and`Signers`:
22+
2. Construct `TransactionManagerFactory` with the parameter `RpcClient`; Construct `TransactionManager` with the parameters `Script` and`Signers`:
2223

2324
```cs
2425
TransactionManager txManager = await new TransactionManagerFactory(client)
@@ -33,13 +34,15 @@
3334
// add signature for the transaction with sendKey
3435
txManager.AddSignature(sendKey);
3536
```
37+
3638
- multiple signatures
3739

3840
```cs
3941
// add multi-signatures for the transaction with sendKey
4042
txManager.AddMultiSig(key1, 2, receiverKey.PublicKey, key2.PublicKey, key3.PublicKey);
4143
txManager.AddMultiSig(key2, 2, receiverKey.PublicKey, key2.PublicKey, key3.PublicKey);
4244
```
45+
4346
- multi-signature contract
4447

4548
The nature of multi-signature comes from multi-signature contracts. You need to construct a multi-signature contract before you can obtain the multi-signature address and transfer assets. The following example uses 3 accounts to create a multi-signature contract which requires at least 2 account signatures for signing.
@@ -51,7 +54,7 @@
5154
UInt160 multiAccount = multiContract.Script.ToScriptHash();
5255
```
5356

54-
5. Verify signatures and add `Witness` to the transaction body.
57+
4. Verify signatures and add `Witness` to the transaction body.
5558

5659
If there are not enough signatures or fees an exception will be thrown.
5760

0 commit comments

Comments
 (0)