-
Notifications
You must be signed in to change notification settings - Fork 285
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
Release neo3 #945
Merged
Merged
Release neo3 #945
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b969925
update fee and api
8567925
Update fees.md
ShawnYun 74a60fb
Update fees.md
ShawnYun acd8a4f
add png
625b9d1
Update fees.md
ShawnYun 88a209c
Update fees.md
ShawnYun b505aa2
Update api.md
Celia18305 b3415f7
fixed some problem
8bec109
fix
4016634
fixed api
0221ff0
fixed api.md
09bf9e3
fixed api.md
64899be
fixed api.md
86400ef
Merge branch 'release-neo3' into release-neo3
Celia18305 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,40 +4,47 @@ | |
|
||
`dotnet neo-cli.dll /rpc` | ||
|
||
## 修改配置文件 | ||
|
||
若要通过 HTTPS 的方式访问 RPC 服务器,需要在启动节点前修改配置文件 `config.json`,并设置域名、证书和密码: | ||
|
||
```json | ||
{ | ||
"ApplicationConfiguration": { | ||
"Paths": { | ||
"Chain": "Chain" | ||
}, | ||
"P2P": { | ||
"Port": 10333, | ||
"WsPort": 10334 | ||
}, | ||
"RPC": { | ||
"Port": 10331, | ||
"SslCert": "YourSslCertFile.xxx", | ||
"SslCertPassword": "YourPassword" | ||
} | ||
## 配置 NEO-CLI | ||
|
||
### **配置 HTTPS** | ||
|
||
如果要通过 HTTPS 的方式访问 RPC 服务器,需要在启动节点前修改配置文件 `config.json`,并设置域名、证书和密码,如下所示: | ||
|
||
|
||
```json | ||
{ | ||
"ApplicationConfiguration": { | ||
"Paths": { | ||
"Chain": "Chain" | ||
}, | ||
"P2P": { | ||
"Port": 10333, | ||
"WsPort": 10334 | ||
}, | ||
"RPC": { | ||
"Port": 10331, | ||
"SslCert": "YourSslCertFile.xxx", | ||
"SslCertPassword": "YourPassword" | ||
} | ||
... | ||
``` | ||
|
||
### **配置钱包** | ||
|
||
如果要调用与钱包相关的 API,需要在 `config.json` 中进行以下配置: | ||
|
||
- 将 unlockwallet 改为 true 的状态, | ||
- 填写对象钱包的文件名和密码,如下所示: | ||
```json | ||
... | ||
``` | ||
|
||
如果要调用与钱包相关的 API,也需要先修改配置文件 `config.json`,将 unlockwallet 改为 true 的状态,并填写对象钱包的文件名和密码,如下所示: | ||
|
||
```json | ||
... | ||
"UnlockWallet": { | ||
"Path": "YourWallet.json", | ||
"Password": "YourPassword", | ||
"StartConsensus": false, | ||
"IsActive": true | ||
} | ||
... | ||
``` | ||
"UnlockWallet": { | ||
"Path": "YourWallet.json", | ||
"Password": "YourPassword", | ||
"StartConsensus": false, | ||
"IsActive": true | ||
} | ||
... | ||
``` | ||
|
||
完成配置后打开 NEO-CLI,客户端会在同步到最新区块后自动打开已配置的钱包并进行钱包索引同步。 | ||
|
||
|
@@ -52,51 +59,54 @@ JSON-RPC 服务器启动后,会监听 TCP 端口,默认端口如下。P2P | |
|
||
## 命令列表 | ||
|
||
| 方法 | 参数 | 说明 | 备注 | | ||
| ---------------------------------------- | ---------------------------------------- | ---------------------------- | -------- | | ||
| [claimgas](api/claimgas.md) | [address] | 提取钱包中的 GAS | 需要打开钱包 | | ||
| [dumpprivkey](api/dumpprivkey.md) | \<address> | 导出指定地址的私钥 | 需要打开钱包 | | ||
| [getaccountstate](api/getaccountstate.md) | \<address> | 根据账户地址,查询账户资产信息 | | | ||
| [getapplicationlog](api/getapplicationlog.md) | \<txid> | 根据指定的 NEP-5 交易 ID 获取合约日志。 | | | ||
| [getassetstate](api/getassetstate.md) | \<asset_id> | 根据指定的资产编号,查询资产信息 | | | ||
| [getbalance](api/getbalance.md) | \<asset_id> | 根据指定的资产编号,返回钱包中对应资产的余额信息 | 需要打开钱包 | | ||
> [!Note] | ||
> | ||
> **NEO3 变更**: | ||
> | ||
> 调用方式更新:getblockheader,getrawmempool | ||
> | ||
> 返回结果更新:getblock,getblockheader,getrawtransaction,getversion,getcontractstate | ||
|
||
| 方法 | 参数 | 说明 | 备注 | | ||
| ----------- | ---------- | ------------- | -------- | | ||
| [getbestblockhash](api/getbestblockhash.md) | | 获取主链中高度最大的区块的散列 | | | ||
| [getblock](api/getblock.md) | \<hash> [verbose=0] | 根据指定的散列值,返回对应的区块信息 | | | ||
| [getblock](api/getblock2.md) | \<index> [verbose=0] | 根据指定的索引,返回对应的区块信息 | | | ||
| | \<index> [verbose=0] | 根据指定的索引,返回对应的区块信息 | | | ||
| [getblockcount](api/getblockcount.md) | | 获取主链中区块的数量 | | | ||
| [getblockhash](api/getblockhash.md) | \<index> | 根据指定的索引,返回对应区块的散列值 | | | ||
| [getblockheader](api/getblockheader.md) | \<hash> [verbose=0] | 根据指定的散列值,返回对应的区块头信息。 | | | ||
| | \<index> [verbose=0] | 根据指定的索引,返回对应的区块头信息。 | | | ||
| [getblocksysfee](api/getblocksysfee.md) | \<index> | 根据指定的索引,返回截止到该区块前的系统手续费 | | | ||
| [getclaimable](api/getclaimable.md) | <address> | 根据指定地址,返回可以 claim 的 GAS 信息。 | | | ||
| [getconnectioncount](api/getconnectioncount.md) | | 获取节点当前的连接数 | | | ||
| [getcontractstate](api/getcontractstate.md) | \<script_hash> | 根据合约脚本散列,查询合约信息 | | | ||
| [getmetricblocktimestamp](api/getmetricblocktimestamp.md) | \<blocks numbers> \<endHeight> | 返回指定区块高度及之前 n 个区块的 timestamp。 | | | ||
| [getnep5balances](api/getnep5balances.md) | \<address> | 返回指定地址内的所有 NEP-5 资产余额。 | | | ||
| [getnep5transfers](api/getnep5transfers.md) | \<address> | 返回指定地址内的所有 NEP-5 交易记录。 | | | ||
| [getnewaddress](api/getnewaddress.md) | | 创建一个新的地址 | 需要打开钱包 | | ||
| [getrawmempool](api/getrawmempool.md) | | 获取内存中未确认的交易列表 | | | ||
| [getpeers](api/getpeers.md) | | 获得该节点当前已连接/未连接的节点列表 | | | ||
| [getrawmempool](api/getrawmempool.md) | [shouldGetUnverified=0] | 获取内存中未确认的交易列表 | | | ||
| [getrawtransaction](api/getrawtransaction.md) | \<txid> [verbose=0] | 根据指定的散列值,返回对应的交易信息 | | | ||
| [getstorage](api/getstorage.md) | \<script_hash> \<key> | 根据合约脚本散列和存储的 key,返回存储的 value | | | ||
| [gettransactionheight](api/gettransactionheight.md) | \<txid> | 获取交易高度。 | | | ||
| [gettxout](api/gettxout.md) | \<txid> \<n> | 根据指定的散列和索引,返回对应的交易输出(零钱)信息 | | | ||
| [getpeers](api/getpeers.md) | | 获得该节点当前已连接/未连接的节点列表 | | | ||
| [getunclaimed](api/getunclaimed.md) | \<address> | 返回地址中未提取的 GAS 数量。 | | | ||
| [getunclaimedgas](api/getunclaimedgas.md) | | 显示钱包中未提取的 GAS 数量。 | 需要打开钱包 | | ||
| [getunspents](api/getunspents.md) | \<address> | 返回指定账户中未花费的 UTXO 资产信息。 | | | ||
| [getversion](api/getversion.md) | | 获取查询节点的版本信息 | | | ||
| [getvalidators](api/getvalidators.md) | | 查看当前共识节点的信息 | | | ||
| [getwalletheight](api/getwalletheight.md) | | 获取当前钱包索引高度 | 需要打开钱包 | | ||
| [importprivkey](api/importprivkey.md) | | 导入私钥到钱包 | 需要打开钱包 | | ||
| [getversion](api/getversion.md) | | 获取查询节点的版本信息 | | | ||
| [invokefunction](api/invokefunction.md) | \<script_hash> \<operation> \<params> | 以指定的脚本散列值调用智能合约,传入操作及参数 | | | ||
| [invokescript](api/invokescript.md) | \<script> | 通过虚拟机运行脚本并返回结果 | | | ||
| [listaddress](api/listaddress.md) | | 列出当前钱包内的所有地址 | 需要打开钱包 | | ||
| [listplugins](api/listplugins.md) | | 列出节点已加载的所有插件。 | | | ||
| [sendrawtransaction](api/sendrawtransaction.md) | \<hex> | 广播交易 | | | ||
| [sendfrom](api/sendfrom.md) | \<asset_id> \<from>\<to> \<value> [fee=0] | 从指定地址,向指定地址转账 | 需要打开钱包 | | ||
| [sendtoaddress](api/sendtoaddress.md) | \<asset_id> \<address> \<value> [fee=0] | 向指定地址转账 | 需要打开钱包 | | ||
| [sendmany](api/sendmany.md) | \<outputs_array> \[fee=0] \[change_address] | 批量转账命令 | 需要打开钱包 | | ||
| [submitblock](api/submitblock.md) | \<hex> | 提交新的区块 | 需要成为共识节点 | | ||
| [validateaddress](api/validateaddress.md) | \<address> | 验证地址是否是正确的 NEO 地址 | | | ||
| [validateaddress](api/validateaddress.md) | \<address> | 验证地址是否是正确的 Neo 地址 | | | ||
|
||
## RpcWallet 插件 | ||
|
||
| 方法 | 参数 | 说明 | 备注 | | ||
| ----------- | ---------- | ------------- | -------- | | ||
| [dumpprivkey ](api/rpcwallets/dumpprivkey.md) | \<address> | 导出指定地址的私钥 | | | ||
| [getbalance](api/rpccwallets/getbalance.md) | \<asset_id> | 查询资产余额 | | | ||
| [getnewaddress](/api/rpcwallets/getnewaddress.md) | | 创建一个新的地址 | | | ||
| [getunclaimedgas](/api/rpcwallets/getunclaimedgas.md) | | 显示钱包中未提取的 GAS 数量 | | | ||
| [getwalletheight](/api/rpcwallets/getwalletheight.md) | | 获取当前钱包索引高度 | | | ||
| [importprivkey](/api/rpcwallets/importprivkey.md) | \<key> | 导入私钥到钱包 | | | ||
| [listaddress](/api/rpcwallets/listaddress.md) | | 列出当前钱包内的所有地址 | | | ||
| [sendfrom](/api/rpcwallets/sendfrom.md) | \<asset_id>\<from>\<to>\<value>\[fee]\[change_address] | 从指定地址,向指定地址转账 | | | ||
| [sendmany](/api/rpcwallets/sendmany.md) | \<outputs_array>\[fee]\[change_address] | 批量转账命令 | | | ||
| [sendtoaddress](/api/rpcwallets/sendtoaddress.md) | \<asset_id>\<address>\<value>\[fee]\[change_address] | 向指定地址转账 | | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | sendfrom | <asset_id><from><to><value> | 从指定地址,向指定地址转账 | | |
||
|
||
|
||
## GET 请求示例 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个一部分,感觉适合放到节点那一部分?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来的文档也是这么写的,要改到节点去吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们商量了一下,放到节点那边比较合适,关于配置的这一小块可以去除。